how to use hist in plotyy

2 ビュー (過去 30 日間)
davit petraasya
davit petraasya 2016 年 5 月 2 日
コメント済み: davit petraasya 2016 年 5 月 3 日
Hi
Does anyone know how to use hist in plotyy. I have calculated daily number of events by hist. Also I calculated pressure change over time. Now I need to plot the 2 plots by plotyy.(daily seismicity rate(hist) on left and pressure change on right y axis).
I am getting trouble how to use the hist in my plotyy? How I can do it?
Thanks!

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 5 月 2 日
Look at this example
t=1:10
x=randi(10,1,10)
y=sin(t)
hist(x)
hold on
plotyy(nan,nan,t,y)
  1 件のコメント
davit petraasya
davit petraasya 2016 年 5 月 3 日
Thank Azzi for the code. It is helpful.

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 5 月 2 日
[counts, bins] = hist(... the data to histogram);
plotyy(bins, counts, x2, pressure_change, @bar, @plot)
However, the bins probably do not span the same range as x2 does, which is probably going to lead to one plot or the other being squished badly. For that situation, plotxx from the file exchange would make more sense.
  1 件のコメント
davit petraasya
davit petraasya 2016 年 5 月 3 日
Thanks Walter!

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

カテゴリ

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