2-d profile transposed

Hi, I’ve been generating phase plot data and overlaying other lines using matplotlib and I noticed that passing the profile data as is into pcolormesh results in a flipped plot. In order to get the correct image, I find that I need to do a transpose to the 2-d array before passing it to pcolormesh. Is this the desired behavior? Cheers, DK _______________ Just a snippet of what I’m doing. p2d = sph.profile(['density','magnetic_field_magnitude’],['cell_mass'],weight_field=None) C = p2d['cell_mass'].in_units('Msun’) #C = p2d['cell_mass'].in_units('Msun’).transpose() <- I have to do this to get it right fig = plt.figure(figsize=(8,6)) ax = fig.add_subplot(111) ax.set_xscale('log’) ax.set_yscale('log') ax.pcolormesh(p2d.x,p2d.y,C,norm=colors.LogNorm())

Hi DK, It's less that this is *desired* and more that it just is what it is. This is mostly holdovers from much earlier in yt's history. The profile2d code is pretty isolated though, and I think we could probably fix it up. Can you file a bug? On Fri, May 1, 2020 at 8:36 PM Daegene Koh <kdaegene@stanford.edu> wrote:
Hi,
I’ve been generating phase plot data and overlaying other lines using matplotlib and I noticed that passing the profile data as is into pcolormesh results in a flipped plot. In order to get the correct image, I find that I need to do a transpose to the 2-d array before passing it to pcolormesh.
Is this the desired behavior?
Cheers, DK
_______________
Just a snippet of what I’m doing.
p2d = sph.profile(['density','magnetic_field_magnitude’],['cell_mass'],weight_field=None) C = p2d['cell_mass'].in_units('Msun’) #C = p2d['cell_mass'].in_units('Msun’).transpose() <- I have to do this to get it right fig = plt.figure(figsize=(8,6)) ax = fig.add_subplot(111) ax.set_xscale('log’) ax.set_yscale('log') ax.pcolormesh(p2d.x,p2d.y,C,norm=colors.LogNorm())
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org https://mail.python.org/mailman3/lists/yt-users.python.org/ Member address: matthewturk@gmail.com
participants (2)
-
Daegene Koh
-
Matthew Turk