Subscribe Bookmark RSS Feed

Using Graph or GraphBox - How to change X,Y axis increment & Reverse axis

alexbnieto

Community Member

Joined:

Oct 5, 2017

Hello,

I am trying to use the Graph function but am unsuccessful in making X-axis incremements of 1 and Reversing Y-axis order. 

 

I tried swapping the numbers in the Y Scale properties but no luck. Only way to change is to physically change graph manually. Still unable to figure this out using JSL. 

 

Any help is appreciated!

 

Here is a snippet of my code

 

New Window( "Map",
Graph(
Frame Size( 800, 800 ),
X Scale(-0.6, 40.7),
Y Scale(0.4, 7.6),

...

);

1 REPLY
ms

Super User

Joined:

Jun 23, 2011

Send the commands to each AxisBox(). Use <<show tree structure if uncertain about the naming or numbering of the display boxes of interest.

 

An example:

nw = New Window("Map",
    Graph(Frame Size(800, 800), X Scale(-0.6, 40.7), Y Scale(0.4, 7.6))
);
// nw<<show tree structure();
nw[AxisBox(1)] << reversed scale;
nw[AxisBox(2)] << inc(1);