0
votes

I'm trying to create a plot using the values 10^0 10^3 10^6 10^9... on the x-axis. Matlab does not automatically rescale so my values are all down in the left corner.

My current code is:

figure('name','My plot title');
hold on
plot(kap, reg, '--mo');
plot(kap, reij, '-.r*');
hold off 

kap is a vector of x values -> 10^0 10^3 10^6 10^9....., reg and reij are measurements.


Maybe loglog, semilogx could help?

A picture of my plot: enter link description here


The problem was that I should use loglog or semilogx and not use it in a figure.

1

1 Answers

0
votes

Yep, semilogx is what you want:

semilogx(kap,reg,'--mo');

loglog gives logarithmic scales for both x and y axes, and semilogy plots with a lagarithmic scale on the y axis.

x=10.^(0:3:30);
y=rand(size(x));
semilogx(x,y)