[yt-users] Why the two figures have different resolutions?

bazhaoyu_sjtu hudan_bazhaoyu at sjtu.edu.cn
Mon May 15 02:40:23 PDT 2017


Hi yt-users:

I want to ask you a question about the figures' resolution, I handled 
Gadget file -- hdf5.

I used the 'ProjectionPlot' to plot the surface brightness map which is 
integrated along the 'z' axis, please see the figure 1; And I plot 
another surface brightness map by 'OffAxisProjectionPlot' with the 
normal_vector is [0, 0, 1], please see the figure 2.

# I can't upload attachments ??? #

Comparing two figures, we can find the structures of them is same, but 
the resolution is different! The 'OffAxisProjectionPlot' is obviously 
worse than 'ProjectionPlot', I don't know why!

Below are the process I created two figures:

======================================================================
import yt
import numpy as np
import yt.units as units
import pylab

fname = "snap_206.hdf5"
unit_base = {'UnitLength_in_cm' : 3.08568e+21,
'UnitMass_in_g' : 1.989e+43,
'UnitVelocity_in_cm_per_s' : 100000}
bbox_lim = 1e5 # kpc
bbox = [[-bbox_lim,bbox_lim],
[-bbox_lim,bbox_lim],
[-bbox_lim,bbox_lim]]
ds = yt.load(fname,unit_base=unit_base,bounding_box=bbox)
ds.index
ad= ds.all_data()


## For 'ProjectionPlot' ##
pz = yt.ProjectionPlot(ds, 'z', ('gas', 'surface_brightness'), 'max', 
width=(0.4,'Mpc'))


## For 'OffAxisProjectionPlot' ##
L = [0,0,1]
north_vector = [0,1,0]
pz = yt.OffAxisProjectionPlot(ds, L, ('gas', 'surface_brightness'), 
'max', north_vector = north_vector, width=(0.4,'Mpc'))


pz.set_buff_size((3200,3200))
pz.save()
=========================================================================

What can i do to fix this difference of resolution between two plot ways?
Thanks a lot!

Regards,
Dan


==================================
Department of Physics, Shanghai Jiao Tong University
800 Dongchuan Road, Minhang, Shanghai 200240, PRC
E-mail : hudan_bazhaoyu at 163.com
hudan_bazhaoyu at sjtu.edu.cn
==================================


More information about the yt-users mailing list