I have an axis on a 3D plot which I would like to plot in percent. Currently, the values are decimals. So for example, I would like 0.12 to be displayed as ‘12%’.
Currently, I am using:
temp_zlabels=100*str2num(get(gca,'ZTickLabel'));
set(gca, 'ZTickLabel', sprintf('%d%%|', temp_zlabels))
This works fine, but when make the chart bigger or rotate it, the axis values start over, instead of re-scaling.
So for example, if I have an axis (0% 25% 50% 75%), and I make the graph bigger, the axis now reads (0% 25% 50% 75% 0% 25% 50% 75%) instead of correctly re-scaling the original axis.
What is the best way to label the axis in percent, where I do not run into this problem?
You have to have
ZTickmatching yourZTickLabel: