hold on/off for loglog axes
Show older comments
I want to plot multiple lines on loglog axes on one figure, something like:
figure(3)
clf('reset')
hold on
loglog(t1, g1, 'r')
loglog(t2, g2, 'b')
loglog(t3, g3, 'Color', [0 .5, 0])
hold off
xlabel('$$t$$','Interpreter','latex')
ylabel('$$g$$','Interpreter','latex')
I know if I use colours that have a matlab shortcut, i.e. use 'g' for plotting g3 for example, I could plot these all in
loglog(t1, g1, 'r', t2, g2, 'b', t3, g3, 'g')
without using hold. But I've previously used the first colour scheme for my data and would like to avoid having to change all my previously saved figures.
Does anyone know a way to make the three curves different colours on loglog axes using colours that don't have a short name in Matlab?
2 Comments
Michael
on 22 Nov 2023
I am not sure if I understand your question correctly but maybe a solution could be to invoke the line 'hold on' after the first loglog.. command?
Star Strider
on 22 Nov 2023
‘Does anyone know a way to make the three curves different colours on loglog axes using colours that don't have a short name in Matlab?’
You can create your own colormap. See Colormap Editor for one way to create one you want. You can then use specific rows of the colormap to define specific colours.
Accepted Answer
More Answers (0)
Categories
Find more on Log Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
