User Tools

Site Tools


02_user_tutorials:plotting:plotting-data

This is an old revision of the document!


Difficulty
Easy

Plots inside GroIMP

GroIMP has the ability to visualize datasets in different plots.

This example uses the dataset generated in the dataset tutorial.

To visualize a dataset in GroIMP the chart() function is used:

 chart(diagram, XY_PLOT);

in a full example like this:

Plot_example.rgg
module A(float len) extends Sphere(0.1)
{
	{setShader(GREEN);}
}
DatasetRef diagram = new DatasetRef("plot");
 
protected void init ()
[
	Axiom ==> A(1);
	{
	diagram.setTitle("My fancy plot");
 
	 diagram.clear();
     diagram.setColumnKey(0,"max(x)").setColumnKey(1,"max(y)").setColumnKey(2,"max(z)");
	 chart(diagram, XY_PLOT);
 
	}
]
 
public void run ()
 
[
	A(x) ==> F(x) [RU(30) RH(90) A(x*0.8)] [RU(-30) RH(90) A(x*0.8)];
	{
		diagram.addRow().set(0,max(location((*A*)).x)).set(1,max(location((*A*)).y)).set(2,max(location((*A*)).z));
 
	}	
]
02_user_tutorials/plotting/plotting-data.1774025438.txt.gz ยท Last modified: 2026/03/20 17:50 by Tim