I have a simulation that produces range of numbers which I plotted into Contour plot. The problem is, these values are not linear in respect to X or Y axis and visually it is better to plot them as decibel (dB). See below
[C,h] = contour(XPOS_VECT,YPOS_VECT,Values,50,'ShowText','on'); set(gca,'Clim',[150 210]);
While it is easier to see visually, non technical people (my target audience of this plot) might misunderstand the values as they are described in dB rather than linear. Therefore, I would like my contour plot to have pattern in dB progression (as shown in the figure above) while the label shows linear number associated with each dB number. Can someone provide any insight or help for this? Thanks beforehand
Turns out if you do not pass the contour handle to clabel, then clabel outputs the labels, which you can easily change. If you instead add the contour handle, then the labels are stored in the contour handle's hidden property 'TextPrism'.
Here's an example where the labels are increased by a factor of two using the hidden property:
[C,hContour]=contourf(peaks) clabel(C,hContour) drawnow labels=hContour.TextPrims for idx = 1 : numel(labels) LabelValue=str2num(labels(idx).String); NewValue=LabelValue*2; hContour.TextPrims(idx).String=num2str(NewValue) end