Filter löschen
Filter löschen

How to adjust the greyscale colorbar to cover a large range?

1 Ansicht (letzte 30 Tage)
Yvonne
Yvonne am 4 Feb. 2011
Hi,
I think this question might have been asked previously but I have not been able to find any threads to this.
I have a bathymetry pcolor plot and I am trying to adjust the scales of the colorbar by using the colormap as the depth values ranged from -30 to 0.5. At this stage, I am trying to see more details on the -5 to 0.5 and have less detail on the -30 as most of my bathymetry are between the depths of -5 to 0.5. At this stage, all my areas that is less than -5 is in the dark scale.
Any suggestions will be great.
Thank you

Antworten (1)

Walter Roberson
Walter Roberson am 4 Feb. 2011
Ncol = 128; fliplr(-logspace(0,log10(31.5),NCol))+1.5
This would distribute roughly the first 55 of 128 positions below -5 using a logarithmically decreasing spacing as it gets towards 5.
I would guess that you would prefer to have even fewer values below -5; in order to do that you will have to give us an idea of the sort of spacing you would consider acceptable.
For example, there are always possibilities such as:
Ndark = 20; t1 = linspace(-30,-5,Ndark+1); t2 = linspace(-5,5,128-Ndark); intensitybounds = [t1(1:end-1) t2];
which is plain linear from -30 to -5 and then plain linear with higher density from -5 to +5.

Kategorien

Mehr zu Colormaps finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by