cancel
Showing results for
Show  only  | Search instead for
Did you mean:
New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit. Register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
Level V

## How to add a marker line to the surface part of the green area and get rid of the black box lines on the top and right side？

I need to draw an x between 2 and 4 to a shaded area, but have hit a snag, the surface part doesn't feel like there is a good way to do it, and I need to find the x coordinates of the point where the two lines intersect.

And how to get rid of the black box lines on the top and right side.

``````names default to here(1);

new window("Ex",
gb=graph box(
framesize(300,300),
x scale(-6,6),
y scale(0,20),
double buffer,
pen color(3);
y function(x*x,x);
pen color(4);
Vline(2,0,4);
vline(4,0,16);
yfunction(x-2,x,max(4),min(2));
yfunction(x-2.5,x,max(4),min(2));
yfunction(x-3,x,max(4),min(2));
yfunction(x-3.5,x,max(4),min(2));
yfunction(x,x,max(4),min(2));
yfunction(x-0.5,x,max(4),min(2));
yfunction(x-1,x,max(4),min(2));
yfunction(x-1.5,x,max(4),min(2));
yfunction(x+0.5,x,max(4),min(2));
yfunction(x+1,x,max(4),min(2));
yfunction(x+1.5,x,max(4),min(2));
)
);``````
1 ACCEPTED SOLUTION

Accepted Solutions
Staff

## Re: How to add a marker line to the surface part of the green area and get rid of the black box lines on the top and right side？

You might use a polygon instead with a colored fill pattern.

``````Names Default to Here( 1 );

// integration resolution
nSteps = 25;

// function range for AUC
xMin = 2;
xMax = 3;

// define function
fxn = Function( {x},
Return( x:*x );
);

// define polygon along top
polyX = Index( xMin, xMax, 1/nSteps );
polyY = fxn( polyX );

// finish (close) polygon
polyX ||= Transpose( Matrix( Eval List( List( xMax, xMin, xMin) ) ) );
polyy ||= Transpose( Matrix( Eval List( List( 0, 0, 4 ) ) ) );

New Window( "AUC",
Outline Box( "Plot",
Graph Box(
X Scale( -5, 5 ),
Y Scale( 0, 25 ),
Pen Color( "Black" );
Y Function( fxn( x ), x );
Fill Color( "Green" );
Fill Pattern( "right slant light" );
Polygon( polyX, polyY );
)
),
Outline Box( "AUC",
Table Box(
String Col Box( "Method", { "Polygon", "Calculus" } ),
Number Col Box( "Estimate", { Polygon Area( polyX, polyY ), 19/3 } )
)
)
);``````

4 REPLIES 4
Staff

## Re: How to add a marker line to the surface part of the green area and get rid of the black box lines on the top and right side？

Hi @lehaofeng ,

Simply Right-Click in the Graph > Border > deselect 'Top' and 'Right'

Will give you this:

Hope this helps,

Florian

Level V

## Re: How to add a marker line to the surface part of the green area and get rid of the black box lines on the top and right side？

Thanks！I hope to achieve the effect as shown in the diagram below

Staff

## Re: How to add a marker line to the surface part of the green area and get rid of the black box lines on the top and right side？

You might use a polygon instead with a colored fill pattern.

``````Names Default to Here( 1 );

// integration resolution
nSteps = 25;

// function range for AUC
xMin = 2;
xMax = 3;

// define function
fxn = Function( {x},
Return( x:*x );
);

// define polygon along top
polyX = Index( xMin, xMax, 1/nSteps );
polyY = fxn( polyX );

// finish (close) polygon
polyX ||= Transpose( Matrix( Eval List( List( xMax, xMin, xMin) ) ) );
polyy ||= Transpose( Matrix( Eval List( List( 0, 0, 4 ) ) ) );

New Window( "AUC",
Outline Box( "Plot",
Graph Box(
X Scale( -5, 5 ),
Y Scale( 0, 25 ),
Pen Color( "Black" );
Y Function( fxn( x ), x );
Fill Color( "Green" );
Fill Pattern( "right slant light" );
Polygon( polyX, polyY );
)
),
Outline Box( "AUC",
Table Box(
String Col Box( "Method", { "Polygon", "Calculus" } ),
Number Col Box( "Estimate", { Polygon Area( polyX, polyY ), 19/3 } )
)
)
);``````

Level V

Thanks！It works！