Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- how to delete a graphic script in a plot

Topic Options

- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

May 9, 2012 3:27 AM
(3262 views)

I add mouse trap in a plot with <<add graphics script. How do I delete the mouse trap? thanks

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Yes, Remove Graphics Script is new for JMP 10. For prior releases, you can build a user-defined function containing the graphics script, then reinitialize the function and send the Reshow message to the FrameBox to update the screen. Here is an example:

dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

_dist = Distribution(

Stack( 1 ),

Continuous Distribution(

Column( :height ),

Quantiles( 0 ),

Moments( 0 ),

Horizontal Layout( 1 ),

Vertical( 0 )

)

);

_rdist = _dist << Report;

_histframe = _rdist["height"][framebox( 2 )];

curve = Function( {}, // make a function holding the old drawing code

mu = 62.55;

sigma = 4.24;

Y Function( Sqrt( 2 * Pi() ) * Normal Density( (x - mu) / sigma ) * 0.095 + 0, x );

);

_histframe << Add Graphics Script(

Description( "NormalPDF" ),

curve() // call the function holding the old code

);

/* how do I remove the graphics script?*/

Wait( 2 ); //For demonstration purposes only

curve = Function( {}, {} );

_histframe << reshow;

Wait( 2 ); //For demonstration purposes only

// put the script back

curve = Function( {}, // make a function holding the old drawing code

mu = 62.55;

sigma = 4.24;

Y Function( Sqrt( 2 * Pi() ) * Normal Density( (x - mu) / sigma ) * 0.095 + 0, x );

);

_histframe << reshow;

I hope that helps!

Wendy

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: how to delete a graphic script in a plot

You can send *<< remove graphics script(n)* to the approprate displaybox, where n is the order of the script (I think the last added script gets n = 1).

An example:

nw = New Window**(** "Example",

exx = **20**,

exy = **50**;

Graph Box**(** Frame Size**(** **200**, **200** **)**, Circle**(** **{****0**, **0****}**, Sqrt**(** exx * exx + exy * exy **)** **)** **)**;

**)**;

fb = nw**[**Framebox**(** **1** **)]**;

fb << add graphics script**(**

Mousetrap**(**

exx = x;

exy = y;

**)**

**)**;

fb << remove graphics script**(** **1** **)**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: how to delete a graphic script in a plot

hi MS,

it dosn't work.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: how to delete a graphic script in a plot

The example script works for me in JMP 10 (Mac). But I now tried it in JMP 9.0.3 and it does not work, i.e. the last line has no effect. Seems like the remove graphics script() message is new.

What version do you use?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: how to delete a graphic script in a plot

i'm using JMP9.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Yes, Remove Graphics Script is new for JMP 10. For prior releases, you can build a user-defined function containing the graphics script, then reinitialize the function and send the Reshow message to the FrameBox to update the screen. Here is an example:

dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

_dist = Distribution(

Stack( 1 ),

Continuous Distribution(

Column( :height ),

Quantiles( 0 ),

Moments( 0 ),

Horizontal Layout( 1 ),

Vertical( 0 )

)

);

_rdist = _dist << Report;

_histframe = _rdist["height"][framebox( 2 )];

curve = Function( {}, // make a function holding the old drawing code

mu = 62.55;

sigma = 4.24;

Y Function( Sqrt( 2 * Pi() ) * Normal Density( (x - mu) / sigma ) * 0.095 + 0, x );

);

_histframe << Add Graphics Script(

Description( "NormalPDF" ),

curve() // call the function holding the old code

);

/* how do I remove the graphics script?*/

Wait( 2 ); //For demonstration purposes only

curve = Function( {}, {} );

_histframe << reshow;

Wait( 2 ); //For demonstration purposes only

// put the script back

curve = Function( {}, // make a function holding the old drawing code

mu = 62.55;

sigma = 4.24;

Y Function( Sqrt( 2 * Pi() ) * Normal Density( (x - mu) / sigma ) * 0.095 + 0, x );

);

_histframe << reshow;

I hope that helps!

Wendy

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: how to delete a graphic script in a plot

it works!. thanks, WK