cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Georg
Level VII

Customize Graph Builder: circle does not align with coordinates

Dear all, 

I try to draw a circle in Graph Builder via customize Graph,

and see, that the circle does not align with datapoints.

How can I do better, to have the circle at exact same position in the canvas as the data points?

Why does it seem to be ok for y, and not for x? Other ways to accomplish?

Thanks and best regards, Georg

Georg_0-1789394255151.png

New Table( "Circle Data",
	Add Rows( 72 ),
	Compress File When Saved( 1 ),
	New Script(
		"y coord vs. x coord", JSL Quote(Graph Builder(show control panel(0),
	Size( 540, 540 ),
	Variables( X( :x coord ), Y( :y coord ) ),
	Elements( Points( X, Y, Legend( 4 ) ), Smoother( X, Y, Legend( 5 ) ) ),
	SendToReport(
		Dispatch( {}, "Graph Builder", FrameBox,
			{Add Graphics Script( 2, Description( "" ), Circle( {0, 0}, 1 ) )}
		)
	)
);
)	,
		As String( 1 )
	),
	New Column( "Degree", Numeric, "Continuous", Formula( Row() * 5 ), Set Display Width( 74 ) ),
	New Column( "x coord", Numeric, "Continuous", Formula( Cosine( :Degree * (Pi() / 180) ) ), Set Selected, Set Display Width( 123 ) ),
	New Column( "y coord", Numeric, "Continuous", Formula( Sine( :Degree * (Pi() / 180) ) ), Set Display Width( 123 ) )
);
Georg
2 ACCEPTED SOLUTIONS

Accepted Solutions
Craige_Hales
Super User

Re: Customize Graph Builder: circle does not align with coordinates

How Do You Draw a Circle?  discusses this about 3/4 down; you might want to use the Size/Scale->SizeToIsometric  option. 

Craige

View solution in original post

jthi
Super User

Re: Customize Graph Builder: circle does not align with coordinates

Size to Isometric should solve this

Names Default To Here(1);

dt = New Table( "Circle Data",
	Add Rows( 72 ),
	Compress File When Saved( 1 ),
	New Script(
		"y coord vs. x coord", JSL Quote(Graph Builder(show control panel(0),
	Size( 540, 540 ),
	Variables( X( :x coord ), Y( :y coord ) ),
	Elements( Points( X, Y, Legend( 4 ) ), Smoother( X, Y, Legend( 5 ) ) ),
	SendToReport(
		Dispatch( {}, "Graph Builder", FrameBox,
			{Add Graphics Script( 2, Description( "" ), Circle( {0, 0}, 1 ) )}
		)
	)
);
)	,
		As String( 1 )
	),
	New Column( "Degree", Numeric, "Continuous", Formula( Row() * 5 ), Set Display Width( 74 ) ),
	New Column( "x coord", Numeric, "Continuous", Formula( Cosine( :Degree * (Pi() / 180) ) ), Set Selected, Set Display Width( 123 ) ),
	New Column( "y coord", Numeric, "Continuous", Formula( Sine( :Degree * (Pi() / 180) ) ), Set Display Width( 123 ) )
);

gb = dt << Run Script("y coord vs. x coord");

framebox = Report(gb)[FrameBox(1)];
framebox << Size To Isometric;
-Jarmo

View solution in original post

2 REPLIES 2
Craige_Hales
Super User

Re: Customize Graph Builder: circle does not align with coordinates

How Do You Draw a Circle?  discusses this about 3/4 down; you might want to use the Size/Scale->SizeToIsometric  option. 

Craige
jthi
Super User

Re: Customize Graph Builder: circle does not align with coordinates

Size to Isometric should solve this

Names Default To Here(1);

dt = New Table( "Circle Data",
	Add Rows( 72 ),
	Compress File When Saved( 1 ),
	New Script(
		"y coord vs. x coord", JSL Quote(Graph Builder(show control panel(0),
	Size( 540, 540 ),
	Variables( X( :x coord ), Y( :y coord ) ),
	Elements( Points( X, Y, Legend( 4 ) ), Smoother( X, Y, Legend( 5 ) ) ),
	SendToReport(
		Dispatch( {}, "Graph Builder", FrameBox,
			{Add Graphics Script( 2, Description( "" ), Circle( {0, 0}, 1 ) )}
		)
	)
);
)	,
		As String( 1 )
	),
	New Column( "Degree", Numeric, "Continuous", Formula( Row() * 5 ), Set Display Width( 74 ) ),
	New Column( "x coord", Numeric, "Continuous", Formula( Cosine( :Degree * (Pi() / 180) ) ), Set Selected, Set Display Width( 123 ) ),
	New Column( "y coord", Numeric, "Continuous", Formula( Sine( :Degree * (Pi() / 180) ) ), Set Display Width( 123 ) )
);

gb = dt << Run Script("y coord vs. x coord");

framebox = Report(gb)[FrameBox(1)];
framebox << Size To Isometric;
-Jarmo

Recommended Articles