Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#17691 closed defect (fixed)

py25-matplotlib 0.98.5 not working properly

Reported by: mf2k (Frank Schima) Owned by: skymoo (Adam Mercer)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc:
Port: py25-matplotlib py25-dap

Description

The update of py25-matplotlib to 0.98.5 in r43887 is no longer working for me. Specifically, I have installed with the +wxpython variant. But I also tried with the default +tkinter variant.

To verify this, run the following example that is installed with the port.

python /opt/local/share/py25-matplotlib/examples/pylab_examples/stock_demo.py

This does not work in the current port - the plot simply does not appear. But when I reverted back to before r43887, it runs fine. I tried a number of other examples too including simple_plot.py and stem_plot.py. When it works (0.98.3 version of the portfile), it launches a "Python" application, but when it does not work (the current 0.98.5 version of the portfile), no "Python" application appears.

Change History (5)

comment:1 Changed 12 years ago by skymoo (Adam Mercer)

Status: newassigned

comment:2 Changed 12 years ago by skymoo (Adam Mercer)

Looking at this there are a couple of problems. If I run the command you state I get the error:

$ python /opt/local/share/py25-matplotlib/examples/pylab_examples/stock_demo.py
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pytz/__init__.py:32:
UserWarning: Module dap was already imported from None, but /opt/local/lib/python2.5/site-packages is being added to sys.path
  from pkg_resources import resource_stream
Traceback (most recent call last):
  File "/opt/local/share/py25-matplotlib/examples/pylab_examples/stock_demo.py", line 9, in <module>
    d1, p1, d2, p2 = get_two_stock_data()
  File "/opt/local/share/py25-matplotlib/examples/pylab_examples/data_helper.py", line 13, in get_two_stock_data
    M1 = fromstring( file('../data/%s.dat' % ticker1, 'rb').read(), '<d')
IOError: [Errno 2] No such file or directory: '../data/INTC.dat'
$

and looking at the source in the example, the path to the data file is relative so you need to change into the directory containing the example for it to be able to find the data. So if I now change into this directory and run the example:

$ cd /opt/local/share/py25-matplotlib/examples/pylab_examples
$ python stock_demo.py
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pytz/__init__.py:32:
UserWarning: Module dap was already imported from None, but /opt/local/lib/python2.5/site-packages is being added to sys.path
  from pkg_resources import resource_stream
$

nothing happens, this is because the default backend is now Agg which is not an interactive backend, as I wanted to be able to support multiple interactive backends, and this example assumes an interactive backend. It does work however if you set the backend on the command line:

$ python stock_demo.py -dMacOSX

So there are a few options to solve this:

  1. Go back to only supporting a single backend
  2. Set the default backend to MacOSX, which is very new
  3. Put a post activate message stating that the default backend is Agg, and that another can be set by specifiying it in the .matplotlib/matplotlibrc file

I think I would prefer the third option, to give users the most flexibility.

Plus theres that dap warning I need to look into...

comment:3 in reply to:  2 ; Changed 12 years ago by mf2k (Frank Schima)

Port: py25-dap added

Replying to ram@…:

  1. Put a post activate message stating that the default backend is Agg, and that another can be set by specifiying it in the .matplotlib/matplotlibrc file

I added a matplotlibrc file and set the backend to MacOSX and it works really well. Thanks! Keeping all the backends and adding a post activate message makes the most sense to me. One odd thing is that the resulting "Python" application that runs does not have a menu. So to quit it, you have to close the window. When using the WXAgg backend, the menu exists with a Quit item (as before).

Plus theres that dap warning I need to look into...

This no longer appears for me with your update of py25-dap.

comment:4 in reply to:  3 Changed 12 years ago by skymoo (Adam Mercer)

Resolution: fixed
Status: assignedclosed

Replying to macsforever2000@…:

Keeping all the backends and adding a post activate message makes the most sense to me.

done in r43970

One odd thing is that the resulting "Python" application that runs does not have a menu. So to quit it, you have to close the window. When using the WXAgg backend, the menu exists with a Quit item (as before).

I see the same, I'll ask upstream

This no longer appears for me with your update of py25-dap.

I'm in the process of checking with upstream to see if that 'fix' is appropriate.

comment:5 Changed 11 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.