plotyy set random paired linestyles
2 次查看(过去 30 天)
显示 更早的评论
I have two sets of data to plot on plotyy.
When I plot d1 & d2, I want d1(:,1) to have the same colour and linestyle as d2(:,1). I want further matching columns in d1 & d2 (i.e. d1(:,x),d2(:,x)) to have the same properties as each other, but different to other columns.
In other cases I have done this using a loop:
mrk={'o','s','*','v','+','^'} %These are the markers I want to use
for n=1:6
hold all
set(gca(),'linestyle',mrk(n))
plot(d1(:,n))
end
I could plot d2 at the end of the loop, but then I don't know how to customise the axes to make a plot become a plotyy.
What I would like to do is something like this (which doesn't work)
mrk={'o','s','*','v','+','^'}
set(gca(),'linestyleorder',mrk)
[ax,h1,h2] = plotyy(2010:2050,d1,2010:2050,d2)
Alternatively I have tried to set the linestyles using the handles, which also I cannot do... i.e.:
set(h1(n),'linestyle',mrk(n))
Unfortunately, as you can see I still have a poor understanding of all the properties,and where one can or cannot be used.
I have managed this with colours, but not markers/linestyles by using
set(gca,'colororder',mycolororder);
Thanks!
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Two y-axis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!