~~NOTOC~~
{{howhard>2}}
====== Plots inside GroIMP ======
GroIMP has the ability to visualize datasets in different plots.
===== =====
To learn more about datasets visit the [[02_user_tutorials:dataset:01_basics
|dataset tutorial]].
To visualize a dataset in GroIMP the chart() function is used:
chart(diagram, XY_PLOT);
in a full example like this:
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));
}
]