Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

don't plot the first number on the x axis because it's too near to the y axis

Asked by Locks on 24 Mar 2013
x=[0:0.01:20]
y1=blsprice(x,10,0.02,0.2,0.2)-blsprice(10,10,0.02,0.2,0.2)
y2=max(x-10,0)-blsprice(10,10,0.02,0.2,0.2)
plot(x,y1,'k',x,y2)
xlabel('Stock Price at Maturity ($)');
ylabel('Gain ($)');
axis([8.5 11.5  -0.5 1]);
text(10.225,-0.2,'Time value')
annotation(gcf,'doublearrow',[0.2 0.2],[0.2 0.1])
set(gca,'Box','off')

I would like to plot the following and to leave out the 8.5 on the x-axis, is that possible? all the other numbers (9,9.5,10,10.5,11,11.5) I would like to keep

0 Comments

Locks

Tags

Products

No products are associated with this question.

2 Answers

Answer by Azzi Abdelmalek on 24 Mar 2013
Accepted answer
set(gca,'xtick',9:0.5:11.5)

0 Comments

Azzi Abdelmalek
Answer by Locks on 24 Mar 2013

perfect, thanks!

0 Comments

Locks

Contact us