How can we generate a plot with multiple lines?

Hi All,
This is what I know to create a plot:
figure
subplot(1,2,1)
plot (data (:,9), data (:,10), '+')
title('Social support vs. burden')
xlabel('social support')
ylabel('burden')
subplot(1, 2, 2)
plot (data (:,9), data (:,11), '+')
title('Perceived Social support vs. Satisfaction')
xlabel('Perceived Soacial support')
ylabel('Satisfaction')
So my question is: Can I create a plot that has multiple lines to describe data without having two separated plots?

답변 (1개)

Raghava S N
Raghava S N 2024년 10월 4일

0 개 추천

Hello,
The MATLAB “hold” command is used to plot multiple plots on the same axes. The command “hold on” sets the axes hold state to on, which retains plots in the current axes so that new plots added to the axes do not delete existing plots.
Refer to this link for more information about the “hold” command - https://www.mathworks.com/help/matlab/ref/hold.html.

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

질문:

2015년 2월 15일

답변:

2024년 10월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by