How to display graph with values on the left side and values on the right side

15 ビュー (過去 30 日間)
Dos
Dos 2016 年 6 月 15 日
回答済み: Neel Shah 2019 年 11 月 1 日
I need to display this kind of graph with values of wolves on the left side, and values of elks on the left side. Any help will be appreciated, sorry for my english.

採用された回答

the cyclist
the cyclist 2016 年 6 月 15 日
編集済み: the cyclist 2016 年 6 月 15 日
Use the yyaxis command or the older plotyy command. (The latter is not recommended anymore.)
  2 件のコメント
Dos
Dos 2016 年 6 月 15 日
編集済み: Dos 2016 年 6 月 15 日
Thank you! I've another question, how can I plot with given points, for example I've all 15 points of wolves and elks. Is it possible to put them in array and get figure with one of this function? I still don't have the function of this graph, so I would like to show it with given points at least for the beginning
the cyclist
the cyclist 2016 年 6 月 15 日
編集済み: the cyclist 2016 年 6 月 15 日

I don't understand what you are asking for here. Here is an example from the documentation. Maybe you can figure out how to plot your own data, using this example.

x = linspace(0,10);
y = sin(3*x);
yyaxis left
plot(x,y)
z = sin(3*x).*exp(0.5*x);
yyaxis right
plot(x,z)
ylim([-150 150])

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

その他の回答 (1 件)

Neel Shah
Neel Shah 2019 年 11 月 1 日
how do i write on both side of the graph
like on left and right side of the graph

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by