Making custom plots consistent with yt's styles

Hi all, Aesthetically, it'd be nice to make matplotlib plots with a consistent style as yt-made plots so that fonts, sizes, color palettes and so on agree. I imagine that this means I have to find yt's default matplotlib rc, or something analogous, somewhere. Many thanks for the help! chris

Hi Chris, Someone else that knows better than me can correct me, but it looks like all of the matplotlib imports happen in yt/visualization/_mpl_imports.py. The only configuration is this line: matplotlib.rc('contour', negative_linestyle='solid') which changes the default linestyle for contour plots. Other than that, if you use the Agg backend, you should be able to produce plots that look like yt plots. I believe yt uses the default fonts and matplotlib colortables (except for the ones in yt/visualization/_colormap_data.py. If you're trying to make publication quality plots, you may want to take a look at the EPS writer that John Wise wrote (yt/visualization/eps_writer.py) which leverages pyx to make really nice native postscript plots, or look at the various plot types (e.g. the RavenPlot in yt/visualization/plot_types.py). Personally, if I have to make consistent looking plots, I'd like to be in complete control so I use FixedResolutionBuffers and custom matplotlib scripts. Hope that helps! -Nathan On Apr 28, 2012, at 6:59 PM, Christopher Moody wrote:
Hi all, Aesthetically, it'd be nice to make matplotlib plots with a consistent style as yt-made plots so that fonts, sizes, color palettes and so on agree. I imagine that this means I have to find yt's default matplotlib rc, or something analogous, somewhere.
Many thanks for the help! chris _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
!DSPAM:10175,4f9ca0a363302512813236!

Hi Chris, One quick note to add to what Nathan wrote is that we are pretty careful to use the MathText rendering, which is pseudo-LaTeX. For instance, you can set labels with: ax.set_xlabel(r"$\mathrm{Something}\/\mathrm{Interesting}\/[\mathrm{x}^3]$") Also, I fully support using the FRB's for publication quality plots, instead of plot collections. -Matt On Sat, Apr 28, 2012 at 10:22 PM, Nathan Goldbaum <goldbaum@ucolick.org> wrote:
Hi Chris,
Someone else that knows better than me can correct me, but it looks like all of the matplotlib imports happen in yt/visualization/_mpl_imports.py.
The only configuration is this line: matplotlib.rc('contour', negative_linestyle='solid') which changes the default linestyle for contour plots.
Other than that, if you use the Agg backend, you should be able to produce plots that look like yt plots. I believe yt uses the default fonts and matplotlib colortables (except for the ones in yt/visualization/_colormap_data.py. If you're trying to make publication quality plots, you may want to take a look at the EPS writer that John Wise wrote (yt/visualization/eps_writer.py) which leverages pyx to make really nice native postscript plots, or look at the various plot types (e.g. the RavenPlot in yt/visualization/plot_types.py).
Personally, if I have to make consistent looking plots, I'd like to be in complete control so I use FixedResolutionBuffers and custom matplotlib scripts.
Hope that helps!
-Nathan
On Apr 28, 2012, at 6:59 PM, Christopher Moody wrote:
Hi all, Aesthetically, it'd be nice to make matplotlib plots with a consistent style as yt-made plots so that fonts, sizes, color palettes and so on agree. I imagine that this means I have to find yt's default matplotlib rc, or something analogous, somewhere.
Many thanks for the help! chris _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
!DSPAM:10175,4f9ca0a363302512813236!
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi Chris, Here is another option for making some publication quality plots. http://hub.yt-project.org/ytScripts/fancy-multi-panel-plots/ Britton On Sun, Apr 29, 2012 at 12:01 AM, Matthew Turk <matthewturk@gmail.com>wrote:
Hi Chris,
One quick note to add to what Nathan wrote is that we are pretty careful to use the MathText rendering, which is pseudo-LaTeX. For instance, you can set labels with:
ax.set_xlabel(r"$\mathrm{Something}\/\mathrm{Interesting}\/[\mathrm{x}^3]$")
Also, I fully support using the FRB's for publication quality plots, instead of plot collections.
-Matt
Hi Chris,
Someone else that knows better than me can correct me, but it looks like all of the matplotlib imports happen in yt/visualization/_mpl_imports.py.
The only configuration is this line: matplotlib.rc('contour', negative_linestyle='solid') which changes the default linestyle for contour plots.
Other than that, if you use the Agg backend, you should be able to
On Sat, Apr 28, 2012 at 10:22 PM, Nathan Goldbaum <goldbaum@ucolick.org> wrote: produce
plots that look like yt plots. I believe yt uses the default fonts and matplotlib colortables (except for the ones in yt/visualization/_colormap_data.py. If you're trying to make publication quality plots, you may want to take a look at the EPS writer that John Wise wrote (yt/visualization/eps_writer.py) which leverages pyx to make really nice native postscript plots, or look at the various plot types (e.g. the RavenPlot in yt/visualization/plot_types.py).
Personally, if I have to make consistent looking plots, I'd like to be in complete control so I use FixedResolutionBuffers and custom matplotlib scripts.
Hope that helps!
-Nathan
On Apr 28, 2012, at 6:59 PM, Christopher Moody wrote:
Hi all, Aesthetically, it'd be nice to make matplotlib plots with a consistent style as yt-made plots so that fonts, sizes, color palettes and so on agree. I imagine that this means I have to find yt's default matplotlib rc, or something analogous, somewhere.
Many thanks for the help! chris _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
!DSPAM:10175,4f9ca0a363302512813236!
_______________________________________________ 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
participants (4)
-
Britton Smith
-
Christopher Moody
-
Matthew Turk
-
Nathan Goldbaum