cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
rpeard
Level I

How do I create contour plots with no legend via scripting?

I just want to prevent the legends from being generated, & I didn't see a way to do this in any help pages. I am generating lots and lots of contour plots and the legends take up too much room.

Thanks!

3 REPLIES 3
David_Burnham
Super User (Alumni)

Re: How do I create contour plots with no legend via scripting?

Here is a contour plot example - sorry not a great data example but it illustrates how to do it:

Open("$SAMPLE_DATA/Car Physical Data.jmp");

cp = Contour Plot(

  X( :Displacement, :Gas Tank Size ),

  Y( :Horsepower ),

);

9233_Capture1.PNG

And with the legend removed:

Open("$SAMPLE_DATA/Car Physical Data.jmp");

cp = Contour Plot(

  X( :Displacement, :Gas Tank Size ),

  Y( :Horsepower ),

);

rep = cp << Report;

rep[DropBox(3)] << Delete;

9234_Capture2.PNG

-Dave

-Dave
pmroz
Super User

Re: How do I create contour plots with no legend via scripting?

You can create a similar plot in Graph Builder, where it's easier to remove the legend.

Using Car Physical Data as per above:

  1. Open GB and drag Displacement to X, Gas Tank Size to Y, Horsepower to Color.
  2. Click on the Contour toolbar icon.
  3. Click done
  4. Double-click on the legend
  5. Uncheck the checkbox
  6. Delete the Title

Here's what you get:

9238_GBContourPlot.png

The code for this is:

Open("$SAMPLE_DATA/Car Physical Data.jmp");

Graph Builder(

     Show Control Panel( 0 ),

     Variables( X( :Displacement ), Y( :Gas Tank Size ), Color( :Horsepower ) ),

     Elements( Contour( X, Y, Legend( 3 ), Number of Levels( 8 ) ) ),

     SendToReport(

           Dispatch( {}, "400", LegendBox, {Set Title( "" ), Position( {-1} )} )

     )

);

hardner
Level VI

Re: How do I create contour plots with no legend via scripting?

If you want even less than the example given, instead of "removing the legend" you could just take and use the framebox with the plot.

I have a script like that which makes a big grid of mini contours.  I don't want any of the axis stuff because I'm using a fixed scale for everything (actually I sometimes keep it on the left side and bottom of the grid but usually it's wafer maps with a very obvious scale so I don't want it at all) and I force the contour levels to match and keep one copy of the contour levels to go with all).  Here's an example of the output of that...Not sure if this is really superceded by the latest capabilities of graph builder or not, may be.

9242_contour map example.png

anyway, the core of that idea would be just adding this to the example already given...

nw=newwindow("just the guts",

  rep[framebox(1)]

);