How do I add a second y axis scale and label to a graph?

2 ビュー (過去 30 日間)
Adam Kirkpatrick
Adam Kirkpatrick 2016 年 4 月 22 日
コメント済み: Adam Kirkpatrick 2016 年 4 月 25 日
I've been using Matlab to solve ODE's however I need to have a second y axis scale and label for my graphs. I've tried the whole hold on box off method and I can't get it to work.
An example of my feeder code is:
[t, y] = ode45('TEST,[0 10], [0 0 0 0]);
plot(t,y) xlabel('Time (s)'); ylabel('Concentration'); axis([0 10 0 50]); set(gca,'XTick',(0:1:10)); set(gca,'YTick',(0:5:50));
I just need a scale on the right y axis and a label.
Thanks in advance

回答 (1 件)

Adam
Adam 2016 年 4 月 22 日
編集済み: Adam 2016 年 4 月 22 日
doc plotyy
should help. I've never used it myself, but I think it does what you are asking. Alternatively:
doc yyaxis
if you are using R2016a.
  1 件のコメント
Adam Kirkpatrick
Adam Kirkpatrick 2016 年 4 月 25 日
I only have access to matlab 2015. I can't really use plotyy because I'm plotting multiple ODEs.

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

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by