yt.visualization.image_writer.
write_projection
(data, filename, colorbar=True, colorbar_label=None, title=None, limits=None, take_log=True, figsize=(8, 6), dpi=100, cmap_name='algae', extent=None, xlabel=None, ylabel=None)[source]¶Write a projection or volume rendering to disk with a variety of pretty parameters such as limits, title, colorbar, etc. write_projection uses the standard matplotlib interface to create the figure. N.B. This code only works after you have created the projection using the standard framework (i.e. the Camera interface or off_axis_projection).
Accepts an NxM sized array representing the projection itself as well as the filename to which you will save this figure. Note that the final resolution of your image will be a product of dpi/100 * figsize.
Parameters: | data : array_like
filename : string
colorbar : boolean
colorbar_label : string
title : string
limits : 2-element array_like
take_log : boolean
figsize : array_like
dpi : int
cmap_name : string
|
---|
Examples
>>> image = off_axis_projection(ds, c, L, W, N, "Density", no_ghost=False)
>>> write_projection(image, 'test.png',
colorbar_label="Column Density (cm$^{-2}$)",
title="Offaxis Projection", limits=(1e-5,1e-3),
take_log=True)