[yt-users] unnecessary margin between multi panels with eps_writer

Junhwan Choi (최준환) choi.junhwan at gmail.com
Tue Jan 19 07:14:42 PST 2016


Hi yt user,

I try to make a multi panels plot with eps_writer modules.
I use following script and it works with one unpleasant shortcoming.
==================================================
import matplotlib as matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pylab as pylab
import yt
import yt.units as units
import yt.visualization.eps_writer as eps
import pyx

index = 60
ds = yt.load('../DD%04d/DD%04d' % (index,index))
ds.add_particle_filter('sink')
ad = ds.all_data()
center = ds.find_max(('gas', 'density'))[1]

# scale and limit
LBox = [4000, 4]

plot_list = []
for nrow in range(0,2):
    for norm in 'zxy':
        pc =yt.SlicePlot(ds, norm, ('gas', 'density'), center=center)
        pc.set_width(LBox[nrow],"pc")
        plot_list.append(pc)

ep = eps.multiplot(ncol=3, nrow=2, yt_plots=plot_list, bare_axes = True)
ep.title_box("xy", loc=(0.1,1.95))
ep.title_box("yz", loc=(1.1,1.95))
ep.title_box("xz", loc=(2.1,1.95))
ep.scale_line(label="%6.0f kpc" % (LBox[0]/4000.0), size=0.25,
linewidth=pyx.style.linewidth.Thick, loc=(0.05,1.08))
ep.scale_line(label="%6.0f pc"  % (LBox[1]/4.0)   , size=0.25,
linewidth=pyx.style.linewidth.Thick, loc=(0.05,0.08))
ep.save_fig("multi_plot")
==================================================

Here, I attach the resulting plot.
Everything is fine except there are white spacing/margin between panels.
Is there any way to remove the white spacing/margin?

Thanks in advance,
Junhwan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multi_plot.eps
Type: application/postscript
Size: 385832 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160119/cfe0e9e5/attachment.eps>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list