Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10228

TCanvas.SaveAs saves png files only in batch mode

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Medium
    • Resolution: Fixed
    • None
    • 6.20/00
    • Graphics
    • None

    Description

      The following snipplet does only save a png version of the plot if ROOT is in batch mode. Otherwise, you get the error "Error in <TASImage::WriteImage>: no image loaded".

      import ROOT
      c = ROOT.TCanvas("", "", 600, 600)
      c.SaveAs("foo.png")
      c.SaveAs("foo.pdf")
      

      Enable batch mode for ROOT either via

      import ROOT
      ROOT.gROOT.SetBatch(True)
      

      or run

      python foo.py -b
      

      Attachments

        Activity

          People

            couet Olivier Couet
            swunsch Stefan Wunsch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: