フィルターのクリア

Controlling the spacing of markers in fplot (symbolic variable)

97 ビュー (過去 30 日間)
Sentient6
Sentient6 2016 年 12 月 7 日
コメント済み: Karan Gill 2016 年 12 月 8 日
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 件のコメント
Chaya N
Chaya N 2016 年 12 月 8 日
編集済み: Chaya N 2016 年 12 月 8 日
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 2016 年 12 月 8 日
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.

サインインしてコメントする。

回答 (1 件)

Jiro Doke
Jiro Doke 2016 年 12 月 8 日
編集済み: Jiro Doke 2016 年 12 月 8 日
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))

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by