Decreasing scale on graphs

조회 수: 4 (최근 30일)
David
David 2011년 3월 11일
I wish to graph Time Decay for an option price from 1 year to almost 1 day. The graph generated by MATLAB scales from 0 to 1 and I need 1 to 0.
Interval = 1/252;
Times = 1:-Interval:Interval;
[TDCall TDPut] = blsdelta(S0,K,r,Times,Sigma);
plot(Times,TDCall);

답변 (3개)

Jan
Jan 2011년 3월 11일
Can you change the values of the time?
plot(1 - Times, TDCall);
Perhaps FLIPLR is wanted to reorder TDCall?
  댓글 수: 1
David
David 2011년 3월 13일
Thanks for your help.

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


Walter Roberson
Walter Roberson 2011년 3월 11일
Okay, this is going to be a hack, but it'll get the job done for now:
plot(-Times,TDcall);
set(gca, 'XTickLabel', -get(gca, 'XTick'))
Tested, and it works.
  댓글 수: 3
Walter Roberson
Walter Roberson 2011년 3월 12일
True, and surmountable using known methods.
Good enough for someone who was falling asleep at the time.
David
David 2011년 3월 13일
Thanks for your help.

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


Ned Gulley
Ned Gulley 2011년 3월 11일
Is this what you're looking for?
plot(Times,TDCall)
set(gca,'XDir','reverse')
  댓글 수: 1
David
David 2011년 3월 13일
Thanks for your help.

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

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by