% To load into Matlab:  just type the name of this file, without the .m
% extension.

clf;

xmin=-2;
xmax= 2;
ymin=-2;
ymax= 2;
xtick=1;
ytick=1;

%% ----------------------------------------------------------------
hold on;

x=[-2:0.01:0];
y=x-x.^3;
plot(x,y);

x=[0:0.01:2];
y=sin(x);
plot(x,y);

%% ----------------------------------------------------------------
axis([xmin xmax ymin ymax]);
h1=line([xmin xmax], [0 0]);
set(h1, 'LineStyle', '--');
h2=line([0 0], [ymin ymax]);
set(h2, 'LineStyle', '--');
xlabel('x');
ylabel('f(x)');

set(gca, 'XTick', [xmin:xtick:xmax])
set(gca, 'YTick', [ymin:ytick:ymax])

set(gca, 'XGrid', 'on')
set(gca, 'YGrid', 'on')
%set(gca, 'XMinorGrid', 'on')
%set(gca, 'YMinorGrid', 'on')

set(gcf, 'PaperPositionMode', 'Manual');
set(gcf, 'PaperPosition', [0 0 4.0 2.0])
print -depsc e2_8
