
Matlab 2012 ytick how to#
In a different post, I explain how to freeze colors for different colormaps on the same figure.
Matlab 2012 ytick serial#
Incorrect: colorbar('YTick',log(Contours),'YTickLabel',Contours,'FontSize',12) I am trying to plot dates on a figure on the x-axis, and show actual dates versus Matlab serial date numbers (i.e. Use: colorbar('YTick',log(Contours),'YTickLabel',Contours) Ĭaxis(log()) Ĥ) Make sure the last thing you do is set the Ticks! I've noticed if you have any other commands after this in the colorbar command, it reverts back to something funky.Įxample: Correct: colorbar('FontSize',12,'YTick',log(Contours),'YTickLabel',Contours) contourf(log(Data(:,:)),log(Contours)) ģ) Define the tick marks on your colorbar The last step is to make the colorbar show the correct data. While we cannot use TeX in tick labels yet (this will change in the upcoming HG2 ), using sprintf formatting does enable quite a bit of flexibility. In December 2014, a few of us from MathWorks attended the AGU meeting (American Geophysical Union).And last week, I was invited to give a webinar to the IRIS (Incorporated Research Institutions for Seismology) community. That’s all there is to it: Whenever YTick changes its value(s), our callback function (m圜allbackFunction) will automatically be called. Also be sure to take the log of your defined contours so they show up in the right spot. I've recently been engaged in several events of potential interest to the geophysics community. For the plot here, I used: Contours= Ģ) Plot your Data Using imagesc, contourf, or some other function, plot the log of your data. m xticklabels ('mode') returns the current value of.
Matlab 2012 ytick manual#
xticklabels ('manual') sets a manual mode, freezing the x -axis tick labels at the current values. Use this option if you set the labels and then want to set them back to the default values. A quick google search on how to make logarithmic contour plots and logarithmic color-bars yielded some unhelpful results, so I thought I'd give a quick post here.ġ) Define Your Contours Define where you'd like contours. xticklabels ('auto') sets an automatic mode, enabling the axes to determine the x -axis tick labels.

In a different post, I explain how to freeze colors for different colormaps on the same figure.A lot of my data ranges orders of magnitude, and can be very hard to depict using standard MATLAB functions like imagesc, contourf, contour, etc. Incorrect: colorbar('YTick',log(Contours),'YTickLabel',Contours,'FontSize',12) Especially if you can see the numbers embedded in. Others will see a '21.' And the significant portion of the population with achromatopsia, a form of color blindness, will see no numbers at all. contourf(log(Data(:,:)),log(Contours)) ģ) Define the tick marks on your colorbar The last step is to make the colorbar show the correct data. If you can see a two-digit number in this image, count yourself fortunate: Most of you will see the '74' in this Ishihara color blindness test image. Also be sure to take the log of your defined contours so they show up in the right spot. A quick google search on how to make logarithmic contour plots and logarithmic color-bars yielded some unhelpful results, so I thought I'd give a quick post here.ġ) Define Your Contours Define where you'd like contours. A lot of my data ranges orders of magnitude, and can be very hard to depict using standard MATLAB functions like imagesc, contourf, contour, etc.
