Axis in scientific form - have tried to stop it....
29 visualizzazioni (ultimi 30 giorni)
axis in scientific form - have tried to stop it….
I have a plot with a logarithmic scale on the x-axis and I want it to say the numbers like 1,10,100,1000 etc. and not 10^0, 10^1, 10^2 etc. It'd be great if someone could help me do that.
I've given it about 20 minutes just now and I gave it 20 minutes yesterday too and I still can't get it to work. I've left my attempt on the bottom anyway.
m = 0.05;
k = 1000;
R = 1;
f = linspace(0,19999,20000);
Xm = m.*(2*pi.*f) - k./(2*pi.*f);
%set(gca,'XTick', [0,1,10,100,1000,10000]); %set(gca,'XTickLabel',sprintf('%3.4f|',f))
Walter Roberson il 28 Gen 2012
curtick = get(gca, 'XTick');
set(gca, 'XTickLabel', cellstr(num2str(curtick(:))));
The scientific notation is not used if the tick labels are set.
Also note the "trick" of passing a column vector to num2str.