[yt-users] EPS.single_plot() interface

John Regan johnanthonyregan at gmail.com
Wed Nov 6 06:42:38 PST 2013


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> 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/
>
> 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>> 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>>> 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>>
>>              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>>
>>         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/51099287/attachment.htm>


More information about the yt-users mailing list