2

When you set DefaultAxesColorOrder and DefaultAxesLineStyleOrder, MATLAB will first cycle through all colors with the first style, then again through all colors with the second style and so on.

What I would like to do is to reverse the cyclying order, so that it cycles through the different line styles first, before cycling to the next color to repeat this process.

For example, if I set DefaultAxesColorOrder to [1 0 0; 0 1 0; 0 0 1] and DefaultAxesLineStyleOrder to '-|--|:', the lines will be:

'r-','g-','b-','r--','g--','b--','r:','g:','b:'

I just want the lines to be

'r-','r--','r:','g-','g--','g:','b-','b--','b:' instead.

This should enhance the visual appearance for certain data as the plot looks less colorful or "random" when going through the line styles first.

Edit: I explained in the comments below, why I'd still appreciate help to find a solution (at least with the existing codes mentioned there as well)

sparani
  • 31
  • 4
  • It's uncanny how the wording of this question ressemble this other one: [set line's color and style order to be applied in parallel](https://stackoverflow.com/questions/7326009/matlab-set-lines-color-and-style-order-to-be-applied-in-parallel) – Hoki Sep 12 '19 at 17:20
  • @Hoki Well, I looked for a solution first, of course, so I found this "potential dublicate" and used it to formulate my question properly. However, the result of [that question](https://stackoverflow.com/questions/7326009/matlab-set-lines-color-and-style-order-to-be-applied-in-parallel) is actually quite different, so I'd appreciate if you could explain how to change the code to get the result I asked for. The only answer to my question is imho [this one](https://stackoverflow.com/a/47885965/10548338) but it's not for MATLAB. – sparani Sep 13 '19 at 00:11
  • both solutions in the other questions answer yours. **It is not possible** to modify the fact that Matlab cycle through the color before the linestyles. So if you want a custom alternance of any style (line and/or color), you have to define it yourself. Both solutions in the other questions offer you a way to do that to your liking. – Hoki Sep 13 '19 at 08:39
  • @Hoki okay thanks, fair point! Unfortunately I'm not a coder - so I applied the codes but just wasn't able to change it accordingly to make it work. That's why I posted the question for that particular scenario again. I'd still appreciate more insight on it. – sparani Sep 14 '19 at 00:55
  • The linked Q&A shows how to set color and line properties for each line in bulk. I don’t know what else you would need to satisfy your question. – Cris Luengo Sep 17 '19 at 01:04

0 Answers0