Decreasing scale on graphs
3 次查看(过去 30 天)
显示 更早的评论
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);
0 个评论
回答(3 个)
Jan
2011-3-11
Can you change the values of the time?
plot(1 - Times, TDCall);
Perhaps FLIPLR is wanted to reorder TDCall?
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
2011-3-12
True, and surmountable using known methods.
Good enough for someone who was falling asleep at the time.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!