- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Graph Builder Wrap With different Y Axis Scales
Is there a way to use the wrap functionality of graph builder where all graphs share a common x axis (time), but have differing Y axis scales? I tried the Page option which is OK, but I'd prefer a grid of graphs. Here's an example where one of the graphs throws the scale way off for the other graphs.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder Wrap With different Y Axis Scales
I've done this sort of thing, still looking for something better though:
Names default to here( 1 );
dt = Open( "$Sample_data/Big Class.jmp" );
//Window to hold graphs
win = New window("Graphs",
lub = Lineup Box( NCol( 3 ) )
);
//List of graphs to make
ages = ( Associative Array( Column( dt, "age" ) ) << Get Keys );
//For each graph
For( i = 1, i <= N Items( ages ), i++,
//Add graph to the lineup box
lub << Append( Graph Builder(
Size( 300, 300 ),
Show Control Panel( 0 ),
Show Footer( 0 ),
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
Local Data Filter(
Close Outline( 1 ),
Add Filter(
columns( :age ),
Where( :age == ages[i] ),
Display( :age, Size( 224, 126 ), List Display )
)
),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Age: " || char(ages[i]) )} ),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} )
)
); );
);
//Hide all of the data filters
(win << XPath("//OutlineBox[@helpKey='Data Filter']") ) << Visibility("collapse");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder Wrap With different Y Axis Scales
It occurs to me that Peter's original question was about Graph Builder and I gave a solution using Fit Y by X. If you need Graph Builder functionality, it turns out you can also use Fit Group() with Graph Builder output using a By variable:
Names default to here( 1 );
dt = Open( "$Sample_data/Big Class.jmp" );
Fit Group(
Graph Builder(
Size( 300, 300 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
By( :age )
),
<<{Arrange in Rows( 3 )}
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder Wrap With different Y Axis Scales
I've done this sort of thing, still looking for something better though:
Names default to here( 1 );
dt = Open( "$Sample_data/Big Class.jmp" );
//Window to hold graphs
win = New window("Graphs",
lub = Lineup Box( NCol( 3 ) )
);
//List of graphs to make
ages = ( Associative Array( Column( dt, "age" ) ) << Get Keys );
//For each graph
For( i = 1, i <= N Items( ages ), i++,
//Add graph to the lineup box
lub << Append( Graph Builder(
Size( 300, 300 ),
Show Control Panel( 0 ),
Show Footer( 0 ),
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
Local Data Filter(
Close Outline( 1 ),
Add Filter(
columns( :age ),
Where( :age == ages[i] ),
Display( :age, Size( 224, 126 ), List Display )
)
),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Age: " || char(ages[i]) )} ),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} )
)
); );
);
//Hide all of the data filters
(win << XPath("//OutlineBox[@helpKey='Data Filter']") ) << Visibility("collapse");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder Wrap With different Y Axis Scales
Thanks @ih that's kind of what I was looking for. Your solution is general enough I could adapt it for my uses.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder Wrap With different Y Axis Scales
It's not obvious, but if you wrap a call to Bivariate() with a By Variable in a Fit Group(), you can take advantage of << {Arrange In Rows()}, both interactively from the Fit Group Red Triangle, and in scripting:
Names default to here( 1 );
dt = Open( "$Sample_data/Big Class.jmp" );
Fit Group(Bivariate( Y( :weight ), X( :height ), By( :age ) ),<<{Arrange in Rows( 3 )});
I hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder Wrap With different Y Axis Scales
It occurs to me that Peter's original question was about Graph Builder and I gave a solution using Fit Y by X. If you need Graph Builder functionality, it turns out you can also use Fit Group() with Graph Builder output using a By variable:
Names default to here( 1 );
dt = Open( "$Sample_data/Big Class.jmp" );
Fit Group(
Graph Builder(
Size( 300, 300 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
By( :age )
),
<<{Arrange in Rows( 3 )}
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Graph Builder Wrap With different Y Axis Scales
Awesome thanks!