How to draw 2 different plot on a graph

we have two column A and B. so how to draw 2 different plots on a graph?

답변 (1개)

Tommy
Tommy 2020년 5월 29일
편집: Tommy 2020년 5월 29일

0 개 추천

hold on
or
set(gca, 'NextPlot', 'add')
in between your calls to plot or however you are plotting.

댓글 수: 5

Hung Tat Ho
Hung Tat Ho 2020년 5월 29일
thanks Tommy, if the number of each column to much(about 1.300.000 row) how can i draw it?
Tommy
Tommy 2020년 5월 29일
Can you provide all of your code? I'm thinking a bit more context could be useful.
Hung Tat Ho
Hung Tat Ho 2020년 5월 29일
편집: Hung Tat Ho 2020년 5월 29일
Thank Tommy, here is my code, can you help me! newdata is about 1 column and 1.300.000 rows
[clearData,outlierIndices]=rmoutliers(Databbase);
Newdata=table2array(clearData)
A=Newdata(:,1);
plot(A,'m-')
Ok thank you. What are you hoping the plot will look like? Your vector is so long that it is impossible to see any of the background which would make it easier to see the actual values being plotted. Similar to the following:
plot(rand(1000000,1))
Do you no longer have two columns to plot?
Hung Tat Ho
Hung Tat Ho 2020년 5월 29일
Hi. i have two columns with too much raws as each column and i want the plot look like as below, it included two different plots in one graph.

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

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

2020년 5월 29일

댓글:

2020년 5월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by