plot graph with values of y axis on the begining and the end

3 ビュー (過去 30 日間)
tilfani oussama
tilfani oussama 2018 年 7 月 31 日
編集済み: Naveed Ahmed 2018 年 7 月 31 日
I have three array vectors, beta, betal and betau, i would like to plot them on the same grpah. The x axis is scale ranging from 10 to 500, i did this to plot them
plot(scale,beta,scale,betau,scale,betal) ;
axis([10 500 -1 2])
My aim is to get values of y (beta values ranging from -1 to 2) on the right and on the left of my graph.

採用された回答

tilfani oussama
tilfani oussama 2018 年 7 月 31 日
I would like to get a graph similar to those in figure 1 in the attched file (not necessary the shaded area)
  1 件のコメント
Naveed Ahmed
Naveed Ahmed 2018 年 7 月 31 日
編集済み: Naveed Ahmed 2018 年 7 月 31 日
Just add this line after the axis([10 500 -1 2])
axes('xlim', [10 500], 'ylim', [-1 2], 'color', 'none', 'YAxisLocation', 'right', 'XAxisLocation', 'top')
Is this what you want?

サインインしてコメントする。

その他の回答 (2 件)

KSSV
KSSV 2018 年 7 月 31 日
LEt x,y be your values.
%
idx = y>1&y<2 ;
plot(x(idx),y(idx))
  1 件のコメント
tilfani oussama
tilfani oussama 2018 年 7 月 31 日
編集済み: tilfani oussama 2018 年 7 月 31 日
I do't know how to adapt in my case. x axis is scale = [10 500] and y axis represents beta values idx=beta>1&beta<2 ;
plot(scale(idx),beta(idx))? does not give any results

サインインしてコメントする。


Naveed Ahmed
Naveed Ahmed 2018 年 7 月 31 日
Hi,
If I understand by your last statement, do you want to get the plot as shown in the image? If not, please draw by hand the way you want to display your data.
Thanks
  2 件のコメント
tilfani oussama
tilfani oussama 2018 年 7 月 31 日
i would like to get beta, betal and betau in the same graph (beta is between betau (beta up) and betal (beta low) ). I would like to observe values on the y axis in the left of graph (for starting values of x axis) and on the right of the graph (for the end values of x axis)
tilfani oussama
tilfani oussama 2018 年 7 月 31 日
I would like to get a graph similar to those in figure 1 in the attched file (not necessary the shaded area)

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by