
Hi, I save the phase plot as png file, but the plot in the png file is small and there is large blank region. How to remove the blank region when I save? Or how to save it as pdf file so that I can use pdfcrop? Thanks! -- Sincerely Yi Feng Department of Astronomy&Astrophysics,UC Santa Cruz

Hi Yi,
How to remove the blank region when I save?
I’m not sure whether you could do this inside YT. Although it’s doable with PIL, the most convenient way for me is to use ImageMagick (http://www.imagemagick.org/script/index.php): convert test.png -trim test1.png
Or how to save it as pdf file so that I can use pdfcrop?
You could use: pc.save(pf.basename,format=‘pdf’) Best wishes, -- Suoqing JI Department of Physics University of California, Santa Barbara CA 93106, USA On Feb 6, 2014, at 12:56 AM, Yi Feng <yfen12@ucsc.edu> wrote:
Hi, I save the phase plot as png file, but the plot in the png file is small and there is large blank region. How to remove the blank region when I save? Or how to save it as pdf file so that I can use pdfcrop? Thanks!
-- Sincerely Yi Feng Department of Astronomy&Astrophysics,UC Santa Cruz _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi Yi, When you save the plot to disk, you can supply a keyword argument to matplotlib that forces it to auto-adjust the axes to fit the figure: plot = PhasePlot(...) plot.save(mpl_kwargs={'bbox_inches':'tight'}) Hope that helps, Nathan On Thu, Feb 6, 2014 at 12:56 AM, Yi Feng <yfen12@ucsc.edu> wrote:
Hi, I save the phase plot as png file, but the plot in the png file is small and there is large blank region. How to remove the blank region when I save? Or how to save it as pdf file so that I can use pdfcrop? Thanks!
-- Sincerely Yi Feng Department of Astronomy&Astrophysics,UC Santa Cruz
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi, Suoqing and Nathan, That really helps! Thanks a lot! On Fri, Feb 7, 2014 at 1:24 AM, Nathan Goldbaum <nathan12343@gmail.com>wrote:
Hi Yi,
When you save the plot to disk, you can supply a keyword argument to matplotlib that forces it to auto-adjust the axes to fit the figure:
plot = PhasePlot(...) plot.save(mpl_kwargs={'bbox_inches':'tight'})
Hope that helps,
Nathan
On Thu, Feb 6, 2014 at 12:56 AM, Yi Feng <yfen12@ucsc.edu> wrote:
Hi, I save the phase plot as png file, but the plot in the png file is small and there is large blank region. How to remove the blank region when I save? Or how to save it as pdf file so that I can use pdfcrop? Thanks!
-- Sincerely Yi Feng Department of Astronomy&Astrophysics,UC Santa Cruz
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Sincerely Yi Feng Department of Astronomy&Astrophysics,UC Santa Cruz
participants (3)
-
Nathan Goldbaum
-
Suoqing JI
-
Yi Feng