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

TCanvas.SaveAs saves png files only in batch mode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.20/00
    • Component/s: Graphics
    • Labels:
      None
    • Environment:
    • Development:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: