Author |
Topic |
|
hawkjay
1 Posts |
Posted - 10/02/2011 : 11:16:42 AM
|
Hi, everyone: I would like to shade the area among functions: y=1, y=(-x)/(x+2);y=-1-x;and x=0 (vertical axis); while these functions are desirable if drawn over [-2,+2] together with y=-1+x.
Any suggestions would be welcome. Thanks |
|
greg
USA
1378 Posts |
Posted - 10/03/2011 : 11:03:54 AM
|
There is no simple solution. You need to create datasets which represent the X,Y boundary of the area you wish to shade. Then you can include that X,Y data in your graph as a Line plot and set "Fill Area Under Curve" to use "Inclusive broken by missing values".
I did not understand your explanations of your functions, since one seems irrelevant to the area, but here is some script that demonstrates the idea: newbook; %B = col(2); range rax = 1; range ray = 2; win -t plot line; F1(x) = (-x) / (x + 2); // Not needed? // F2(x) = -1 - x; F3(x) = -1 + x; // I calculate the intersection of F1 and F3 as // x=0.73205080028705 // y=-0.26794910972909 // Establish some boundary data for F1 rax = data(0,0.73205089027091,.02); ray = F1(rax); last = rax.GetSize(); // Boundary data for F3 rax[last+1] = 0; ray[last+1] = -1; // Origin automatically closes to (0,0) plotxy (rax,ray) plot:=200 og:=<active>; x1 = -1;x2 = 2;x3 = 1; y1 = -2;y2 = 1;y3 = 1; set %B -pf 1;
|
|
|
|
Topic |
|
|
|