<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 21, 2016 at 3:54 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Another option might be to add something like matplotlib's setp command, that allows you to efficiently (albeit cryptically) call a bunch of setters all at once.<span class="HOEnZb"><font color="#888888"><div><br></div><div>-Nathan</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 21, 2016 at 3:53 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Wed, Dec 21, 2016 at 3:37 PM, Yi-Hao Chen <span dir="ltr"><<a href="mailto:yihaochentw@gmail.com" target="_blank">yihaochentw@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="m_1719201363987780006m_1688871544571475110gmail-">On Wed, Dec 21, 2016 at 3:04 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Wed, Dec 21, 2016 at 2:55 PM, Yi-Hao Chen <span dir="ltr"><<a href="mailto:yihaochentw@gmail.com" target="_blank">yihaochentw@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<br><br>I am wondering why ProjectionPlot (and others) do not take all the keyword arguments and pass them to PWViewerMPL and PlotWindow. For example, currently there is no way to set buff_size at the creation of a plot. One has to call .set_buff_size after the plot was created.<br><br>I am thinking about leaving only the arguments specific to ProjectionPlot explicitly, and use **kwargs to pass all other arguments to PlotWindow. But if there are reasons not to do this, please let me know.<br></div></blockquote><div><br></div></span><div>This is on purpose, to reduce the API complexity. ProjectionPlot already has a huge number of keyword arguments, adding more will only make it harder to discover functionality.</div></div></div></div></blockquote></span><div><br>I see. That make sense.<br></div><span class="m_1719201363987780006m_1688871544571475110gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>I'd be much more interested in figuring out ways to make the setters more intuitive - possibly by exposing plot attributes as descriptors?</div></div></div></div></blockquote><div><br></div></span><div>I have no idea how to implement the descriptors... <br></div></div></div></div></blockquote><div><br></div></span><div>Here's a nice article on descriptors that I've often referred to in the past:</div><div><br></div><div><a href="http://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb" target="_blank">http://nbviewer.jupyter.org/ur<wbr>ls/gist.github.com/ChrisBeaumo<wbr>nt/5758381/raw/descriptor_<wbr>writeup.ipynb</a><br></div><div><br></div><div>The idea would be to expose the internal state for the plot objects via descriptors. This would make it possible to do, e.g.:</div><div><br></div><div>    plot = yt.ProjectionPlot(ds, 2, 'density') <br></div></div></div></div></blockquote></div></div></div></div></blockquote><div><br></div><div>It seems that yt will already create an image with default buff_size = (800,800) here.  It will of course redraw the image again later when we set the attributes and save the plot, but wouldn't it be redundant to create the first image? <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div></div></div></div></blockquote></div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>    # both of these should work and be handled by the descriptor</div><div>    plot.buff_size = (800, 1600)</div><div>    plot.buff_size = np.array(800, 1600)</div><div><br></div><div>    print(plot.buff_size)</div><div>    plot.save()</div><div><br></div><div>There are a number of plot attributes (some of them currently private) that we could handle (hopefully) more intuitively using this sort of API. The reason why I think it needs to happen (if it should happen) as part of a bigger refactoring is that we shouldn't leave the API partially converted to look like this, as that will be even more awkward to use. <br></div></div></div></div></blockquote></div></div></div></div></blockquote><div><br></div><div>I agree there should be a better way to access the plot attributes. <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><span class="m_1719201363987780006m_1688871544571475110gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>  <br></div></div></div></div></blockquote></span></div></div></div></blockquote></span></div></div></div></blockquote></div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="m_1719201363987780006m_1688871544571475110gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>Thanks!<span class="m_1719201363987780006m_1688871544571475110gmail-m_-5720543438653983114m_-1550955214613379125HOEnZb"><font color="#888888"><br>Yi-Hao<div class="m_1719201363987780006m_1688871544571475110gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-yj6qo m_1719201363987780006m_1688871544571475110gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-ajU"><div id="m_1719201363987780006m_1688871544571475110gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-:2cq" class="m_1719201363987780006m_1688871544571475110gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-ajR"><span class="m_1719201363987780006m_1688871544571475110gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-HOEnZb m_1719201363987780006m_1688871544571475110gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-adL"></span></div></div><span class="m_1719201363987780006m_1688871544571475110gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-HOEnZb m_1719201363987780006m_1688871544571475110gmail-m_-5720543438653983114m_-1550955214613379125m_-4781188503811250899gmail-adL"></span></font></span></div>
<br>______________________________<wbr>_________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div></div>
<br>______________________________<wbr>_________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></span></div><br></div></div>
<br>______________________________<wbr>_________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></span></div><br></div></div>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-dev-spacepope.<wbr>org</a><br>
<br></blockquote></div><br></div></div>