Hi Nathan, John, The example I gave does be on a linear scale and not appropriate… but yes, John’s information is exactly I want. Although it might be possible to superpose two plots (one positive and one negative) with two color bars, but it appears a little bit redundant. Thanks a lot! Best wishes, Suoqing On Jul 16, 2014, at 4:09 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Wed, Jul 16, 2014 at 4:06 PM, John Zuhone <jzuhone@gmail.com> wrote: Hi Suoqing,
Probably cannot do what you're looking for with PlotWindow, but you might want to try Matplotlib's symlog:
http://matplotlib.org/examples/pylab_examples/symlog_demo.html
I didn't know this was a thing. We could probably add support for it to PlotWindow.
This is what the S-Z projection analysis module does, see the images of the S-Z decrement/increment here:
http://yt-project.org/doc/analyzing/analysis_modules/sunyaev_zeldovich.html
If you look in the code in yt.analysis_modules.sunyaev_zeldovich.projection.py, the SZProjection class has a write_png method that uses the symlog in a color plot.
So my suggestion would be to write your image to a fixed resolution buffer and plot it directly with Matplotlib's imshow using the symlog scaling on the colorbar.
Best,
John
On Wed, Jul 16, 2014 at 6:53 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Wed, Jul 16, 2014 at 3:50 PM, Suoqing JI <suoqing@physics.ucsb.edu> wrote:
Hi,
I understand that typically the negative values would appear as white color on a log slice plot. However, if I directly plot the fields that are generically defined in FLASH, the negative values DO appear correctly. For example, the velx field: http://pbrd.co/1jz3iqR.
Yup - that plot is on a linear scale. I believe the FLASH frontend has it explicitly defined *not* to log-scale velx.
But for any derived fields, for example, defining velx1 = 1.*velx, the negative values appear white again: http://pbrd.co/1jz4oD8.
That happens because the default for a derived field is to log scale the field in plots.
So, is there anyway to show both positive and negative values on a log slice plot for derived fields (I’m using YT2)?
Nope. In general you can't show negative values on a log-scaled plot.
You could plot the absolute value of a field but then you aren't really plotting the field as such.
What is the visualization goal you are trying to accomplish here?
Thanks!
Best wishes, -- Suoqing JI Ph.D Student Department of Physics University of California, Santa Barbara CA 93106, USA
_______________________________________________ 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
-- John ZuHone
Postdoctoral Researcher NASA/Goddard Space Flight Center
jzuhone@gmail.com john.zuhone@nasa.gov _______________________________________________ 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