필터 지우기
필터 지우기

Problem with plotyy for standard deviation on my plot

조회 수: 1 (최근 30일)
fede
fede 2015년 11월 7일
답변: Walter Roberson 2015년 11월 8일
Hi, I want to plot the +1.5 and -1.5 standard deviation of my time series, in the same figure but with two y axes; but my code does not work.
plotyy(date,x,,[1.5*std,-1.5*stdd])
why?

답변 (2개)

dpb
dpb 2015년 11월 7일
Well you didn't tell what you got for an error but for starters
is missing the x value for the second plot with an empty argument position. That won't work for sure. Secondly you have std as one of the values; it is the name of the function. I presume from the second you intended it to also be stdd
plotyy(date,x,date,[1.5*stdd,-1.5*stdd])
The orientation of the concatenation implies they are column vectors?
  댓글 수: 2
fede
fede 2015년 11월 7일
stdd are simple a value (in my case 0.036), your code does not work yet.
dpb
dpb 2015년 11월 7일
It isn't my code, no, it's your problem...so what, precisely, do you want plotted?

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2015년 11월 8일
drange = [min(date), max(date)];
plotyy(date, x, drange, repmat([1.5*stdd,-1.5*stdd], 2, 1))
I do not see any good reason to use two y axes; I would use the same y axis but with different colors
drange = [min(date), max(date)];
plot(date, x, 'k', drange, repmat([1.5*stdd, -1.5*stdd], 2, 1), 'r')

카테고리

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