How to set LineStyle for matrix plotting?
36 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
András
el 5 de Mayo de 2015
Comentada: András
el 5 de Mayo de 2015
I have a matrix that I would like to plot, but I would like each column to be plotted using a different LineStyle. To do so I set the Axes LineStyleOrder property to the desired value, then I set the NextPlot property to 'replacechildren', but for some reason all columns get the same (the first value in LineStyleOrder) LineStyle. I works well with ColorOrder, but not with LineStyles.
Anyone knows why, or how I should solve my problem?
Thanks in advance!
0 comentarios
Respuesta aceptada
Michael Haderlein
el 5 de Mayo de 2015
Editada: Michael Haderlein
el 5 de Mayo de 2015
Axes increments the line style only after using all of the colors in the ColorOrder property .
Plus, you need to set hold all:
set(axes,'LineStyleOrder',{'-','--',':','-.'}') %create axes with respective LineStyleOrder
hold all %Prevent clearing LineStyleOrder
plot(1:3,bsxfun(@plus,rand(3,15),0:14)) %use it
3 comentarios
Michael Haderlein
el 5 de Mayo de 2015
Editada: Michael Haderlein
el 5 de Mayo de 2015
I don't see a possibility to do it this way. I have once made a function which will set the line styles to all children of given axes (useful for b/w printings). But to do it in advance? I wouldn't know how right now.
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!