Two TCanvas.Print()s to two different SVG files sends both outputs to both files

From: Brett Viren <bv_at_bnl.gov>
Date: Wed, 30 May 2012 13:36:40 -0400


Hi,

ROOT Version 5.32/01 29 February 2012 on Sci. Linux 5.3, GCC 4.3.2.

Printing to multiple SVG files appears to cause the output to go to all files. Below is some test PyROOT code that shows the problem. It produces the files "h1.svg" and "h2.svg" which should each contain one histogram of the similar name. Instead, each file contains both histograms. The two files are attached.

#!/usr/bin/env python
import ROOT
def do_one(canvas,name):

    canvas.Clear()
    h = ROOT.TH1F(name,"hist %s"%name,200,-10,10)     h.FillRandom("gaus")
    h.Draw()
    canvas.Print(name + ".svg")

def test_svg():

    canvas = ROOT.TCanvas("canvas","canvas")     do_one(canvas,"h1")
    do_one(canvas,"h2")

if __name__ == '__main__':

    test_svg()

### end ###

Thanks,
-Brett.

Received on Wed May 30 2012 - 19:36:50 CEST

This archive was generated by hypermail 2.2.0 : Thu May 31 2012 - 11:50:02 CEST