Cycle line type before color type on plot?

2 views (last 30 days)
Larry
Larry on 1 Jul 2015
Commented: dpb on 2 Jul 2015
I have an array SVP of r rows and c columns, which I can plot easily vs. Temperature, a r row vector:
plot(Temperature, SVP, 'LineWidth', 1.25);
MATLAB defaults to plotting each column of SVP with a different color , and changes line style only after all colors have cycled through. I want to reverse this arrangement: how do I have line style cycle before color style?
I could use a loop, but I'd like to change the default order of the cycling so it applies to all graphs I make. (After all, about 10% of an audience is color blind!)
Thanks, all.

Accepted Answer

dpb
dpb on 1 Jul 2015
I don't believe that level of customization is available--you can change the line and color orders but don't believe there's any way to cause the one to change its precedence order relative to the other as they're separate properties lists but there's no property that refers to precedence between style properties.
Seems like a valid enhancement. Submit a request at the www.mathworks.com link altho I'd guess it'd get pretty low priority rating if it's not submitted its rank is zero.
  2 Comments
Larry
Larry on 1 Jul 2015
Thanks for your answer. Agreed on all points. I'll leave the question open in hopes of a more...rapidly implementable solution!
dpb
dpb on 2 Jul 2015
Well the "rapidly implementable" solution is the one you already outlined--store the line style and color properties in order of desired precedence in local array and then set() them. You can, I think, manage to apply post-plotting by the cell array syntax with a handle array of the corresponding lines or the expedient of drawing/adding the lines in a sequential order.
I think there just is no way to reorder the priority automagically.

Sign in to comment.

More Answers (0)

Categories

Find more on Line Plots 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!