Choose Language Hide Translation Bar
Highlighted
JesperJohansen
Level IV

Changing the scales of a graph box

Hi

 

I am wirking on a custom graph. I want to draw the graph similar to this:

nw = New Window("Test",
Outline Box( "Outline",
gb = Graph Box(
FrameSize( 600, 300),
XName("X axis"),
YName("Y axis"),
X Scale( 0, 5*Pi() ),
Y Scale( -1, 1 )
)
)
);

gb << Set Graphics Script(Y Function(Sin(x), x));

 

Now I want to change the scales of the graph. I can drag to change the size and scale of the graph, but how do I change properties like "FrameSize" or "XName" by script, after I made the graph?

 

BR

Jesper

BR
Jesper
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Craige_Hales
Staff (Retired)

Re: Changing the scales of a graph box

I'm not sure why the gb<<framesize and gb<<xscale and gb<<Xname messages won't work (added to my list, thanks!), but these messages do:

gb<<setWidth(500); // or Height
gb<<getXaxis; // try this to see the syntax
gb<<setXaxis(min(1),max(3)); // uses same syntax
gb[textbox(1)]<<settext("Ralph"); // text box 1 is Y, 2 is X

The setXaxis message controls all of the axis parameters; here's what getXaxis returned:

{Scale( "Linear" ), Format( "Fixed Dec", 12, 0 ), Min( 0 ), Max( 15.707963267949 ),
Interval( "Numeric" ), Inc( 5 ), Minor Ticks( 1 ), Label Row Nesting( 1 ),
Label Row(
    {Automatic Font Size( 0 ), Automatic Tick Marks( 0 ), Inside Ticks( 0 ),
    Label Orientation( "Horizontal" ), Major Grid Line Color( -14145495 ),
    Minor Grid Line Color( -15790320 ), Show Major Grid( 0 ), Show Major Labels( 1 ),
    Show Major Ticks( 1 ), Show Minor Grid( 0 ), Show Minor Labels( 0 ),
    Show Minor Ticks( 1 ), Tick Offset( 0 )}
)}

(Using JMP 13, might be fewer options in earlier versions.)

 

Craige

View solution in original post

2 REPLIES 2
Highlighted
Craige_Hales
Staff (Retired)

Re: Changing the scales of a graph box

I'm not sure why the gb<<framesize and gb<<xscale and gb<<Xname messages won't work (added to my list, thanks!), but these messages do:

gb<<setWidth(500); // or Height
gb<<getXaxis; // try this to see the syntax
gb<<setXaxis(min(1),max(3)); // uses same syntax
gb[textbox(1)]<<settext("Ralph"); // text box 1 is Y, 2 is X

The setXaxis message controls all of the axis parameters; here's what getXaxis returned:

{Scale( "Linear" ), Format( "Fixed Dec", 12, 0 ), Min( 0 ), Max( 15.707963267949 ),
Interval( "Numeric" ), Inc( 5 ), Minor Ticks( 1 ), Label Row Nesting( 1 ),
Label Row(
    {Automatic Font Size( 0 ), Automatic Tick Marks( 0 ), Inside Ticks( 0 ),
    Label Orientation( "Horizontal" ), Major Grid Line Color( -14145495 ),
    Minor Grid Line Color( -15790320 ), Show Major Grid( 0 ), Show Major Labels( 1 ),
    Show Major Ticks( 1 ), Show Minor Grid( 0 ), Show Minor Labels( 0 ),
    Show Minor Ticks( 1 ), Tick Offset( 0 )}
)}

(Using JMP 13, might be fewer options in earlier versions.)

 

Craige

View solution in original post

Highlighted
JesperJohansen
Level IV

Re: Changing the scales of a graph box

Thank you. Just what I was looking for :)
BR
Jesper
Article Labels

    There are no labels assigned to this post.