フィルターのクリア

Marker Symbol 'I' in plot

16 ビュー (過去 30 日間)
Arijana Bohr
Arijana Bohr 2020 年 11 月 6 日
コメント済み: Star Strider 2020 年 11 月 6 日
I would like to use '|' the vertical line as a marker symbol. It is also listed as a marker symbol here: https://www.mathworks.com/help/matlab/creating_plots/create-line-plot-with-markers.html However when I tried to use it, I got this error message:
Error setting property 'Marker' of class 'Line':
'|' is not a valid value. Use one of these values: '+' | 'o' | '*' | '.' | 'x' | 'square' | 'diamond' | 'v' | '^' | '>' | '<' | 'pentagram' | 'hexagram'
| 'none'.
Is it possibe to use '|' as a marker symbol and if yes, how do I do that?

採用された回答

Star Strider
Star Strider 2020 年 11 月 6 日
You can use a text object as a work-around:
x = 1:50;
y = rand(size(x));
figure
plot(x, y, '.', 'Color','none')
axis([0 50 0 1])
text(x, y, '|', 'VerticalAlignment','middle', 'HorizontalAlignment','center', 'Color','r')
producing:
If you want to use the horizontal line with this approach, use (char(151)) not underscore _.
.
  2 件のコメント
Arijana Bohr
Arijana Bohr 2020 年 11 月 6 日
Thank you!
Star Strider
Star Strider 2020 年 11 月 6 日
As always, my pleasure!

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

その他の回答 (1 件)

Sean de Wolski
Sean de Wolski 2020 年 11 月 6 日
編集済み: Walter Roberson 2020 年 11 月 6 日
  1 件のコメント
Arijana Bohr
Arijana Bohr 2020 年 11 月 6 日
Thank you!

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by