Need help with a graphic script not updatingI have a customer who has made a custom shape in the Graph Builder, but the shape doesn't seem to be updating correctly when axes or other aspects of the graph are changed.
Here's an example of what the graph looks like when initially made. Note all the data points are barely outside the largest circle:

When the x-axis is changed, the circles move, but incorrectly, as in this example:

I thought it was perhaps just a matter of needing to change the script to have the graphics shape redraw, but that doesn't seem to be the fix. I've attached a sample data file with two scripts (original and my attempt at a fix).
Can anyone either help with a fix for this or suggest alternatives?
Thanks in advance,
Jed
Re: Need help with a graphic script not updatingHi Jed,
The problem is with how the "circle" routine behaves. It apparently is designed to draw a picture, not be tied to actual math (at least, to my way of thinking, in any meaningful way). A pet peeve of mine.
Using yFunction ( ) to specify the functional branches, you can achieve the desired effect. I've added a 3rd script that has both sets of circles drawn. The originals are in gray, their functional equivalents are in red. As you compress/expand the x-axis, you can see them diverge.
Cheers,
Brady

The code I added, after the circle() call:
Circle(
{100000, 100000},
97000,
1000 * Root( (((Pi() * 97 ^ 2) / 8)</img> * 1) / Pi(), 2 ),
1000 * Root( (((Pi() * 97 ^ 2) / 8)</img> * 2) / Pi(), 2 ),
1000 * Root( (((Pi() * 97 ^ 2) / 8)</img> * 3) / Pi(), 2 ),
1000 * Root( (((Pi() * 97 ^ 2) / 8)</img> * 4) / Pi(), 2 ),
1000 * Root( (((Pi() * 97 ^ 2) / 8)</img> * 5) / Pi(), 2 ),
1000 * Root( (((Pi() * 97 ^ 2) / 8)</img> * 6) / Pi(), 2 ),
1000 * Root( (((Pi() * 97 ^ 2) / 8)</img> * 7) / Pi(), 2 )
);
//functions
Pen Color( "red" );
For Each( {i}, 1 :: 8,
Eval( eval Expr(
Y Function( 1e5 + Sqrt( 485e2 ^ 2 * expr(i) / 2 - (x - 1e5) ^ 2 ), x );
Y Function( 1e5 - Sqrt( 485e2 ^ 2 * expr(i) / 2 - (x - 1e5) ^ 2 ), x );
))
);
//end of functions
Re: Need help with a graphic script not updatingElegant perfection, thanks!
Jed
Re: Need help with a graphic script not updatingAlternatively, you can use the Oval() function to draw an oval (circle) inside the appropriate rectangle (square):
Pen color("red");
For Each( {i}, 1 :: 8,
Eval(
Eval Expr(
Oval(
{100000 - 1000 * Root( (((Pi() * 97 ^ 2) / 8)</img> * Expr( i )) / Pi(), 2 ), 100000 + 1000 *
Root( (((Pi() * 97 ^ 2) / 8)</img> * Expr( i )) / Pi(), 2 )},
{100000 + 1000 * Root( (((Pi() * 97 ^ 2) / 8)</img> * Expr( i )) / Pi(), 2 ), 100000 - 1000 *
Root( (((Pi() * 97 ^ 2) / 8)</img> * Expr( i )) / Pi(), 2 )}
);
)
)
);
Lots more at How Do You Draw a Circle?