cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

How to Label points on a line and bars in an overlay plots? Scripting Help

jsuls
Level I

I am trying to script an overlay plot. I have everything I want except I can not figure how to add value labels for the line and bar graph. Here is the script I am working with:

obj_1=dt23<<Overlay Plot(X(:Work Week and Year),

  Y(:Average Meters per Lot, :Number of Lots),

  Y Scale(Left,Right),

  :Average Meters per Lot(Connect Points(1)),

  :Number of Lots(Needle(1),Overlay Marker( 0 )),

  Left Axis << {{Format( "Best", 9 ), Min( 0 ),

  Max( 300 ), Inc( 20 ), Minor Ticks( 0 ),Show Major Grid (1)}},

  Right Axis << {{Format( "Best", 9 ), Min( 0 ),

  Max( 150 ), Inc( 30 ),

  Minor Ticks( 0 )}});

obj_1<<Uniform Y Scale(0);

obj_1<<Show Labels(1);

obj_1<<Label By Value(1);

 

The graph it produces looks like this:

8841_Overlay Plot.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
robot
Level VI


Re: How to "Label by Value" for overlay plots? Scripting Help

Hi jsuls,

Are you trying to set row labels?  If yes, try turning them on by sending your command to the data table rather than to the overlay plot.  A script may look something like this.

Names Default to Here(1);

bigClass = open("$SAMPLE_DATA/Big Class.jmp");

over1 = bigClass << Overlay Plot( Y( :height, :weight ), Y Scale( Left, Right ) );

Column(bigClass, "name") << label(1); // Set column label.

bigClass << Select Randomly(5) << Label(1) << Clear Select; // Turn on row labels.

View solution in original post

2 REPLIES 2
robot
Level VI


Re: How to "Label by Value" for overlay plots? Scripting Help

Hi jsuls,

Are you trying to set row labels?  If yes, try turning them on by sending your command to the data table rather than to the overlay plot.  A script may look something like this.

Names Default to Here(1);

bigClass = open("$SAMPLE_DATA/Big Class.jmp");

over1 = bigClass << Overlay Plot( Y( :height, :weight ), Y Scale( Left, Right ) );

Column(bigClass, "name") << label(1); // Set column label.

bigClass << Select Randomly(5) << Label(1) << Clear Select; // Turn on row labels.

ms
Super User (Alumni) ms
Super User (Alumni)


Re: How to "Label by Value" for overlay plots? Scripting Help

I don't think <<Label by value is supported in Overlay Plot(). It is supported in Chart() and Graph Builder() for categorical x-axis. Chart seem not to support dual y-axes, but Graph Builder is very versatile and can produce a graph very close to your example.

Open("$SAMPLE_DATA/Big Class.jmp") << Graph Builder(

    Variables(X(:age), Y(:weight), Y(:height, Position(1), Side("Right"))),

    Elements(

        Points(X, Y(1), Legend(1), Summary Statistic("Mean")),

        Bar(X, Y(1), Legend(2), Bar Style("Needle"), Label("Label by Value")),

        Points(X, Y(2), Legend(4), Summary Statistic("Mean")),

        Line(X, Y(2), Legend(6))

    ),

    SendToReport(

        Dispatch({}, "weight", ScaleBox, {Max(300)}),

        Dispatch({}, "400", ScaleBox, {Legend Model(6, Properties(0, {Line Color(19)}))})

    ),

    Show Control Panel(0)

);

Recommended Articles

No recommendations found