Azzera filtri
Azzera filtri

Linestyle of matrix with plotyy

1 visualizzazione (ultimi 30 giorni)
Thomas Johansson
Thomas Johansson il 1 Feb 2016
Risposto: dpb il 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

Risposte (1)

dpb
dpb il 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.

Categorie

Scopri di più su Two y-axis in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by