Double-clicking through the axes is a real headache.
One way to handle this, is to use Standardize Attributes to change the Axis Column Property.
To change all of the axes to log:
The axes for all of the X axes in the graph will be changed to a log scale
Thanks a lot for the suggestion.
However, my use of Graph Builder is quite dynamic and often hard to predict what columns will be used for plotting.
Is there a script that I can use to convert the X axes already used by a Graph Builder figure?
For example, I know I can do that for scatterplot matrix with
For( i = 100, i < 200, i++,
(Current Window() << XPath( "//ScaleBox[@charID=" || Char( i ) || "]" )) << Revert Axis
<< {Scale( "Log" ), Inc( 1 ), Minor Ticks( 1 )}
)
You do not need to iterate. The list of display boxes will distribute the messages it receives to each of its items automatically, so you only need to make sure that the list is correct. For example:
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Fitness.jmp" );
sm = dt << Scatterplot Matrix(
Y( :Age, :Weight, :Oxy, :Runtime, :RunPulse, :RstPulse, :MaxPulse ),
Matrix Format( "Lower Triangular" )
);
(Report( sm ) << XPath( "//AxisBox" ))
<< Revert Axis
<< Scale( "Log" )
<< Inc( 10 )
<< Minor Ticks( 0 );
My problem is that I want to keep y axes in linear scale but change x axes into log scale. Without iteration, I am afraid that both X/Y axes will be switched to log scale.
By the way, does similar approach work for Graph Builder?
This approach still works. Subscript the list first to get a new list with only the axis boxes you want to change, then send the messages to that target list. This way is still much easier and cleaner than explicit looping.
Here is a modification to my first example to illustrate the new approach:
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Fitness.jmp" );
sm = dt << Scatterplot Matrix(
Y( :Age, :Weight, :Oxy, :Runtime, :RunPulse, :RstPulse, :MaxPulse ),
Matrix Format( "Lower Triangular" )
);
// change X axes only in Scatterplot Matrix
axes = Report( sm ) << XPath( "//AxisBox" );
nAxes = N Items( axes );
// second half of list only
axes[((nAxes/2)+1)::nAxes] << Select; // Scale( "Log" );
It doesn't work well with the Scatterplot Matrix, though, because all but one data column is used in the X and Y role, and internal logic tries to keep changes consistent in both places (X and Y role).
Since I can't find a way to identify X axes from Y axes, my current solution is using this command to set all axes to log scale and then manually reverting Y axes to linear scale, which is much easier than manual setting of log scale.
( Current Window() << XPath( "//AxisBox" ) ) << Revert Axis << {Scale( "Log" ), Inc( 1 ), Minor Ticks( 1 )}