Hi,
Hi all,
I would like to be able to click on a small plot in a panel and bring that
up bigger in a new panel. The idea here is that the small plots are subplots
and clicking on them will bring them "in focus" so the user can better
manipulate the plot properties. What would be the best way to go about doing
that? I have the two panels set up but no click event detection currently
going on. Attached is a screen shot of the general gist of what I am going
for. I am using wxPython and matplotlib.
I apologize if this is far too vague and I will try to specify further if
needed.
You will probably have to handle it through matplotlib. If the plot on
the top right is one of your subplots, you may want to connect a
matplotlib mouse event listener to it (pseudo-code):
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.figure import Figure
self.figure = Figure()
self.canvas = FigureCanvasWxAgg(self, -1, self.figure)
self.canvas.mpl_connect('button_press_event', self.OnClick)
self.my_small_subplot = self.figure.add_subplot(3, 1, 1)
# Small plots drawing...
def OnClick(self, event):
if event.inaxes == self.my_small_subplot:
self.DrawOnBigPlot()
You will have to figure out how to pass your data from the small
subplot to the big one (but that's relatively easy by looking at what
kind of data is contained in your small subplot lines), and you may
also want to keep the axes limits in sync between the small and the
big subplots.
···
On 11 July 2012 22:55, jskoeh9 wrote:
--
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
# ------------------------------------------------------------- #
def ask_mailing_list_support(email):
if mention_platform_and_version() and include_sample_app():
send_message(email)
else:
install_malware()
erase_hard_drives()
# ------------------------------------------------------------- #