Controlling the spacing of markers in fplot (symbolic variable)

110 Ansichten (letzte 30 Tage)
Sentient6
Sentient6 am 7 Dez. 2016
Kommentiert: Karan Gill am 8 Dez. 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 Kommentare
Chaya N
Chaya N am 8 Dez. 2016
Bearbeitet: Chaya N am 8 Dez. 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 am 8 Dez. 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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jiro Doke
Jiro Doke am 8 Dez. 2016
Bearbeitet: Jiro Doke am 8 Dez. 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))

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by