If I try to plot multiple plots with a logarithmic axis, the log scale is disabled. If I remove the hold on
the log scale is enabled, but I can only plot a single plot.
figure(1); clf
x = linspace(0,1,100);
y = exp(-x);
hold on;
semilogy(x, y);
semilogy(x, 2*y);
hold off;
Why?, How can I create multiple log scale plots?
Your code works already in octave (and I don't have matlab at this computer), but I think the problem is that you do hold on
before the first plot, hence preventing the initial axis to be created. try this:
figure(1); clf
x = linspace(0,1,100);
y = exp(-x);
semilogy(x, y);
hold on;
semilogy(x, 2*y);
hold off;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With