[yt-users] data_source with SlicePlot

Elizabeth Tasker tasker at astro1.sci.hokudai.ac.jp
Tue Jul 9 05:41:47 PDT 2013


Hi Matt,

Projection is fine: I'll just make it from a thin specified region. 

So, I can do a:

projy = pf.h.proj(….)

then 

p = projy.to_pw(…)

but how can I set the font size? There doesn't seem to be an argument in the call:

http://yt-project.org/doc/_modules/yt/data_objects/data_containers.html#AMRProjBase.to_pw

will it accept: 

p.set_font({"size": 30}) ?


Elizabeth



On Jul 9, 2013, at 9:24 PM, Matthew Turk <matthewturk at gmail.com> wrote:

> Hi Elizabeth,
> 
> Sorry, I should have been more clear. PlotWindow is the type of object
> created by the call to SlicePlot, so to_pw(...) is similar to calling
> SlicePlot(...) (identical, really) except that you have greater
> control over the specific Slice data itself that is used.  I was just
> saying that you can construct the underlying object with more
> flexibility; it does not at all require a GUI.
> 
> Looking over the code, as I was preparing an example, it actually
> looks to me like we don't have a data_source option presently.
> There's an open issue for re-adding this to 3.0, but reading the
> specifics for 2.5/2.6, it is not there.
> 
> https://bitbucket.org/yt_analysis/yt/issue/521/ytslice-no-longer-has-a-data_source
> 
> So right now, projections are your best bet for data_source-ful
> operations for images.
> 
> -Matt
> 
> On Jul 9, 2013 8:12 AM, "Elizabeth Tasker"
> <tasker at astro1.sci.hokudai.ac.jp> wrote:
>> 
>> Hi Matt,
>> 
>> So I'd need to have a physical pop-up plot window? That's a little problematic (many images created via a script and computer not local). Is FRB the only way round this atm?
>> 
>> 
>> Could I make a request for the future that SlicePlot has the ability to take a data_source? add_slice has it, so perhaps this is generally quite useful? Or for add_slice to have a font option, though maybe that way of making images is being fazed out?
>> 
>> Elizabeth
>> 
>> 
>> On Jul 9, 2013, at 9:06 PM, Matthew Turk <matthewturk at gmail.com> wrote:
>> 
>> Hi Elizabeth,
>> 
>> Yup, it takes a slice - however it was created - and makes it into a plot window. So the idea is you create the underlying object and then you can get the plot window (rather than the FRB) and make the font adjustments and so on to that. Not all of the constructor arguments are exposed in to_pw but all of them can be set on the resultant object.
>> 
>> One design choice made with the plot window was to avoid over-reaching - rather than make the constructor over complicated, we try to make it easy to make a plot window a different way.
>> 
>> Matt
>> 
>> On Jul 9, 2013 7:45 AM, "Elizabeth Tasker" <tasker at astro1.sci.hokudai.ac.jp> wrote:
>>> 
>>> Hi Matt,
>>> 
>>> Sorry; I don't understand.
>>> 
>>> to_pw is "to plot window"?
>>> 
>>> Does that allow me to specify a font size and create a png?
>>> 
>>> 
>>> Elizabeth
>>> 
>>> On Jul 9, 2013, at 6:27 PM, Matthew Turk <matthewturk at gmail.com> wrote:
>>> 
>>>> Hi Elizabeth,
>>>> 
>>>> On Tue, Jul 9, 2013 at 3:57 AM, Elizabeth Tasker
>>>> <tasker at astro1.sci.hokudai.ac.jp> wrote:
>>>>> Hi everyone,
>>>>> 
>>>>> I seem to have to make sad choice when creating slices or projections:
>>>>> 
>>>>> I can't seem to both use a region as the data source for my slice/projection and also specify a font size for the legend / axis labels.
>>>>> 
>>>>> With SlicePlot, I can use "fontsize" but there is no data_source argument.
>>>>> 
>>>>> With add_projection (which isn't quite a slice but close enough), I have a data_source argument but "fontsize" isn't recognised (I also tried "p.set_font({"size": 30})" but to no avail).
>>>>> 
>>>>> Is it possible to have a slice (or projection) with both these options available without resorting to creating frbs?
>>>> 
>>>> What about making the slice, then using to_pw() on the slice object?
>>>> 
>>>> sl = pf.h.slice(...)
>>>> sl.to_pw(...)
>>>> 
>>>> Or the same with projections?
>>>> 
>>>> -Matt
>>>> 
>>>>> 
>>>>> Thanks!
>>>>> 
>>>>> Elizabeth
>>>>> _______________________________________________
>>>>> 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
>>> 
>>> _______________________________________________
>>> 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
>> 
>> 
>> 
>> _______________________________________________
>> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130709/58c4b5c0/attachment.htm>


More information about the yt-users mailing list