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
- :
- Re: Update X-Axis while grouping in Graph Builder

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
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Update X-Axis while grouping in Graph Builder

Mar 12, 2019 11:08 PM
(2264 views)

Hi Everyone,

I have a query. If I have a table like below. If I plot TIME on X-axis and group the X-axis by TYPE. It will shows all five values on X-Axis for both groups, even if their is no data for that. It unnecessarily using the graph space. One way is I can nest the X-axis(TIME) with column TYPE but this works only when both columns are of type nominal. Is their a way if both columns are of different type?

Thanks

TIME | TYPE |

1-OCT-2018 | BAD |

2-OCT-2018 | BAD |

3-OCT-2018 | BAD |

1-JAN-2019 | GOOD |

1-JAN-2019 | GOOD |

7 REPLIES 7

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

Re: Update X-Axis while grouping in Graph Builder

**Formula** and enter this formula **Format( :TIME, "m/d/y" )** **.** This will now appear in the column selector as *Transform[Time]*. Drag this to X, then drag column Type so that Time is nested within Type.

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

Re: Update X-Axis while grouping in Graph Builder

@gzmorgan0,

This solution is only applicable when both column are of nominal type but I have one column of nominal modeling type and other column of Continuous modeling type.

This solution is only applicable when both column are of nominal type but I have one column of nominal modeling type and other column of Continuous modeling type.

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

Re: Update X-Axis while grouping in Graph Builder

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

Re: Update X-Axis while grouping in Graph Builder

You can take the same example, I posted. Here column "TIME" is of modeling type Continuous and column "TYPE" is of modelling type Nominal. These two columns you can't nest these two columns in graph builder.

Highlighted
##

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

Re: Update X-Axis while grouping in Graph Builder

You must not have understood my response:

- Transform Time to character,
- Use the transformed column in the nesting.

The embedded graph in my post used your example, with a random Y variable.

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

Re: Update X-Axis while grouping in Graph Builder

This works for this case only. Say if, I have column "TIME(Sec)" it measures the time for a particular process and it is a continuous variable and I don't want to change to nominal then how I will plot plot similar graph between Time and type.

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

Re: Update X-Axis while grouping in Graph Builder

JMP platforms work as they are scripted by the JMP developers. You can make a Wish List change and maybe it will change in the future,

I do not know how to make GraphBuilder do what I think you want unless you restructure your data table. GraphBuilder will not nest different data types, and X-Grouping uses the same X scale. So the only way to do this is to make each group's (Type) time (X variable) its own column and drag them side by side. Below is a capture of your table layout and a restructured, Split table: Split :Time by :Type grouping by :row and keeping all columns.

Below is the side-by-side GraphBuilder created with the split table time table

Here is the script.

```
Graph Builder(
Variables( X( :BAD ), X( :GOOD ), Y( :y ) ),
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 19 ) ),
Smoother( X, Y, Legend( 20 ) )
),
Elements(
Position( 2, 1 ),
Points( X, Y, Legend( 21 ) ),
Smoother( X, Y, Legend( 22 ) )
)
)
```

Of course you do not need to restructure, you could create new variables via the transform, a new variable for each type then drag the transfomed variables to the X-Axis, side-by-side

Below is the saved script. Splitting the table will be the easiest, if there are many groups

```
Graph Builder(
Size( 856, 534 ),
Show Control Panel( 0 ),
Variables(
X( Transform Column( "Bad[TIME]", Formula( If( :TYPE == "BAD", :TIME ) ) ) ),
X(
Transform Column(
"Good[TIME]",
Formula( If( :TYPE == "GOOD", :TIME ) )
)
),
Y( :y )
),
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 17 ) ),
Smoother( X, Y, Legend( 18 ) )
),
Elements(
Position( 2, 1 ),
Points( X, Y, Legend( 19 ) ),
Smoother( X, Y, Legend( 20 ) )
),
SendToReport(
Dispatch( {}, "Bad[TIME]", ScaleBox, {Format( "m/d/y", 10 )} ),
Dispatch(
{},
"Good[TIME]",
ScaleBox,
{Format( "m/d/y", 10 ), Min( 3629059200 ), Max( 3629232000 ),
Interval( "Numeric" ), Inc( 17.28 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model( 17, Level Name( 0, "y Bad", Item ID( "y", 1 ) ) ),
Legend Model( 19, Level Name( 0, "y Good", Item ID( "y", 1 ) ) )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {17, [0], 18, [-1], 19, [1], 20, [-1]} ),
Position( {0, -1, 1, -1} )}
)
)
)
```