changing the axis of a plot
이전 댓글 표시
x=[0:0.01:20]
y=max(x-10,0)-blsprice(10,10,0.02,0.2,0.2)
plot(x,y)
xlabel('Stock Price at Maturity ($)');
ylabel('Gain ($)');
axis([0 20 -2 10]);
set(gca,'Box','off')
The command above gives me the payoff of an call option, unfortunately the x-axis goes from -2 to 20, but I would like to see the x-axis from 0 to 20, so the starting point should be y=0 and not y=-2. However the plot should still show the y-axis from -2 to 10 and the negative values for y
답변 (1개)
Azzi Abdelmalek
2013년 3월 24일
xlim([0 20])
ylim([0 10])
댓글 수: 5
Locks
2013년 3월 24일
Walter Roberson
2013년 3월 24일
ylim([-2 10])
Locks
2013년 3월 24일
Locks
2013년 3월 24일
카테고리
도움말 센터 및 File Exchange에서 2-D Function Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!