Re: [Matplotlib-users] query about pyplot.text example

2010-01-03 Thread Jae-Joon Lee
How about just extending the functionality of the "annotate"? I believe it should be quite straight forward since "annotate" already support "offset points". And "points" in matplotlib is dpi independent. However, I think calling "annotate" for an offset text is a bit inconvenient for now. annota

Re: [Matplotlib-users] Colorbar embedding in qt4

2010-01-03 Thread John Hunter
On Sun, Jan 3, 2010 at 7:02 PM, Alexander Hupfer wrote: > Thanks I got it fixed. > This leads to the follow up question: > What is the right way to keep an application responsive while the graph is > drawn? > Drawing a scatter plot with 300 points seems to take a while. I guess I need > to launch

Re: [Matplotlib-users] Colorbar embedding in qt4

2010-01-03 Thread Eric Firing
Alexander Hupfer wrote: > Thanks I got it fixed. > This leads to the follow up question: > What is the right way to keep an application responsive while the graph > is drawn? > Drawing a scatter plot with 300 points seems to take a while. I guess I That's strange--a scatter plot with 1000 points

Re: [Matplotlib-users] Colorbar embedding in qt4

2010-01-03 Thread Alexander Hupfer
Thanks I got it fixed. This leads to the follow up question: What is the right way to keep an application responsive while the graph is drawn? Drawing a scatter plot with 300 points seems to take a while. I guess I need to launch the drawing in another thread but don't know exactly how to do this a

Re: [Matplotlib-users] query about pyplot.text example

2010-01-03 Thread Eric Firing
Phillip M. Feldman wrote: > What is meant by "draw time"? When you call text(...), a Text object is created and added to a list of things (Artists) to be drawn, but no drawing occurs (unless using pyplot in interactive mode) until a draw(), show(), or savefig() command is given. That's "draw t

Re: [Matplotlib-users] query about pyplot.text example

2010-01-03 Thread Phillip M. Feldman
What is meant by "draw time"? For most purposes, I think that I'd want to specify an offset in font units (points). If offsets are specified in units of pixels, then the results would be display-dependent, and achieving display-independent results would require some additional fiddling. I wou

Re: [Matplotlib-users] Colorbar embedding in qt4

2010-01-03 Thread Darren Dale
On Sun, Jan 3, 2010 at 5:26 PM, Alexander Hupfer wrote: > Ok, that at least fixed the tkinter error, but I still don't get a colorbar > attached to my plot. (which worked fine when I didn't embedd it in a Qt > application) If you are importing from pylab or pyplot in your program, don't. These mo

Re: [Matplotlib-users] Colorbar embedding in qt4

2010-01-03 Thread Alexander Hupfer
Ok, that at least fixed the tkinter error, but I still don't get a colorbar attached to my plot. (which worked fine when I didn't embedd it in a Qt application) On Sun, Jan 3, 2010 at 3:13 PM, Laurent Dufrechou < laurent.dufrec...@gmail.com> wrote: > Hello, > > You are using the TK backend. > Add

Re: [Matplotlib-users] Colorbar embedding in qt4

2010-01-03 Thread Laurent Dufrechou
Hello, You are using the TK backend. Add this at the top of your script: import matplotlib matplotlib.use('QT4Agg') from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar Should

Re: [Matplotlib-users] Colorbar embedding in qt4

2010-01-03 Thread Alexander Hupfer
ok here comes some more code: def plot_angles(results, axes): lk.acquire() x = list(results[0]) y = list(results[1]) lk.release() p = axes.scatter(x,y, c = range(len(results[0]))) axes.set_xlabel('psi') axes.set_ylabel('delta') colorbar(p) def update_figure(self):

Re: [Matplotlib-users] dividing up subplots?

2010-01-03 Thread per freem
thanks very much. Using expand_subplot for that purpose worked great, but I am now trying a variant of this and am having trouble getting it to work. I'd like to create a subplot that has two parts: the left part is a square plot, and the right part is a 2x2 set of square subplots. Something like

Re: [Matplotlib-users] query about pyplot.text example

2010-01-03 Thread John Hunter
On Sun, Jan 3, 2010 at 2:50 PM, Eric Firing wrote: > I think that allowing display units would be easy to implement (as indicated > by Ryan's example), but font or physical units would be much trickier > because they would involve draw-time determinations.  Starting by allowing > only display unit

Re: [Matplotlib-users] query about pyplot.text example

2010-01-03 Thread Eric Firing
John Hunter wrote: > On Sun, Jan 3, 2010 at 10:22 AM, Ryan May wrote: >>> the marker. It would be great if one could specify the text offsets in >>> units of the font size rather than in units of map distance. >> You can do it, it just takes a bit of knowledge about how different >> transformatio

Re: [Matplotlib-users] Colorbar embedding in qt4

2010-01-03 Thread John Hunter
On Sun, Jan 3, 2010 at 11:34 AM, Alexander Hupfer wrote: > Hi, I have a scatter plot embedded in qt4 according to > http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.html > what works fine > However if I try to add a colorbar to it by simply calling > > p = scatter()

Re: [Matplotlib-users] query about pyplot.text example

2010-01-03 Thread John Hunter
On Sun, Jan 3, 2010 at 10:22 AM, Ryan May wrote: >> the marker.  It would be great if one could specify the text offsets in >> units of the font size rather than in units of map distance. > > You can do it, it just takes a bit of knowledge about how different > transformations are used under the h

[Matplotlib-users] Colorbar embedding in qt4

2010-01-03 Thread Alexander Hupfer
Hi, I have a scatter plot embedded in qt4 according to http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.htmlwhat works fine However if I try to add a colorbar to it by simply calling p = scatter() colorbar(p) I get an error that says that something is outside the dr

Re: [Matplotlib-users] eps/pdf/svg contourf contours don't overlap properly with high resolution data

2010-01-03 Thread Jordan Dawe
> Jouni K. Sepp?nen wrote: > >> Jordan Dawe writes: >> >> >>> Contourf plots that I output in vector format files have little >>> triangular glitches at the contour boundaries if the contoured array >>> is larger than about 200x200. The same files in png format are >>> perfect, even at ve

Re: [Matplotlib-users] query about pyplot.text example

2010-01-03 Thread Ryan May
On Sun, Jan 3, 2010 at 1:02 AM, Phillip M. Feldman wrote: > Ah.  It sounds as though one must consider the scale of the map, and > then choose these offsets so that the text falls near but not too near > the marker.  It would be great if one could specify the text offsets in > units of the font si