[yt-users] Coexistence of positive and negative values on a SlicePlot in log scale

Nathan Goldbaum nathan12343 at gmail.com
Wed Jul 16 16:12:36 PDT 2014


I've opened an issue here:
https://bitbucket.org/yt_analysis/yt/issue/857/add-support-for-symmetric-logarithmic


On Wed, Jul 16, 2014 at 4:09 PM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

>
>
>
> On Wed, Jul 16, 2014 at 4:06 PM, John Zuhone <jzuhone at 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 at gmail.com>
>> wrote:
>> >
>> >
>> >
>> > On Wed, Jul 16, 2014 at 3:50 PM, Suoqing JI <suoqing at 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 at lists.spacepope.org
>> >> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> >>
>> >
>> >
>> > _______________________________________________
>> > yt-users mailing list
>> > yt-users at lists.spacepope.org
>> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> >
>>
>>
>>
>> --
>> John ZuHone
>>
>> Postdoctoral Researcher
>> NASA/Goddard Space Flight Center
>>
>> jzuhone at gmail.com
>> john.zuhone at nasa.gov
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140716/f0a60cdd/attachment.htm>


More information about the yt-users mailing list