[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how to draw a grayshaded box
I'm strugling with epix version 0.8.*
and I'm trying to illustrate limits by plotting a function and then showing
that the function can be fitted into a small slice (rectangle), you know what
I mean.
What I need some help with is to make the rectangle shaded
and have a coordinatesystem with unmarked axes, just ----> (arrows) at the
ends,
and some small marks at the points x_0 and A, A+e, A-e at the axes, but no
other markings on the axes
I hope someone can help me..
Here is my code so far.
#include "epix.h"
using namespace ePiX;
double f(double t){
double x = -0.4+(1+t*t*t+7*t*t +10*t*(ePiX::cos(4*t) )) / (t*t*t+2*t*t+2);
if (x<0.3)
x=x+1;
return x;
}
main(){
unitlength("1mm");
bounding_box(P(-1.3,-0.5),P(8,4));
picture(P(80,40));
begin();
h_axis(3);
v_axis(1);
cropplot(f,0.4,x_max+1,60);
label(P(3.4,-0.3),"$x_0$");
label(P(-0.3,1.2),"$A$");
label(P(-0.7,2),"$A+\\varepsilon$");
label(P(-0.7,0.5),"$A-\\varepsilon$");
draw_rect(P(3.4,0.4),P(8,2));
end();
}