Subscribe Bookmark RSS Feed

Bars moving around in Bar Chart

Hello,

I'm really new to JMP. I have this problem with making a bar chart via script: the x variable column contains some strings, mixed with letters and numbers giving the binning information and the y variable column is numeric. Sometimes when I increase the number of bins, the last bar corresponding to the last bin, which I hope appears on the far right, somehow pops up on first one or two place on the left side.

Why does this happen? Maybe JMP arranges bars according to the values of x variable. Is there any way I can enforce data_table<
Thank you very much!
5 REPLIES
mpb

Super User

Joined:

Jun 23, 2011

Using Column Info for your X column experiment with the Row Order Levels column property. This may do what you want.
It works! Thank you!
reynon74

Community Trekker

Joined:

Jun 23, 2011

Is there a sript example, it does what I want but would like to script it?
pmroz

Super User

Joined:

Jun 23, 2011

Here's how I do it. This example assumes that the dataset is pointed to by dt, and the name of your column containing categorical variables is "Bin Column".

value_list = column(dt, "Bin Column") << get values;
column(dt, "Bin Column") << set property(value ordering, eval(value_list));
jorgeramosdealm

Community Trekker

Joined:

Feb 20, 2012

If you want the list to be arranged by ascending order you can use the "sort list()" for that.

value_list = column(dt, "Bin Column") << get values;

column(dt, "Bin Column") << set property(value ordering, eval(sort list(value_list)));