Connecting Mouse Double Click...

Thanks a bunch Chris, it really helps... however I have just hacked a little
bit backend_wx.py and backend_bases.py to include a mouse double click. For
the moment it's working like a charm. Let's cross the fingers :wink:
BTW, I didn't receive any answer on this thread:

http://sourceforge.net/mailarchive/forum.php?thread_id=9639992&forum_id=33405

Do you happen to have some suggestion on how to solve this issue?

Thank you very much for your help.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77

Andrea Gavana wrote:

Thanks a bunch Chris, it really helps...

No problem.

bit backend_wx.py and backend_bases.py to include a mouse double click. For
the moment it's working like a charm. Let's cross the fingers :wink:

Make sure you send the patch to John or matplotlib-devel, it might make sense to add teh double click events to all the back-ends.

BTW, I didn't receive any answer on this thread:

http://sourceforge.net/mailarchive/forum.php?thread_id=9639992&forum_id=33405

Do you happen to have some suggestion on how to solve this issue?

well, no. but the first thing I'd do is make a wx-free script that used the OO interface. That keeps the embedded in wx stuff out of it, and it it doesn't work you can have a simple example to send to the group to get help.

OK. I've done some of that. first your first problem. There is a bug in axes.tick_right. Here's a script:

#!/usr/bin/env python

import pylab
import matplotlib.numerix as N

Fig = pylab.figure()

ax2 = Fig.add_subplot(111)
ax2.yaxis.tick_right()
ax2.yaxis.set_label_position('right')

t = N.arange(0.01, 10.0, 0.01)
s1 = N.exp(t)

ax2.plot(t, s1, 'b-')
ax2.set_xlabel('time (s)')
ax2.set_ylabel('exp')

pylab.show()

路路路

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Andrea Gavana wrote:

BTW, I didn't receive any answer on this thread:

http://sourceforge.net/mailarchive/forum.php?thread_id=9639992&forum_id=33405

Do you happen to have some suggestion on how to solve this issue?

Well, you got me curious, so what I did was start by writing an OO version of the script that worked:

#!/usr/bin/env python

import matplotlib, pylab
import matplotlib.numerix as N

Fig = pylab.figure()

ax1 = Fig.add_subplot(111)
t = N.arange(0.01, 10.0, 0.01)
s2 = N.sin(2*N.pi*t)
ax1.plot(t, s2, 'r.')
ax1.set_ylabel('sin')

#Create second axes with ticks on right
# code adapted from pylab.twinx
ax2 = Fig.add_axes(ax1.get_position(), sharex=ax1, frameon=False)
ax2.yaxis.tick_right()
ax2.yaxis.set_label_position('right')

s1 = N.exp(t)
ax2.plot(t, s1, 'b-')
ax2.set_xlabel('time (s)')
ax2.set_ylabel('exp')

pylab.show()

Then I put it in my simple wxmpl example. It works. I've enclosed that. You need to click the "plot" button to make it plot.

-Chris

wxMplTwinx.py (1.78 KB)

路路路

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...