[yt-users] EPS.single_plot() interface

John Regan johnanthonyregan at gmail.com
Wed Nov 6 07:35:51 PST 2013


On 6 November 2013 17:04, John Wise <jwise at physics.gatech.edu> wrote:

> It looks like it's failing when it's making the axes, which might happen
> when the ymin and ymax are the same.  Could you print out the _xrange and
> _yrange variables in the axis_box_yt() function in eps_writer.py just
> before the call to self.axis_box()?
>

The ranges seem OK. It fails with the axis error  when I use a very low
resolution file and then with the latex error when I switch to a higher
resolution file. In both cases the ranges seem OK.
low res
JR: xrange =  (0, 9.781304610151551)
JR: yrange =  (0, 9.781304610151551)

high res
JR: xrange =  (0, 31.645803611133523)
JR: yrange =  (0, 31.645803611133523)

I check the other items now....


> Does the eps_writer work for non-yt calls?
>
> http://paste.yt-project.org/show/4032/
>
> Does eps_writer work for normal slices and projections?
>
> You're doing the correct procedure to patch your version.  It doesn't hurt
> to rerun the install script, but it's unnecessary.  You could have run
> "python setup.py install" from the yt-hg/ directory instead.
>
> I hope we can pinpoint the cause of the error soon!
>
> Cheers,
> John
>
>
> On 11/06/2013 09:42 AM, John Regan wrote:
>
>> Hey,
>>
>> It failed too.
>>
>> Traceback (most recent call last):
>>    File "wise.py", line 9, in <module>
>>      ep.save_fig('test', format='eps')
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/src/yt-
>> hg/yt/visualization/eps_writer.py",
>> line 779, in save_fig
>>      self.canvas.writeEPSfile(filename)
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/canvas.py",
>> line 48, in wrappedindocument
>>      return method(d, file, **write_kwargs)
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/document.py",
>> line 165, in writeEPSfile
>>      pswriter.EPSwriter(self, _outputstream(file, "eps"), **kwargs)
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/pswriter.py",
>> line 140, in __init__
>>      page.processPS(pagefile, self, acontext, registry, pagebbox)
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/document.py",
>> line 129, in processPS
>>      self._process("processPS", *args)
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/document.py",
>> line 78, in _process
>>      bbox.set(self.canvas.bbox()) # this bbox is not accurate
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/canvas.py",
>> line 156, in bbox
>>      obbox += cmd.bbox()
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/graph/graph.py",
>> line 181, in bbox
>>      self.finish()
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/graph/graph.py",
>> line 311, in finish
>>      self.doaxes()
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/graph/graph.py",
>> line 588, in doaxes
>>      self.dolayout()
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/graph/graph.py",
>> line 572, in dolayout
>>      self.doaxiscreate(axisname)
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/graph/graph.py",
>> line 248, in doaxiscreate
>>      self.axes[axisname].create()
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/graph/axis/axis.py",
>> line 586, in create
>>      self.canvas = self.axis.create(self.data, self.positioner,
>> self.graphtexrunner, self.errorname)
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/graph/axis/axis.py",
>> line 270, in create
>>      return _regularaxis._create(self, data, positioner, graphtexrunner,
>> self.parter, self.rater, errorname)
>>    File
>> "/homeappl/home/regan/appl_taito/YT/Dev/yt-x86_64/lib/
>> python2.7/site-packages/pyx/graph/axis/axis.py",
>> line 202, in _create
>>      raise RuntimeError("no axis partitioning found%s" % errorname)
>> RuntimeError: no axis partitioning found for axis y2
>>
>>
>> Again on the save(). As I understand YT is set up to be somewhat machine
>> independent in that all libraries are contained in the YT installation -
>> in this case the PyX.
>> I wonder then could there be something in my dev version of YT that is
>> screwed up.
>>
>> Just to confirm what I need to do when I pull down your patch.
>>
>> cd .../yt-x86_64/src/yt-hg
>> hg pull -r 49a5b85 https://bitbucket.org/jwise77/yt-clean
>> hg update
>>
>> I then removed the done file and reran the install script. That may not
>> have been necessary though - I'm not sure.
>>
>> Maybe I should try pulling your patch down onto my stable version?
>>
>> John
>>
>>
>>
>>
>> On 6 November 2013 16:28, John Wise <jwise at physics.gatech.edu
>> <mailto:jwise at physics.gatech.edu>> wrote:
>>
>>     That version should be fine.  I just used that version on my *buntu
>>     13.10 machine.  It also worked on a 13.04 machine with an old svn
>>     checkout (before 0.12) of PyX.
>>
>>     As a warning, don't use the PyX svn repository because since July or
>>     August, it's only compatible with Python 3.
>>
>>     Could you try this script to see if it works for you?  It works on
>>     two of my computers.
>>
>>     http://paste.yt-project.org/__show/4031/
>>
>>     <http://paste.yt-project.org/show/4031/>
>>
>>     Thanks,
>>     John
>>
>>
>>     On 11/06/2013 09:13 AM, John Regan wrote:
>>
>>         Version Info:
>>
>>         Metadata-Version: 1.1
>>         Name: PyX
>>         Version: 0.12.1
>>         Summary: Python package for the generation of PostScript and PDF
>>         files
>>         Home-page: http://pyx.sourceforge.net/
>>         Author: Jörg Lehmann, André Wobst
>>
>>
>>         Maybe an upgrade is needed?
>>
>>
>>         On 6 November 2013 16:09, John Wise <jwise at physics.gatech.edu
>>         <mailto:jwise at physics.gatech.edu>
>>         <mailto:jwise at physics.gatech.__edu
>>         <mailto:jwise at physics.gatech.edu>>> wrote:
>>
>>              Hi John,
>>
>>              Which version of PyX are you running?
>>
>>              Thanks,
>>              John
>>
>>
>>              On 11/06/2013 09:08 AM, John Regan wrote:
>>
>>                  Hi John,
>>
>>                  I pulled down your update onto my Dev installation and
>>         ran it.
>>                  The eps
>>                  writer now successfully takes as input the plot window
>>         but fails on
>>                  saving the plot.
>>                  Any ideas? The error is below.
>>
>>                  Cheers,
>>                  John
>>
>>
>>
>>
>>                  Traceback (most recent call last):
>>                      File
>>
>>         "/homeappl/home/regan/appl_____taito/YT/Dev/yt-x86_64/lib/__
>> __python2.7/threading.py",
>>
>>
>>                  line 810, in __bootstrap_inner
>>                        self.run()
>>                      File
>>
>>         "/homeappl/home/regan/appl_____taito/YT/Dev/yt-x86_64/lib/__
>> __python2.7/site-packages/pyx/____text.py",
>>
>>
>>                  line 663, in run
>>                        raise RuntimeError("TeX/LaTeX finished
>> unexpectedly")
>>                  RuntimeError: TeX/LaTeX finished unexpectedly
>>
>>                  still waiting for tex after 5 (of 60) seconds...
>>                  still waiting for tex after 10 (of 60) seconds...
>>                  still waiting for tex after 15 (of 60) seconds...
>>                  still waiting for tex after 20 (of 60) seconds...
>>                  still waiting for tex after 25 (of 60) seconds...
>>                  still waiting for tex after 30 (of 60) seconds...
>>                  still waiting for tex after 35 (of 60) seconds...
>>                  still waiting for tex after 40 (of 60) seconds...
>>                  still waiting for tex after 45 (of 60) seconds...
>>                  still waiting for tex after 50 (of 60) seconds...
>>                  still waiting for tex after 55 (of 60) seconds...
>>                  the timeout of 60 seconds expired and tex did not
>> respond.
>>                  We try to finish the dvi due to an unhandled tex error
>>                  Traceback (most recent call last):
>>                      File "OffAxisProjection.py", line 74, in <module>
>>                        ep.save_fig("test", format="eps")
>>                      File
>>
>>         "/homeappl/home/regan/appl_____taito/YT/Dev/yt-x86_64/src/
>> yt-____hg/yt/visualization/eps_____writer.py",
>>                  line 779, in save_fig
>>                        self.canvas.writeEPSfile(____filename)
>>
>>
>>
>>
>>                  On 5 November 2013 22:44, John Wise
>>         <jwise at physics.gatech.edu <mailto:jwise at physics.gatech.edu>
>>                  <mailto:jwise at physics.gatech.__edu
>>         <mailto:jwise at physics.gatech.edu>>
>>                  <mailto:jwise at physics.gatech.
>>         <mailto:jwise at physics.gatech.>____edu
>>
>>
>>                  <mailto:jwise at physics.gatech.__edu
>>         <mailto:jwise at physics.gatech.edu>>>> wrote:
>>
>>                       Hi John,
>>
>>                       Thanks for bringing this to our attention.  I've
>>         done the same
>>                       workaround with eps_writer before, and it's a
>>         pain!  It
>>                  seems like
>>                       the eps_writer was never compatible with off-axis
>>         projections.
>>                         Plus, it hasn't been updated to be compatible with
>>                  PlotWindows.
>>
>>                       I've made the necessary changes to eps_writer so
>>         it works
>>                  with plot
>>                       windows now.  I've tested it with slices,
>>         projections, off-axis
>>                       projections, and phase plots, and they now work as
>>         desired.
>>
>>                       I've submitted a PR, but if you want to test it
>>         out before it's
>>                       merged, please go ahead!
>>
>>                       hg pull -r 49a5b85
>>         https://bitbucket.org/jwise77/______yt-clean
>>         <https://bitbucket.org/jwise77/____yt-clean>
>>                  <https://bitbucket.org/__jwise77/__yt-clean
>>         <https://bitbucket.org/jwise77/__yt-clean>>
>>
>>                       <https://bitbucket.org/____jwise77/yt-clean
>>         <https://bitbucket.org/__jwise77/yt-clean>
>>
>>
>>                  <https://bitbucket.org/__jwise77/yt-clean
>>         <https://bitbucket.org/jwise77/yt-clean>>>
>>                       hg update
>>
>>                       Let me know if this works for you.
>>
>>                       Cheers,
>>                       John
>>
>>
>>                       On 11/05/2013 10:13 AM, John Regan wrote:
>>
>>                           Hi All,
>>
>>
>>                           I've been playing with the eps interface a
>>         little to
>>                  decorate some
>>                           plots. It's a very nice feature but I haven't
>>         been able
>>                  to get in to
>>                           work with the output from
>>         OffAxisProjectionPlot() or
>>                           off_axis_projection(). Basically I call one of
>>         these
>>                  functions,
>>                           produce
>>                           a nice projection and would like to pass that
>>         object to
>>                           eps.single_plot
>>                           and make some modifications.
>>
>>                           The problem is that PWViewrMPL object has no
>>         colorbar
>>                  attribute
>>                           and so
>>                           when insert_image_yt() gets called the script
>>         fails as
>>                  it tries to
>>                           access this attribute. I can workaround the
>>         issue by
>>                  creating the
>>                           projection and converting the image to jpg and
>>         passing
>>                  the jpg
>>                           image to
>>                           insert_image() and it works great but it's not
>>         very
>>                  clean. It
>>                           would be
>>                           nice to pass the PWViewrMPL object in somehow.
>>
>>                           Just wondering if another wrapper function is
>>         needed or
>>                  if there
>>                           is an
>>                           even easier way that I am missing.
>>
>>                           Cheers,
>>                           John
>>
>>
>>
>>           _____________________________________________________
>>
>>
>>                           yt-users mailing list
>>         yt-users at lists.spacepope.org <mailto:yt-users at lists.spacepope.org
>> >
>>                  <mailto:yt-users at lists.__spacepope.org
>>         <mailto:yt-users at lists.spacepope.org>>
>>                  <mailto:yt-users at lists.
>>         <mailto:yt-users at lists.>__space__pope.org <http://spacepope.org>
>>                  <mailto:yt-users at lists.__spacepope.org
>>         <mailto:yt-users at lists.spacepope.org>>>
>>         http://lists.spacepope.org/______listinfo.cgi/yt-users-_____
>> _spacepope.org
>>         <http://lists.spacepope.org/____listinfo.cgi/yt-users-____
>> spacepope.org>
>>
>>
>>         <http://lists.spacepope.org/____listinfo.cgi/yt-users-____
>> spacepope.org
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org>>
>>
>>
>>
>>
>>         <http://lists.spacepope.org/____listinfo.cgi/yt-users-____
>> spacepope.org
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org>
>>
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org
>>         <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> >>>
>>
>>
>>                       --
>>                       John Wise
>>                       Assistant Professor of Physics
>>                       Center for Relativistic Astrophysics, Georgia Tech
>>         http://cosmo.gatech.edu
>>                       ______________________________
>> _______________________
>>
>>
>>                       yt-users mailing list
>>         yt-users at lists.spacepope.org <mailto:yt-users at lists.spacepope.org
>> >
>>                  <mailto:yt-users at lists.__spacepope.org
>>         <mailto:yt-users at lists.spacepope.org>>
>>                  <mailto:yt-users at lists.
>>         <mailto:yt-users at lists.>__space__pope.org <http://spacepope.org>
>>                  <mailto:yt-users at lists.__spacepope.org
>>         <mailto:yt-users at lists.spacepope.org>>>
>>         http://lists.spacepope.org/______listinfo.cgi/yt-users-_____
>> _spacepope.org
>>         <http://lists.spacepope.org/____listinfo.cgi/yt-users-____
>> spacepope.org>
>>
>>
>>         <http://lists.spacepope.org/____listinfo.cgi/yt-users-____
>> spacepope.org
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org>>
>>
>>
>>         <http://lists.spacepope.org/____listinfo.cgi/yt-users-____
>> spacepope.org
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org>
>>
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org
>>         <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> >>>
>>
>>
>>
>>
>>
>>
>>                  ___________________________________________________
>>                  yt-users mailing list
>>         yt-users at lists.spacepope.org
>>         <mailto:yt-users at lists.spacepope.org>
>>         <mailto:yt-users at lists.__spacepope.org
>>         <mailto:yt-users at lists.spacepope.org>>
>>         http://lists.spacepope.org/____listinfo.cgi/yt-users-____
>> spacepope.org
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org>
>>
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org
>>         <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>>
>>
>>
>>              --
>>              John Wise
>>              Assistant Professor of Physics
>>              Center for Relativistic Astrophysics, Georgia Tech
>>         http://cosmo.gatech.edu
>>              ___________________________________________________
>>              yt-users mailing list
>>         yt-users at lists.spacepope.org
>>         <mailto:yt-users at lists.spacepope.org>
>>         <mailto:yt-users at lists.__spacepope.org
>>         <mailto:yt-users at lists.spacepope.org>>
>>         http://lists.spacepope.org/____listinfo.cgi/yt-users-____
>> spacepope.org
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org>
>>
>>         <http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org
>>         <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>>
>>
>>
>>
>>
>>         _________________________________________________
>>         yt-users mailing list
>>         yt-users at lists.spacepope.org <mailto:yt-users at lists.spacepope.org
>> >
>>         http://lists.spacepope.org/__listinfo.cgi/yt-users-__
>> spacepope.org
>>         <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
>>
>>
>>     --
>>     John Wise
>>     Assistant Professor of Physics
>>     Center for Relativistic Astrophysics, Georgia Tech
>>     http://cosmo.gatech.edu
>>     _________________________________________________
>>     yt-users mailing list
>>     yt-users at lists.spacepope.org <mailto:yt-users at lists.spacepope.org>
>>     http://lists.spacepope.org/__listinfo.cgi/yt-users-__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 Wise
> Assistant Professor of Physics
> Center for Relativistic Astrophysics, Georgia Tech
> http://cosmo.gatech.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/20131106/1e408211/attachment.html>


More information about the yt-users mailing list