필터 지우기
필터 지우기

how to use hist in plotyy

조회 수: 5 (최근 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.

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by