Hi All,
I have been searching this topic throughout the community discussions but I had not luck so far.
How to get the graph builder to dispatch a variable scale for the Y variable depending on the data range?
Using the BigClass data example If I had more than one graph to plot I would use the following script:
dt= Open ("Big Class.JMP");
win = New window("Graphs", lub = Lineup Box (Ncol(2)));
Sexs = (Associative Array(Column (dt, "sex"))<<Get keys);
For (i = 1, i<= N items (Sexs), i++,
lub<< Append( Graph Builder(
Variables( X( :weight ), Y( :height ), Wrap( :sex, N View Levels( 1 ) ) ),
Elements( Points( X, Y, Legend( 7 ) ), Smoother( X, Y, Legend( 9 ) ) ),
Local Data Filter(
Close Outline( 1 ),
Add Filter(
columns( :Sex ),
Where( :Sex == Sexs[i] ),
Display( :Sex, Size( 224, 126 ), List Display )) ))));
This code works for me. Also, the Y scale adjusts automatically which is great. However, if I would like to keep some characteristics costumized like lets say I want to have a Y minimum of 55 as an example but I would like to leave JMP to select the Y maximum according to the data range. How do I do that in this case?
In my situation is different, I would like the Y minimum to be always zero since I have a curve with all the values starting in zero but for some reason JMP sets the variables axis settings starting on negative numbers regardless. Nevertheless, even if I would like the values to be shown on a specific Y minimum for all the graphs I am not able to then have the Y Max to change automatically according to the range of data or until the actual Y maximum.
Using the script above and doing this manually I would have the resulting script line when setting a Y minmum only as 55 :
SendToReport(Dispatch({},"height",ScaleBox,{Min( 55 ), Inc( 5 ), Minor Ticks( 1 )}));
You will see that the resulting two graphs will have the same Y maximum regardless and set as below 70 even though one of the graphs has data until 70.
Does anyone know how to do write a script that would allow the Y max to change accroding to the data range or set the Max dependent on the Local filter already defined?
Thanks