turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Is it possible to swap the x and y axis in JMP?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 22, 2012 8:31 AM
(3295 views)

I would like to graph an overlay plot. JMP limits me to putting the numerical values on the Y-Axis. I am unable to put multiple numerical parameters on the X-axis? Is there a way in JMP (JSL script even) to swap the axis?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 26, 2012 6:33 AM
(5230 views)

Solution

You need to add the bars to your graph and then change the bar style to interval.

Open("$SAMPLE_DATA\Big Class.jmp");

Graph Builder(

Variables( X( :height ), X( :weight, Position( 1 ) ), Y( :name ) ),

Elements(

Bar(

X( 1 ),

X( 2 ),

Y,

Legend( 2 ),

Bar Style( "Interval" ),

Summary Statistic( "Mean" )

)

)

)

-Jeff

10 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 25, 2012 1:41 AM
(2615 views)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 26, 2012 4:12 AM
(2615 views)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 26, 2012 4:23 AM
(2615 views)

My apologies -- I didn't notice that you were trying to plot *multiple* x-axis values.

I do not know how to plot multiple x-axis values. I would suggest using separate charts, or you could try something primitive like rescaling your x-axis variables so that they can all be plotted using a single x-axis scale.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 26, 2012 6:10 AM
(2615 views)

I don't think it's possible to get the graph you want out of the Overlay Plot platform.

However, you should be able to use Graph Builder to get the plot you want.

You can have multiple numeric variables on the X and Y axes in Graph Builder.

-Jeff

-Jeff

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 26, 2012 6:24 AM
(2615 views)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 26, 2012 6:33 AM
(5231 views)

You need to add the bars to your graph and then change the bar style to interval.

Open("$SAMPLE_DATA\Big Class.jmp");

Graph Builder(

Variables( X( :height ), X( :weight, Position( 1 ) ), Y( :name ) ),

Elements(

Bar(

X( 1 ),

X( 2 ),

Y,

Legend( 2 ),

Bar Style( "Interval" ),

Summary Statistic( "Mean" )

)

)

)

-Jeff

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 26, 2012 6:39 AM
(2615 views)

Absolutely fantastic thanks. I'll pretend to everyone I sorted that myself!! :-)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 26, 2012 7:04 AM
(2615 views)

Sorry last question..Can i do this for more than 2 parameters. I cannot seem to get the bar to connect to more than two. Also is there a way to change the marker point of each interval to distinguish it from the other?

Any help would be great.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 26, 2012 7:48 AM
(2615 views)

You can stack the variables into a single column in a new table. Then in Graph Builder, set the data as X, your categories as Y and the "Label" (your original variable names) as Color. Add duplicate point-type elements: one with Summary Statistics = None and the other with Summary Statistics = Mean and Error bars = range. And finally hide the mean point by setting the color to white or transparent.

The example script below should replicate what I just tried to describe. It should draw a line across three variables:

dt = Open**(** "$SAMPLE_DATA\Big Class.jmp" **)**;

dt << New Column**(** "h+w", Numeric, Continuous, Formula**(** :height + :weight **)** **)**; // Add a third variable

dt << Stack**(**

columns**(** :height, :weight, :Name**(** "h+w" **)** **)**,

Source Label Column**(** "Label" **)**,

Stacked Data Column**(** "Data" **)**

**)**; // Stack table

Graph Builder**(**

Size**(** **565**, **514** **)**,

Show Control Panel**(** **0** **)**,

Variables**(** X**(** :Data **)**, Y**(** :name **)**, Color**(** :Label **)** **)**,

Elements**(**

Points**(** X, Y, Color, Legend**(** **1** **)**, Jitter**(** **0** **)**, Error Bars**(** "Range" **)**, Summary Statistic**(** "Mean" **)** **)**,

Points**(** X, Y, Color, Legend**(** **4** **)**, Jitter**(** **0** **)** **)**

**)**,

SendToReport**(**

Dispatch**(** **{}**, "name", ScaleBox, **{**Show Major Ticks**(** **0** **)}** **)**,

Dispatch**(**

**{}**,

"400",

ScaleBox,

**{**Legend Model**(** **1**, Properties**(** **0**, **{**Line Color**(** **2** **)**, Fill Color**(** **0** **)}** **)** **)**,

Legend Model**(** **4**, Properties**(** **0**, **{**Line Color**(** **21** **)}** **)** **)}**

**)**,

Dispatch**(** **{}**, "400", LegendBox, **{**Position**(** **{**-**1**, **0**, **1**, **2****}** **)}** **)**,

Dispatch**(** **{}**, "Graph Builder", FrameBox, **{**Marker Size**(** **5** **)}** **)**

**)**

**)**;