Plotyy and giving each line its own color
3 次查看(过去 30 天)
显示 更早的评论
Is this possible? I have two curves plotting on the secondary axis and two on the primary. I can get each axis to graph in separate colors but I also want to have differentiation within a plotting axis.
0 个评论
回答(1 个)
Iain
2014-10-9
It is possible. It might not be that good of an idea if it makes it hard to identify which line goes with which axis (using subplot & linkaxes is probably a better idea).
What you need to do, is get the line object for the curve you want to do something to, and tell it to set it's properties....
[axishandles curve1handle curve2handle] = plotyy(....);
get(curve1handle) % This will give you a list of properties you can change...
set(curve1handle,'property','new setting')
另请参阅
类别
在 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!