[yt-users] set_xlim problem in ProfilePlot

Nathan Goldbaum nathan12343 at gmail.com
Tue Mar 14 08:19:38 PDT 2017


Hi Chuhong,

Thank you for the report about this. I think the current behavior violates
the principle of least surprise. I've gone ahead and filed a pull request
that should fix this issue:

https://bitbucket.org/yt_analysis/yt/pull-requests/2546

There is a sort of hacky workaround for this issue that will work with the
current version of yt without my pull request. Take a look at the following
example, which uses a test dataset available at yt-project.org/data if you
want to try running it yourself:

http://paste.yt-project.org/show/7083/

Hope that's helpful,

Nathan



On Mon, Mar 13, 2017 at 11:27 PM, Chuhong Mai <cmai4 at asu.edu> wrote:

> Hi yt-users,
>
> I am pretty new to yt. I am using ProfilePlot to visualize Flash output
> data and find that set_xlim is not functioning as expected. Here's my
> script:
>
> import yt
> ds=yt.load('bondiAccr_mgd_fullmass_eddi_try24_plt_cnt_9217')
> ad=ds.all_data()
> plot=yt.ProfilePlot(ad,"r",["sound_speed"])
> plot.set_unit("r","cm")
> plot.set_xlim(2.5e12, 2.5e13)
> plot.set_ylim(5e8, 1e10)
> plot.save()
>
> [image: Inline image 1]
> While set_ylim functions as expected, set_xlim does cut the range of the
> data but not the axis itself. What can I do to cut the x axis to the range
> I want? Thank you very much!
>
> Best,
> Chuhong
>
> ------------------------------------------------------------
> ------------------------------
> Chuhong Mai,
> PhD Student,
> NASA Earth & Space Science Fellow,
> School of Earth & Space Exploration,
> Arizona State University
> Email: Chuhong.Mai at asu.edu
>
> _______________________________________________
> 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/20170314/119396d8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-03-13 at 9.24.10 PM.png
Type: image/png
Size: 18472 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170314/119396d8/attachment-0002.png>


More information about the yt-users mailing list