interrupted axis and plotting non values

7 ビュー (過去 30 日間)
tyler hollings
tyler hollings 2020 年 12 月 10 日
回答済み: Srivardhan Gadila 2020 年 12 月 18 日
i need to plot two sets of data on the same y axis but have different x axis values for them, there are two problems with this i only have data for one half of the y axis for one set of data and another half for the other set.
I need to learn how to do an interrupted y axis and maybe how to plot non values?
figure(1)
hold on
tiledlayout(3,1)
nexttile
plot(x,y,'ro--')
% breakyaxis([0 4])
title('fishing line')
xlabel('strain')
ylabel('stress in Mpa')
nexttile
plot(xx,y,'bo--')
title('rubber')
xlabel('strain')
ylabel('stress in Mpa')
can anyone help me?
i attached a jpg of how my graphs look now

回答 (1 件)

Srivardhan Gadila
Srivardhan Gadila 2020 年 12 月 18 日
As per my understanding from your question, I'm replicating the said information using the below code:
x1 = 1:5;
y1 = 1:5;
x2 = 8:13;
y2 = 2:7;
plot(x1,y1,x2,y2)
% or plot(x1,y1) use hold on then plot(x2,y2) and use hold off
Refer to the documentation of plot function for more information and examples.

カテゴリ

Help Center および File ExchangeGraphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by