[Clas12_software] Plotting package broken

Andrey Kim kenjo at jlab.org
Wed Jul 1 16:17:50 EDT 2015


Dear Whitney,
TGCanvas is not in v1.0 of coat-libs, it it is in v2.0. You should use 
coat-libs-2.0 to run TGCanvas.
Best,
Andrey.



On 07/01/2015 04:01 PM, Armstrong, Whitney R. wrote:
> Hello,
>
> The script found here: http://clasweb.jlab.org/clas12offline/docs/software/html/plotting/graph_plotting.html does not run properly. Please fix the code or update the example. (see output below)
>
> Also, it would be nice to have the ability to save the graphics in batch mode. Currently can this be done? That is can you call canvas.saveAs("some_file.png")?
>
> Cheers,
> Whitney
>
> whit at ifarm1401:~$ cat plot_test.groovy
> import org.root.pad.*;
> import org.root.data.*;
> import org.root.func.*;
> import org.root.histogram.*;
>
> TGCanvas c1 = new TGCanvas("c1","My Plots",600,400,1,1); // Create Canvas with (1,1) divisions
>
> double[] x = [ 1.0, 2.0, 3.0, 4.0]; // this is groovy syntax for array initialization
> double[] y = [ 0.5, 0.7, 0.6, 0.4]; // in java : double[] x = new double[]{1.0,2.0,3.0,4.0};
>
> GraphErrors  graph = new GraphErrors(x,y); // define graph with   X-Y points
>
> graph.setTitle("Example Graph"); // Set   the Title string for the PAD
> graph.setXTitle("Energy [GeV]"); // X axis title
> graph.setYTitle("Efficiency");    // Y axis title
>
> graph.setMarkerColor(4); // color from 0-9 for given palette
> graph.setMarkerSize(15); // size in points on the screen
> graph.setMarkerStyle(2); // Style can be 1 or 2
>
> c1.draw(graph);
> //c1.saveAs("test.png");
> whit at ifarm1401:~$ run-groovy plot_test.groovy
> /group/clas12/packages/coatjava-1.0/bin/../lib/clas/ced-1.0-SNAPSHOT.jar
> /group/clas12/packages/coatjava-1.0/bin/../lib/clas/cnuphys-1.0-SNAPSHOT.jar
> /group/clas12/packages/coatjava-1.0/bin/../lib/clas/coat-libs-1.0-SNAPSHOT.jar
> /group/clas12/packages/coatjava-1.0/bin/../lib/clas/JSAP-2.1.jar
> /group/clas12/packages/coatjava-1.0/bin/../lib/clas/snakeyaml-1.12.jar
> *****************************************
> *    Running COAT-JAVA Groovy Scripts   *
> *****************************************
>   
> Caught: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.root.pad.TGCanvas(java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer)
> groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.root.pad.TGCanvas(java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer)
> 	at plot_test.run(plot_test.groovy:6)
>
> _______________________________________________
> Clas12_software mailing list
> Clas12_software at jlab.org
> https://mailman.jlab.org/mailman/listinfo/clas12_software




More information about the Clas12_software mailing list