Clear Filters
Clear Filters

Linestyle of matrix with plotyy

1 view (last 30 days)
Thomas Johansson
Thomas Johansson on 1 Feb 2016
Answered: dpb on 1 Feb 2016
Hi, I am plotting two matrix with plotyy and want to change the linestyle of all the lines belonging to the first matrix. [hx,hL1,hL2]=plotyy(x,Y1,x,Y2) The problem is that the linestyle handle is the size of the lines in the matrix and I do not want to loop through them all. hL1.LineStyle = '--' does not work, gives
Expected one output from a curly brace or dot indexing expression, but there were 10 results.
I hope someone can help me.
BR thomas

Answers (1)

dpb
dpb on 1 Feb 2016
Use set for multiple handles...
set(hL1,'linestyle',':')
Don't know why TMW didn't add the facility in the methods; if going to trouble to write them one would think they'd be useful for the real world cases, not just the simple ones.
doc set % for details
Drill down for the arcane cases of multiple handles w/ differing values, etc., etc., etc., ... You can do almost anything desired via cell arrays as arguments.

Categories

Find more on Two y-axis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!