[Matplotlib-users] Line2D on multiple plots?

2009-08-17 Thread Ole Streicher
Hi, I want to show the same data on multiple plots. Is it possible to re-use the Line2D object for that? t.m., line = axes1.plot(xdata, ydata, ...) ... axes2.lines.append(line) Or is a Line2D bound to a certain axes instance? Best regards Ole

Re: [Matplotlib-users] Resize error with Qt4 backend

2009-07-02 Thread Ole Streicher
Hi Brian, I have also some layout problems with the Qt4 backend. The worst one is a SegFault when adjusting the width. Brian Zambrano bri...@gmail.com writes: vbox = QVBoxLayout() vbox.addWidget(self.canvas) self.setLayout(vbox) Could you just try to add a second canvas to the layout? vbox

Re: [Matplotlib-users] Resize error with Qt4 backend

2009-07-02 Thread Ole Streicher
Hello Darren, Darren Dale dsdal...@gmail.com writes: I can't produce a segfault with the attached script. I have Qt-4.5.2, PyQt-4.5.1, and a checkout of the matplotlib trunk. OK, in this context it seems to work. I attach a script that shows the problem. Run it, move the second diagram below

Re: [Matplotlib-users] Resize error with Qt4 backend

2009-07-02 Thread Ole Streicher
Hello Darren, Darren Dale dsdal...@gmail.com writes: I can't produce a segfault with the attached script. I have Qt-4.5.2, PyQt-4.5.1, and a checkout of the matplotlib trunk. OK, in this context it seems to work. I attach a script that shows the problem. Run it, move the second diagram below

Re: [Matplotlib-users] Strange resize behaviour for qt backend

2009-06-23 Thread Ole Streicher
Hi, could anyone reproduce this problem and/or has a solution for it? Is there anything wrong with my code? Best regards Ole Ole Streicher ole-usenet-s...@gmx.net writes: Hi Darren, Darren Dale dsdal...@gmail.com writes: I am really busy with other things, and can't offer suggestions

[Matplotlib-users] updating changed diagram?

2009-06-10 Thread Ole Streicher
Hi, I want to change the value of a line in an axes. What I tried is myline = axes.plot(...) xdata, ydata = myline.get_data() for i in range(ydata.__len__()): ydata[i] += 50 to shift all y values up by 50. But I dont see the change I made, even after a show(). How can I force the diagram to

Re: [Matplotlib-users] updating changed diagram?

2009-06-10 Thread Ole Streicher
Hi Mathias, Matthias Michler matthiasmich...@gmx.net writes: you can reset the ydata using: ydata = myline.get_ydata() ydata += 50 myline.set_ydata(ydata) # pass new data to line object Does this work for you? Yes. Altough I dont understand why I have to set it again (the ydata still belong

[Matplotlib-users] Removing picked line

2009-06-10 Thread Ole Streicher
Hi again, when right-clicking on one or more lines in a plot, I want to present the user a context menu where he can select to remove these lines. Preferrably I want to do this not with a 'pick_event' connection but with the (Qt) backend methods since the context menu should contain more options

Re: [Matplotlib-users] Removing picked line

2009-06-10 Thread Ole Streicher
Hi John, John Hunter jdh2...@gmail.com writes: If for some reason the built in pick_event is unsuitable, you can create your own matplotlib.backend_bases.MouseEvent and call line.contains(event) for each line you want to hit test. Thank you, that works for me. But for some reason, the y

Re: [Matplotlib-users] Removing picked line

2009-06-10 Thread Ole Streicher
Hi John, John Hunter jdh2...@gmail.com writes: On Wed, Jun 10, 2009 at 9:11 AM, John Hunterjdh2...@gmail.com wrote: ax.lines.remove(someline) fig.canvas.draw() See also http://matplotlib.sourceforge.net/users/artists.html Thank you very much, this helped a lot. (the manpages to artists

[Matplotlib-users] qt4: Transforming to display coordinates

2009-06-04 Thread Ole Streicher
Hi, I want to implement a cursor on a diagram using native Qt routines. For this, I would need to transform data (axis) coordinates to display coordinates. The manual of matplotlib, API axes just jays that there are some public attributes 'transData' and 'transAxis', but without an explanation.

[Matplotlib-users] Get coordinates at moouse position

2009-06-04 Thread Ole Streicher
Hi again, when I scroll or zoom with the mouse wheel, the scaling of the x and y axes are changed within the event. I would need now the new value of these to update the status bar. How can I get them without waiting for a new mouse event? Cheers Ole

Re: [Matplotlib-users] qt4: Transforming to display coordinates

2009-06-04 Thread Ole Streicher
Hi John, thank you four your helpful answer. John Hunter jdh2...@gmail.com writes: On Thu, Jun 4, 2009 at 8:49 AM, Ole Streicher ole-usenet-s...@gmx.net wrote: def on_move(self, event) mouse_pos_diag_x = ???(event.xdata) mouse_pos_diag_y = ???(event.ydata) where I would

Re: [Matplotlib-users] Get coordinates at moouse position

2009-06-04 Thread Ole Streicher
Hi John, John Hunter jdh2...@gmail.com writes: On Thu, Jun 4, 2009 at 9:00 AM, Ole Streicher ole-usenet-s...@gmx.net wrote: when I scroll or zoom with the mouse wheel, the scaling of the x and y axes are changed within the event. I would need now the new value of these to update the status

[Matplotlib-users] button_press_event: Key presses not recognized?

2009-06-03 Thread Ole Streicher
Hi again, I have another problem: I try to connect Control + mouse drag to some zoom event. On mouse press, I need to check whether the Ctrol key is pressed: 8 import random import sys from PyQt4 import QtGui, QtCore from

Re: [Matplotlib-users] Strange resize behaviour for qt backend

2009-05-29 Thread Ole Streicher
Hallo Theodore, Drain, Theodore R theodore.r.dr...@jpl.nasa.gov writes: Remember, this is not a multi-threaded system.  You can't receive a second repaint event while the drawing code is happening because the event loop is not in a separate thread.  This is not my choice. If the user resizes

[Matplotlib-users] Strange resize behaviour for qt backend

2009-05-27 Thread Ole Streicher
Hi, I am using matplotlib for some data vizualization. To ensure a consistent user interface among the whole application, I do the scrolling/zooming stuff myself. So, for a diagram, a horizontal scrollbar is displayed below the diagram that enabled to shift along the x axis. This is (part of) the