Plot non-continuous lines with markers

조회 수: 18 (최근 30일)
Anindya G
Anindya G 2020년 1월 22일
댓글: Anindya G 2020년 1월 22일
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일
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개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by