hold on/off for loglog axes
이전 댓글 표시
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
Michael
2023년 11월 22일
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
2023년 11월 22일
‘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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Log Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

