MATLAB Answers

MattyK
0

good day! Help me please. How can i get rid of the yellow color in this attached contour filled plot?. Thanks.

Asked by MattyK
on 10 Nov 2015
Latest activity Commented on by Star Strider
on 19 Nov 2015
good day! Help me please. How can i get rid of the yellow color in this attached contour filled plot?. Thanks.

  5 Comments

Okay. Basically i just applied a contourf function over a somewhat projection with the code:
m_contourf(lon,lat,data(lat,lon),[-20.5:-10.5])
Please take note that I tried restricting the axis limits of the contour i.e. [-20.5:-10.5] as the aim was to get rid of all values above -10.5
Thanks.
Okay. Basically i just applied a contourf function over a somewhat projection with the code:
m_contourf(lon,lat,data(lat,lon),[-20.5:-10.5])
Please take note that I tried restricting the axis limits of the contour i.e. [-20.5:-10.5] as the aim was to get rid of all values above -10.5
Thanks.

Sign in to comment.

1 Answer

Answer by Star Strider
on 11 Nov 2015
 Accepted Answer

Edit the colormap for that figure so that the last value in the matrix is [1 1 1].

  8 Comments

I don’t understand what you mean by ‘overlap’. The default behaviour of the ticks are to be in the centres of the colours they depict on the plot, which is how I would expect them to be labeled. Positioning them to be anywhere else would be difficult.
You can manually set the 'Tick' values and 'Ticklabels' as described in Specify Colorbar Ticks and Tick Labels. You can find out what the current colorbar ticks are with the ‘cbt’ assignment, then create a new vector for them with ‘tks’:
cb = colorbar;
cbt = get(cb, 'Ticks');
tks = linspace(min(cbt), max(cbt), 6);
set(cb, 'Ticks', tks)
This uses get and set, but the same set would work with the syntax in the link I included. You will have to experiment to get the result you want. The code snippet I included here should get you started.
Thank you very much and for your patience. I will try very hard.

Sign in to comment.