Controlling the spacing of markers in fplot (symbolic variable)

105 visualizaciones (últimos 30 días)
Sentient6
Sentient6 el 7 de Dic. de 2016
Comentada: Karan Gill el 8 de Dic. de 2016
Hi. I can't quite figure out how to tell Matlab what number of markers to use on a given plot. I understand that by default it created a marker for each data point, and I've seen a few answers suggesting the use of "scatter()" or mapping a vector of fewer data points of the same function..
Thing is, I'm using symbolic variables, so those options don't work (at least I couldn't get them to). So is there an option that can work?
Basically, when plotting several graphs on the same axes, I just want to mark each continuous plot with a different marker, since I usually print them out in b&w, and sometimes the linspace options aren't enough. But the default marker setting just floods the graph with markers, making a mess. It would be nice to have an option to put like 10 markers on the entire graph.
  2 comentarios
Chaya N
Chaya N el 8 de Dic. de 2016
Editada: Chaya N el 8 de Dic. de 2016
May I suggest plotting the graphs with different line styles and widths instead? You could do solid, dotted, dashed lines etc.
Karan Gill
Karan Gill el 8 de Dic. de 2016
Yep it could be that markers aren't the way to go. In addition to line styles, you can use colors. Also, it would be useful to see your code.

Iniciar sesión para comentar.

Respuestas (1)

Jiro Doke
Jiro Doke el 8 de Dic. de 2016
Editada: Jiro Doke el 8 de Dic. de 2016
How about converting your symbolic variables to numeric just for plotting? Then all those suggestions would work.
Moreover, if you are using R2016b (or newer), you can make use of the new MarkerIndices property of plot.
syms x
y = sin(x);
xd = 0:0.1:10;
yd = double(subs(y,xd));
plot(xd,yd,'o-','MarkerIndices',1:5:length(xd))

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by