Plot non-continuous lines with markers

Hello,
I want to plot lines with marker but I do not the lines to touch the marker. E.g. when I execute a command such as
x = [1 2 3 4];
y = [2 3 2 1];
figure;
plot(x, y, '-bo', 'LineWidth', 3, 'MarkerSize', 10, 'MarkerFaceColor', [0 0 1]);
axis([0 5 0 4]);
I get the following plot:
continuous_lines.png
However, I do not want the lines to touch the markers, i.e., I want to plot the following figure:
non_continuous_lines.png
Could anyone suggest how can I achieve the non-continuous lines as shown above?
Any help will be greatly appreciated.
Regards,
AG

 採用された回答

KSSV
KSSV 2020 年 1 月 22 日
編集済み: KSSV 2020 年 1 月 22 日

3 投票

x = [1 2 3 4];
y = [2 3 2 1];
figure;
plot(x, y, '-bo', 'LineWidth', 3, 'MarkerSize', 20, 'MarkerFaceColor', 'w', 'MarkerEdgeColor','w');
hold on
plot(x, y, 'bo','MarkerSize', 10, 'MarkerFaceColor', [0 0 1]);
axis([0 5 0 4]);
Increase the MarkerSize in the first plot, if you want more break.
Capture.PNG

1 件のコメント

Anindya G
Anindya G 2020 年 1 月 22 日
Thank you! This is very helpful!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

タグ

質問済み:

2020 年 1 月 22 日

コメント済み:

2020 年 1 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by