Subscribe Bookmark RSS Feed

Graph Builder: creating error bands instead of bars?

bobzsun

New Contributor

Joined:

Aug 14, 2017

I have data I want to plot in a line chart as mean +/- standard error. However, I would like to plot the standard errors as shaded bands above and below my mean line rather than as individual error bars. I'd like the end result to look something like this:

 

medium.png

I know I can plot the mean+SE and mean-SE as separate lines but even then I can't figure out how to shade the area in between. Any ideas? Either in point-and-click or a script?

1 ACCEPTED SOLUTION

Accepted Solutions
Byron_JMP

Staff

Joined:

Apr 26, 2012

Solution

unfortunately, this might be easier to describe with a little JSL than it is with a series of steps.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Graph Builder(
	Size( 741, 350 ),
	Show Control Panel( 0 ),
	Variables(
		X( :height ),
		Y( :weight ),
		Y( :plus, Position( 1 ) ),
		Y( :minus, Position( 1 ) )
	),
	Elements(
		Line( X, Y( 1 ), Legend( 6 ) ),
		Area( X, Y( 2 ), Y( 3 ), Legend( 7 ), Area Style( "Range" ) )
	)
);

The key is to add your center and upper and lower columns to the Y axis.  (in Graph Builder)

Then, remove all the other graph elements, followed by adding the connect the dots line, and then the overlay lines (Area). 

Next, go into the variables role for the line and uncheck your upper and lower column. Go into the Area, and make the type a Range, go into the variables and uncheck the center column. (don't uncheck the Y column)

If the line isnt visible, ie. behind the range area line, then right click on the white space of the graph, go to Customize, and reoder teh elements.  (little plus/minus buttons)

 

1 REPLY
Byron_JMP

Staff

Joined:

Apr 26, 2012

Solution

unfortunately, this might be easier to describe with a little JSL than it is with a series of steps.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Graph Builder(
	Size( 741, 350 ),
	Show Control Panel( 0 ),
	Variables(
		X( :height ),
		Y( :weight ),
		Y( :plus, Position( 1 ) ),
		Y( :minus, Position( 1 ) )
	),
	Elements(
		Line( X, Y( 1 ), Legend( 6 ) ),
		Area( X, Y( 2 ), Y( 3 ), Legend( 7 ), Area Style( "Range" ) )
	)
);

The key is to add your center and upper and lower columns to the Y axis.  (in Graph Builder)

Then, remove all the other graph elements, followed by adding the connect the dots line, and then the overlay lines (Area). 

Next, go into the variables role for the line and uncheck your upper and lower column. Go into the Area, and make the type a Range, go into the variables and uncheck the center column. (don't uncheck the Y column)

If the line isnt visible, ie. behind the range area line, then right click on the white space of the graph, go to Customize, and reoder teh elements.  (little plus/minus buttons)