[ROOT] Re: TCanvas->SaveAs("....root...eps");

From: Jiri Masik (masik@fzu.cz)
Date: Fri Oct 17 2003 - 11:32:11 MEST


Andreas Salzburger <andreas.salzburger@cern.ch> writes:

> Dear root-talkers and developpers,
>
> I came across a little strange behavior in the SaveAs method:
>
> I wanted to Save EPS/GIF files dedicated to special rootfile by its
> names, for instance:
>
> from file:
> the.firstanalysis.root
>
> to create
> the.firstanalysis.root.plot1.gif
> the.firstanalysis.root.plot1.eps
>
> the.firstanalysis.root.plot2.gif
> the.firstanalysis.root.plot2.eps
>
> it works out fine with gifs, but as soon as you have eps and root in
> one string it saves the file automatically as ROOT file, not as eps
> files:
>
> try:
> theCanv->SaveAs("here.validation.testCanvas.root.frank.eps");
> Info in <TCanvas::Print>: ROOT file
> here.validation.testCanvas.root.frank.eps has been created
>

Hi,

see gpad/src/TPad.cxx and its SaveAs method. It just looks up if there
is a known suffix contained anywhere in the filename not what the
filename ends with. It could be easily rewritten. If you can avoid
using dots as separators and choose for example
testCanvas_root_frank.eps as filename you will get eps file as you
expect. 
cheers

Jiri



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET