MERGING OF MULTIPLE GRAPHS INTO ONE

조회 수: 1 (최근 30일)
SULENDER SAHU
SULENDER SAHU 2022년 3월 2일
답변: ag 2024년 9월 25일
Is there any method to get a single graph from the above four graphs ? I have the data for individual graphs .
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2022년 3월 3일
What do you mean by a single graph?

댓글을 달려면 로그인하십시오.

답변 (1개)

ag
ag 2024년 9월 25일
Hi Sulender,
To plot multiple graphs on the same figure window, you can use the "hold on" command.
The below code snippet demonstrate how to achieve this using dummy data:
% Data for plotting
x = linspace(0, 2*pi, 100);
y1 = sin(x);
y2 = cos(x);
% First graph
figure; % Open a new figure window
plot(x, y1);
hold on
% Second graph
plot(x, y2);
xlabel('x');
legend('sin(x)', 'cos(x)');
title('Waves');
For more details, please refer to the following MathWorks documentation: Hold - https://www.mathworks.com/help/matlab/ref/hold.html
Hope this helps!

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by