[yt-users] Label cut in multiplot
Suoqing Ji
suoqing at physics.ucsb.edu
Tue Jun 21 20:52:37 PDT 2016
Hi Roberto,
Could you try this:
plt.savefig(plot_dir+'CELMO-Density_difftimes.png', bbox_inches="tight")
Best wishes,
--
Suoqing JI
Ph.D Candidate
Department of Physics
University of California, Santa Barbara
http://web.physics.ucsb.edu/~suoqing
> On Jun 21, 2016, at 6:23 PM, trobolo dinni <trobolo.trobolo.dinni5 at gmail.com> wrote:
>
> Dear yt users,
>
> I am running the following script:
>
> from yt.mods import *
> import matplotlib.pyplot as plt
> import numpy as np
> import math
> import os
> from mpl_toolkits.axes_grid1 import AxesGrid
>
> #enable/disables yt output
> mylog.disabled = True #no yt screen outputs
> #mylog.disabled = False
>
> #SIMULATIONS: this is the P12 but in a bigger box with 512 on a side.
> root_dir = "/disks/ceres/makemake/acomp/riaconi/rxi552/Binary-JC_primary-0.6Msun_companion-1_stellar_radii-512grid/"
> fns = [root_dir+"DD0014/data0014",root_dir+"DD0030/data0030",root_dir+"DD0041/data0041"]
>
> plot_dir = "/disks/ceres/makemake/acomp/riaconi/shared/"
>
> #setup for each plot in the figure (grid[i] will point to plot i)
> #axes_pad is padding between axes in inches
> fig = plt.figure()
> grid = AxesGrid(fig, (0.075,0.075,0.85,0.85),
> nrows_ncols = (1, 3),
> axes_pad = 0.15,
> label_mode = "L",
> share_all = False,
> cbar_location="right",
> cbar_mode="single",
> cbar_size="3%",
> cbar_pad="0%")
>
> for i, fn in enumerate(fns):
> pf = load(fn)
> common_envelope = pf.h.all_data()
> print "|----------|"
> print "simulation time: ", pf.current_time, "time code units"
> print "|----------|"
>
> s = SlicePlot(pf,'z',fields=["Density"])
> plot = s.plots['Density']
>
> plot.figure = fig
> plot.axes = grid[i].axes
> plot.cax = grid.cbar_axes[i]
> s._setup_plots()
>
> plt.savefig(plot_dir+'CELMO-Density_difftimes.png')
>
> However, when I visualise my image or insert it in a latex document the label on the right results cut off (see attached image).
>
> I am not able to find a solution for this and I would like to ask if anyone solved this problem before or has any suggestion on how to solve it.
>
> Cheers,
> Roberto
> <CELMO-Density_difftimes.png>_______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160621/cac7ad15/attachment.html>
More information about the yt-users
mailing list