### Re: [Matplotlib-users] Polygon masking possible?

Hi, I often do this with ds9 and funtools. ds9 is an astronomy-oriented image viewer (http://hea-www.harvard.edu/RD/ds9/) but you can also use it with numpy array. Within ds9, you can define regions (ellipse, polynomial, etc) easily with a mouse. After you define a region (and save it as a file),

### Re: [Matplotlib-users] displaying a legend from a different subplot

Hi, Try mylines = plot1.get_lines() plot2.legend(mylines, [p.get_label() for p in mylines]) When you call the legend method with two arguments, first argument is a list of lines and second argument is a list of labels. It does not seem to matter whether lines are from same axes. Hope this

### Re: [Matplotlib-users] draw upper and lower limits

If you're like me and what you want is just an arrow mark with its head at (x,y), you may use scatter() with custom verts. arrowup_verts = [[0.,0.], [-1., -1], [0.,0.], [0.,-2.],[0.,0.], [1, -1]] arrowdown_verts = [[0.,0.], [-1., 1], [0.,0.], [0.,2.],[0.,0.], [1, 1]]

### Re: [Matplotlib-users] ticks labels

A minor comment. John's code may give incorrect results when exponents are negative. int() truncates a floating point argument towards zero, e.g., int(-1.5) == -1 not -2. I guess calling floor() before int() will work. fx = int(np.floor(np.log(abs(val))/np.log(self._base) +0.5)) -JJ On

### Re: [Matplotlib-users] Control space between bars

Hi Mathieu, It seems to me that you're confused with the meaning of the transAxes. It is a transform from the Axes coordinate to the Canvas(?) coordinate. As far as I can see, what you seemed to want is a transform between Data coordinate and Axes coordinate, and that would be transScale +

### Re: [Matplotlib-users] Label baseline not aligned

Hi, As far as I know, xticklabels in matplotlib are top-aligned, so you may see misaligned baseline sometimes. Still, the problem you reported seems to be a bug in the pdf-backend. I posted a simple bug fix of the pdf backend http://article.gmane.org/gmane.comp.python.matplotlib.general/14041

### Re: [Matplotlib-users] two legends

Hi, The legend of an axes instance is stored in axes.legend_ attribute. And your second legend call will simply rebind this attribute to the new legend object, and the first one is never drawn. You may make a custom Axes class which can hold multiple legends. But if you want something quick,

### Re: [Matplotlib-users] Automatically make room for my tick labels without GUI ?

While I don't know much about how callbacks work in matplotlib, looking at the source code of figure.draw() method, it seems that call_back functions connected with the draw_event are called after a figure is drawn. Therefore, you need a second draw. My guess is that this second draw is somehow

### Re: [Matplotlib-users] Arrows using Line2D and shortening lines

Hi Jason, I did made a similar class sometime ago and I'm attaching it just in case. I guess it is very similar to yours but I rely on matplolib.patches.FancyArrow class to draw the arrow head. The circle drawn by scatter() command should be a circle with size s (the third argument of the

### Re: [Matplotlib-users] Arrows using Line2D and shortening lines

Sure. you may include it if you want. -JJ On Sat, Aug 23, 2008 at 12:10 AM, Jason Grout [EMAIL PROTECTED] wrote: Jae-Joon Lee wrote: Hi Jason, I did made a similar class sometime ago and I'm attaching it just in case. I guess it is very similar to yours but I rely

### Re: [Matplotlib-users] axis formatting

You can suppress the tick marks on the top and right axis as Mathieu suggested. Setting frame_on as False will suppresse both the bounding lines and the white background patch of the axes. You can suppress only the bounding lines by ax = gca() ax.frame.set_visble(False) Note that this will

### Re: [Matplotlib-users] axis formatting

at 14:38, Jae-Joon Lee [EMAIL PROTECTED] wrote: You can suppress the tick marks on the top and right axis as Mathieu suggested. Setting frame_on as False will suppresse both the bounding lines and the white background patch of the axes. You can suppress only the bounding lines by ax = gca

### Re: [Matplotlib-users] imshow and projections

2. I have a skymap I would like to plot using a particular projection - what I've been doing so far is specifying x and y coordinates using mgrid and calling contourf(x,y,data,100) to approximate this. But what I'd rather do is something like imshow(data,extent=[-pi,pi,-pi/2,pi/2]) ... when

### Re: [Matplotlib-users] eliminating the top tick on an axis

Hi, It seems that there is no guarantee that the get_major_ticks() methods returns only ticks within the view interval, i.e., it can return ticks outside the data limit. As far as I see, this is related with the general behavior of locator objects. For example, In [71]:

### Re: [Matplotlib-users] How to give a name to a figure?

To change the window title, you may use fig.canvas.set_window_title(My Title) But I couldn't find any public method to obtain the current window title. If you just want to have a title associated with a figure, I guess you can simply define your title attribute. For example,

### Re: [Matplotlib-users] adding a filled rectangle

import matplotlib.pyplot as plt import matplotlib.patches as mpatches xy = 0.3, 0.3, width, height = 0.2, 0.5 p = mpatches.Rectangle(xy, width, height, facecolor=orange, edgecolor=red) plt.gca().add_patch(p) plt.draw() A Rectangle is a patch class and (although I'm not sure) I don't think

### Re: [Matplotlib-users] Square Axes

Adjusting a physical size of the axes is a bit tricky in matplotlib, as the axes has an fixed position in normalized figure coordinate. But, I guess setting the axes aspect ratio in physical size is doable relatively easily, at least if your x,y axis are in linear scales. For example, if you want

### Re: [Matplotlib-users] axes and transData

Hi, As far as I know, the destination coordinate of trans* is a display (canvas) coordinate, not the normalized figure coordinate. It has a dimension of f.get_figwidth()*f.get_dpi(), f.get_figheight()*f.get_dpi(). For example, transFigure transforms the normalized figure coordinate to the

### Re: [Matplotlib-users] vertical padding in legend

Hello, I just had a quick look at this problem. And I'm posting a quick solution in case Christoper haven't dig it yet. Index: lib/matplotlib/legend.py === --- lib/matplotlib/legend.py(revision 6138) +++

### Re: [Matplotlib-users] Plotting loop refuses to update display on OS X

functions like raw_input blok the mianloop of some gui backends (e.g., gtk) but work fine with some other backend (although Tk is the only backend I know of). So my guess is that you used a different backend with 0.98.1. I guess you have a few options. * try different backend (Tk) with 0.98.3 *

### Re: [Matplotlib-users] Clear Figure

I guess you need to put draw() after plot() self.canvas.figure.clf() self.canvas.axes.plot([1.,2.,4.]) self.canvas.draw() Let us know if it does not help. -JJ On Sat, Oct 4, 2008 at 7:17 PM, rocha [EMAIL PROTECTED] wrote: Hi Guys, I need to clear the Figure after the user has clicked the

### Re: [Matplotlib-users] vertical padding in legend

Done, except that it just raises a warning, and still works with the old kwarg. The new kwarg is borderpad; it is used if pad==0, which is the new rc default. I set the default borderpad=0.5. There is still too much other positioning in legend that is based on axes units. I briefly tried

### Re: [Matplotlib-users] Lines and columns in legends

The current legend class does not support multiple columns. Eric Wertman once mentioned in this list that he would work on this feature, but I don't know the current status. A (partial) rewrite of the legend class which I plan to support multicolumns is in my TODO list but I haven't started it

### Re: [Matplotlib-users] no canvas reinitialization between calls to savefig

I can reproduce Thomas' problem with Agg backend. It does not happen if frame_on is True. And I guess Thomas' guess in the first email might be right. I had a quick look at the mpl source and I don't think draw(), clf() or savefig() try to clear the canvas. The problem is not visible if frame_on

### Re: [Matplotlib-users] no canvas reinitialization between calls to savefig

I spent some time working on it and came to the following conclusion: if the mpl figure is fully transparent, you see whatever is in the gui rendering buffer, which may be unintiialized memory. In some sense, mpl is doing what is asked of it, making a fully transparent figure. Clearing the

### Re: [Matplotlib-users] Python 2.6

I think the problem is caused by the image compositing logic in the Axes.draw() method. It currently makes a composite image first and then flip the resulting image if necessary. But I think what should happen is to flip the original images first and then do the compositing. So, test the attached

### Re: [Matplotlib-users] Python 2.6

Hey Jae Joon -- thanks for looking into this. I don't have time to test this patch, but I wanted to mention that there is an analogous problem for figure image compositing -- see figimage_demo.py. agg shows the correct behavior: the two images should be in the lower left, and the blue

### Re: [Matplotlib-users] Python 2.6

know if there are cases this patch does not work. -JJ On Sat, Nov 8, 2008 at 7:28 PM, John Hunter [EMAIL PROTECTED] wrote: On Sat, Nov 8, 2008 at 6:10 PM, Jae-Joon Lee [EMAIL PROTECTED] wrote: My original patch does not work for this case, because the figimage is drawn by Figure.draw

### Re: [Matplotlib-users] Save a plot background

I think the savefig() command calls draw() internally, doesn't it? So, I guess the restore_region() command comes before the draw() call, i.e., it has no effect for the saved figure. One way I can think of is to save the agg buffer without redrawing it. It seems work. ---

### Re: [Matplotlib-users] plt.gca().get_frame().set_linewidth

get_frame() is deprecated (it is supposed to show you a DeprecationWarning). Axes class now has a frame property, so gca().frame.set_linewidth(2) should work. Currently get_frame() returns Axes.patch which is used to draw a axes background. -JJ On Tue, Nov 18, 2008 at 12:24 PM, Christopher

### Re: [Matplotlib-users] Axis lines crossing in them middle of the plot

On Tue, Nov 18, 2008 at 9:20 AM, John Hunter [EMAIL PROTECTED] wrote: There are two related problems here: one easier, one harder. We can start with the easier one. The easy one is to have a detachable axis. Right now we have one on the right and one on the left for the x-axis. We may as

### Re: [Matplotlib-users] Two questions regarding axis scaling

What if I wanted one legend with both entries in it, rather than two separate legends with a different entry in each? Is that possible? That's more desirable than two separate legends. Check http://www.nabble.com/displaying-a-legend-from-a-different-subplot-td18447966.html#a18447966 The

### Re: [Matplotlib-users] Font sizes for web application

On Mon, Dec 1, 2008 at 12:56 AM, Jesper Larsen [EMAIL PROTECTED] wrote: Hi Matplotlib users, I have a web application in which I would like to scale the plots down if the users horizontal screen size is less than 800. Currently only the plot is scaled while the fonts are fixed in size (see

### Re: [Matplotlib-users] fancy patch formatting breaking tex document

John, I remember that - is also rendedered as a dot in the HTML output. Using \- instead of - seems to work. But, I'm afraid that the help (or similar) command, which I frequently use in interactive sessions, may show \- instead of -. So, quoting seems to be a best option to me. Regards, -JJ

### Re: [Matplotlib-users] different PNG and PDF output...

I just found my previous message was only sent to Lebostein. Anyhow, here is my original meesage. On Tue, Dec 16, 2008 at 10:38 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote: Yes, I can see the differences. Anyway, it seems to me the differences are primarily caused by different dpi

### Re: [Matplotlib-users] different PNG and PDF output...

On Tue, Dec 16, 2008 at 12:17 PM, jkitchin jkitc...@andrew.cmu.edu wrote: I also observed this with eps output. The png looked fine, but the eps legend was very large in my case. j Hmm, it is not clear to me if this is a same issue. I think eps output is not very sensitive to dpi thing in

### Re: [Matplotlib-users] different PNG and PDF output...

On Tue, Dec 16, 2008 at 4:02 PM, Jouni K. Seppänen j...@iki.fi wrote: Jae-Joon Lee lee.j.j...@gmail.com writes: So, Lebostein and j, if you know how to check out using svn, can you give a try either the svn trunk or the maintenance branch? I'm attaching the patch just in case. On the svn

### Re: [Matplotlib-users] different PNG and PDF output...

. John, are you releasing a new maintenance version? I'm afraid that my previous patch broke one of the example. Sorry, I thought the fix was obvious and didn't pay much attention. On Tue, Dec 16, 2008 at 5:18 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote: On Tue, Dec 16, 2008 at 4:02 PM, Jouni K

### Re: [Matplotlib-users] FancyArrowPatch without annotate

Ken, On Wed, Dec 17, 2008 at 1:14 AM, Ken Schutte kts.li...@gmail.com wrote: This new FancyArrow stuff looks great, but I'm having trouble getting it to work. All of the gallery examples I see seem to only use it thru an 'annotate' call. I just want to draw these arrows directly. I tried

The legend class has been reimplemented recently and the name of some keyword arguments (and their meaning) has been changed. Those parameters you're using are deprecated ones. It is supposed to show you some warnings if deprecated parameters are used, so what you see is a bug. I'll take a look. I

did my own test and it worked well for me, and I hope it does not cause any problem. Regards, -JJ On Fri, Dec 19, 2008 at 9:44 AM, John Hunter jdh2...@gmail.com wrote: On Fri, Dec 19, 2008 at 8:36 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote: The legend class has been reimplemented recently

### Re: [Matplotlib-users] FancyArrowPatch without annotate

On Wed, Dec 17, 2008 at 1:19 PM, Ken Schutte kts.li...@gmail.com wrote: It might be nice if eventually there were extra styles, e.g. -|, |-| for single lines with solid arrowheads This is now added in the trunk. -JJ

### Re: [Matplotlib-users] No such attribute error with PDF output

It seems as a bug in the pdf backend, which can be fixed by the simple patch below. I didn't commit this fix as I think it would be better if original author (Jouni?) make sure this is a correct way. Neil, your code will work okay if you don't use hatch. Or, you may apply the patch by yourself.

### Re: [Matplotlib-users] different PNG and PDF output...

On Sat, Dec 20, 2008 at 6:02 PM, Lebostein lebost...@gmx.de wrote: A little thing: the shadow of the legend box is not scaling with the dpi. For example with 300 dpi I can't discover the shadow... This also should be fixed in the maintenance branch and the trunk. Thanks for reporting. -JJ

### Re: [Matplotlib-users] (no subject)

On Sat, Dec 20, 2008 at 8:52 AM, jouni k seppänen j...@iki.fi wrote: Also the patch demo or some unit test should cover that branch of the code, ie the case when more than one patch has the same hatch pattern. I just check in the patch with a slight change in the hatch_demo.py Regards, -JJ

### Re: [Matplotlib-users] Absolute spacing for embedded figure

On Sun, Dec 21, 2008 at 1:30 PM, Georg Brandl g.bra...@gmx.net wrote: Hi, I'm currently using Qwt to display a plot in a GUI application, but I'd like to replace it with matplotlib and a shell window, so that the user can not only view the plot but also modify it in-place using pyplot

### Re: [Matplotlib-users] Legend in X coordinates

The exact location of the legend is known at drawing time. Thus, the location of the text needs to be calculated at the drawing. I may help you with this but it is quite tricky and you need some knowledge on internals of the mpl. Or, you may simply draw the figure twice (with same renderer),

### Re: [Matplotlib-users] clabel return values

I guess you're missing vertical and horizontal alignment. Also, your font properties were not set correctly. The 4th argument of the text function is a color. fontdict2 = {'fontweight':'light', 'color': 'r', 'fontsize':fontsize} fp = FontProperties(fontdict2) labels =

### Re: [Matplotlib-users] clabel return values

: ltext = label.get_text() lx,ly = label.get_position() lrot=label.get_rotation() va, ha = label.get_va(), label.get_ha() t = plt.text(lx,ly,ltext, fontproperties=fp, rotation=lrot,va=va, ha=ha) plt.savefig('output.png') Jae-Joon Lee wrote: I guess you're missing

### Re: [Matplotlib-users] set axes size; figure adjusts

The best I've come up with so far is to create a figure with a set size, and then add axes with a specified rectangle. But this does not give a neat path to what I want. Alan, I think the way you're doing is the easiest way. Anyhow, can you provide an example of a neat path? In my view,

### Re: [Matplotlib-users] set axes size; figure adjusts

For my current use it would be enough if savefig had an option bbox = 'tight' so that only the area actually drawn in was written to file. The problem is that if you set the fig size and then set the axis size proportionately, you must fiddle with things to get a tight fit to

### Re: [Matplotlib-users] scale the legend

If you use recent version of mpl, the size of the overall legend should scale with the font size. See below, import matplotlib.font_manager prop = matplotlib.font_manager.FontProperties(size=5) lagend(prop=prop) Just in case, my preference in your case is to move the legend outside of the axes

### Re: [Matplotlib-users] Vertical alignment of a text

Take a look at http://matplotlib.sourceforge.net/users/text_props.html But I guess MPL's functionality is somewhat limited compared to PyX, especially in multiline support. -JJ On Wed, Jan 14, 2009 at 1:13 PM, projet...@club-internet.fr wrote: Hello, is there a similar functionnality to

### Re: [Matplotlib-users] Vertical alignment of a text

-Joon Lee A: projet...@club-internet.fr Sujet: Re: [Matplotlib-users] Vertical alignment of a text Copie à: matplotlib-users@lists.sourceforge.net Take a look at http://matplotlib.sourceforge.net/users/text_props.html But I guess MPL's functionality is somewhat limited compared to PyX, especially

### Re: [Matplotlib-users] Vertical alignment of a text

va=baseline does not work? -JJ On Thu, Jan 15, 2009 at 3:05 AM, projet...@club-internet.fr wrote: Dimension of a text in mpl is renderer-dependent in general. Each renderer has get_text_width_height_descent method which returns width, height, and descent of the given text. If you're only

### Re: [Matplotlib-users] Vertical alignment of a text

I presume that you're only interested in the math formula, and not in any other graphical functionality of MPL. You may use mathtext module directly in that case. from matplotlib.mathtext import MathTextParser p = MathTextParser(bitmap) filename, texstr = test.png, r$\alpha$ p.to_png(filename,

### Re: [Matplotlib-users] zorder with twinx grid

twinx makes a separate axes and zorders are only meaningful within a same axes. Because ax2 is added to the figure later than the original axes, artists in ax2 are always above others. I don't think there is an easy way to make zorder work between several axes, unless you somehow merge them into

### Re: [Matplotlib-users] Scale subplot plots?

I'm afraid that you may not be able to do those with the subplot. If you want a fixed size axes, you need to manually calculate the axes position (in normalized figure coordinates) using the figure size. You may use my helper class which support a fixed-size axes.

### Re: [Matplotlib-users] unfilled markers?

Norbert, It did, thank you! One question, though: when I originally tried something like this, it didn't work, because it was treating pl as a list and giving me the error of list object has no attribute 'set_mec()' Why does the addition of the comma to pl allow it to see it as a line?

### Re: [Matplotlib-users] bounding box again

As Jouni suggested, the frameon argument needs to be applied to the figure, not to the axes (or subplot). Regards, -JJ On Mon, Jan 26, 2009 at 10:54 AM, Willi Richert w.rich...@gmx.net wrote: Hi, in my version 0.98.5 frameon=False (as a subplot argument) just omits the black lines at the x

### Re: [Matplotlib-users] unable to create legend for vlines graph

This is a bug introduced in the recent version of MPL. While it is fixed in the maintenance branch, there is no release yet. You may 1) try the svn version or 2) apply the patch by yourself.

### Re: [Matplotlib-users] How to plot straight lines on polar plots

I don't see any elegant way to do that. The easiest way I can think of is to use a derived line2d class. Something like below will work. Others may have better ideas. import matplotlib.lines class Line2DNoInterpolation(matplotlib.lines.Line2D): def recache(self):

### Re: [Matplotlib-users] ticks in Matplotlib

You cannot set different tick positions for bottom and top x-axis in the same axes. What you can do is to make another axes at the same location and use it to draw ticks at top. Take a look at http://matplotlib.sourceforge.net/examples/api/two_scales.html But it may not be an ideal solution for

### Re: [Matplotlib-users] setting thickness of axis frame

Actually, I just went back and found a reply from Jae-Joon to a post of mine in November about this. He points out that get_frame() is deprecated, but that gca().frame.set_linewidth(2) should work. This is not working for me either now (it was at the time), and now that I notice, I am also

### Re: [Matplotlib-users] different Locator for opposite axes

Since you call twinx then twiny, you're creating two additional axes, not one. And I guess this is why labels are drawn twice. You may do def twin(ax): ax2 = ax.figure.add_axes(ax.get_position(True), frameon=False) ax2.yaxis.tick_right()

As far as I know, there is no user settable attribute. But something like below will work. ax = gca() title(My title) ax.titleOffsetTrans._t = (0., 10.0/72.) # x, y offset in points/72. default is (0., 5/72.) ax.titleOffsetTrans.invalidate() draw() Alternatively, you may use

### Re: [Matplotlib-users] imshow scaling

When you say own axes, I presume you're using subplots. You need to create your axes with different sizes (subplot creates axes with same size), so that the height of images are equal when they shrink to to fit in the axes box. You may create an axes with a given size with following command

### Re: [Matplotlib-users] Two y axis with twinx, only one of them logscale

I believe that it does not actually change the y scale of the first axes, but simply the y tickmarks of the second axes gets visible again. It seems to me a bug, though. Anyhow, I guess inserting following line after ax2.set_yscale(log) should solve your problem. ax2.yaxis.tick_right() -JJ On

### Re: [Matplotlib-users] matplotlib issue: cannot auto-scale X axis of plop properly

What version of maploltib are you using? Your data displayed with correct scale with my installation of matplotlib 0.98.5.2. By the way, you're chaning the axes limit of the wrong axes. matplotlib.pyplot.axes() create a new axes. Use plt.xlim (or plt.ylim for y-limit), or use the method of the

### Re: [Matplotlib-users] Problems with saving figure from within mod_python script

I think the error is raised when you try to import matplotlib (not when you try to save your figure) matplotlib needs its config directory writable. It first try MPLCONFIGDIR env. variable, then try $HOME/.matplotlib. Here, the$HOME is the home directory of the user executing the script. I think

### Re: [Matplotlib-users] pick the legend? pick a point but not a connecting line?

1) WIthin this same pick handler function, have another if conditional, but for the case when the user is picking the legend. In other words, I want to pick the legend artist, not a Line2D artist. I'm afraid but it is not clear what you want here (at least to me). Can you just pick up the

### Re: [Matplotlib-users] Matplotlib change xticks and retain xticks changing during zoom

This is in contrast to the effect of the following code: try: from math import * import pylab as p except: print Couldn't import all dependent libraries sys.exit() dataLength = 100 data = [sin(2*pi*x/dataLength) for x in range(0,dataLength)] p.plot(data)

### Re: [Matplotlib-users] fixation heat map

Please take a look at our gallery to see what you can do with matplotlib. http://matplotlib.sourceforge.net/gallery.html I am working on the eye movement data of our driving experiment. It would be interesting to look at the spatial distribution, and most frequent visited AOIs. You'd better

### Re: [Matplotlib-users] Adding custom axes within a subplot

Here is my modification. Bbox = matplotlib.transforms.Bbox.from_bounds(.4, .1, .5, .3) trans = ax.transAxes + fig.transFigure.inverted() l, b, w, h = matplotlib.transforms.TransformedBbox(Bbox, trans).bounds axins = fig.add_axes([l, b, w, h]) On Mon, Feb 23, 2009 at 2:49 PM,

### Re: [Matplotlib-users] Fontsize of tick labels

On Mon, Feb 23, 2009 at 3:06 PM, Johann Rohwer j...@sun.ac.za wrote: Is there any way of conveniently changing the font size of tick labels using the object-oriented interface? I'm aware of plt.xticks(fontsize=6), which does this globally for a figure, but if I have a number of custom axes of

### Re: [Matplotlib-users] Plotting with custom symbols

Can't you simply use text? text(0.5, 0.5, s, va=center, ha=center) Unfortunately, no TextCollection yet. -JJ On Tue, Feb 24, 2009 at 4:49 PM, Fred Mailhot fmail...@connect.carleton.ca wrote: Hi, I've looked through the documentation, and see that it's possible to plot a variety of

### Re: [Matplotlib-users] Help with simply plotting 2d array, please

I don't use wx so i'm not sure if this could be helpful, but you may check the figimage command. http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.figimage Note that it draws the image directly into the figure, thus no axes is needed. -JJ On Wed, Feb 25, 2009 at 6:09

### Re: [Matplotlib-users] Legend grows in wrong direction

On Thu, Feb 26, 2009 at 4:51 AM, Søren Nielsen soren.skou.niel...@gmail.com wrote: I've tried placing a legend using the loc = (x,y) .. and the legend is moved where I want it. the problem is, when I add new lines to the plot.. the legend grows, but upwards.. so the lower left point of the

### Re: [Matplotlib-users] polar graph

I recommend you to use the Wedge class in matplotlib.patches. from matplotlib.patches import Wedge # draw a wedge in the axes coordinate. (0.5, 0.5) in axes coordinate corresponds to (0,0) in polar coordinate. trans = ax.transAxes center, R = (0.5, 0.5), 0.5 twopi=360. pie1 = Wedge(center, R, 0,

### Re: [Matplotlib-users] xticklabels printed twice when using twinx

Hi Erick, Is there any particular reason to introduce _xaxison and _yaxison, instead of using set_visible(False) on the xaxis and yaxis? Just wondering.. -JJ On Sat, Feb 28, 2009 at 1:52 PM, Eric Firing efir...@hawaii.edu wrote: Christoffer Aberg wrote: Hi all, I have noticed a funny

### Re: [Matplotlib-users] setting font of axes ticklabels and making labels not overlap

but it does not work. i tried similarly setting the font size (with set_size() or through rcParams) but it did not work either. how can i do this? i'd like to do this either on per axes basis, or for the entire figure. It seems that changing rcParams is not effective because of the way how

### Re: [Matplotlib-users] removing leading zeros in ticklabels

FormatStrFormatter (and other formatters) rely on Python's string interpolation, and It does not seem to be possible to get rid of the leading zero (http://docs.python.org/library/stdtypes.html). I think what you can do is to replace 0. with . after the interpolation. Something like below works

### Re: [Matplotlib-users] setting font of axes ticklabels and making labels not overlap

(l)) fp = FontProperties(family=Lucida Sans Typewriter) fp.__hash__ = my_hash runs, but does not change the font either. would be very interested if you have any other ideas? thanks. On Sat, Feb 28, 2009 at 6:04 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote: On Sat, Feb 28

### Re: [Matplotlib-users] Rotate legend ?

I don' think these is a straight forward way to rotate the legend as a whole. As a matter of fact, it is hardly possible with the current implementation of the legend class. Could you explain why do you want to have a rotated legend? An example figure (from other plotting package) will be very

### Re: [Matplotlib-users] Rotate legend ?

a normal bar chart (vertical bars) and rotate the whole figure (please see attached file), this is why I need the legend to be 90°-rotated, so that it's in the right position afterall. Thanks for your time. Regards. N. 2009/3/1 Jae-Joon Lee lee.j.j...@gmail.com I don' think

### Re: [Matplotlib-users] barchart: center xticklabels for only one data set

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.bar use ax.set_xticks(ind+width*.5) instead of ax.set_xticks(ind+width) -JJ On Thu, Mar 5, 2009 at 1:40 PM, Timmie timmichel...@gmx-topmail.de wrote: Hello, I tried to modify the bar chart demo for my case. I

### Re: [Matplotlib-users] figlegend: doesn't display markers

Your code works fine for me with mpl 0.98.5.2. What version of mpl are you using? print matplotlib.__version__ -JJ On Thu, Mar 5, 2009 at 12:03 PM, Erik Granstedt egranst...@gmail.com wrote: Hello, I found an issue in working with subplots and using figlegend: it doesn't display markers.

### Re: [Matplotlib-users] Pause/waitforbuttonpress behavior.

I have no idea whether this is related with the GIL. Anyhow, you may work around this by running the blocking function in a separate thread, although I only tested this with Gtk backends. Here is a related post.

### Re: [Matplotlib-users] forgetful xlim?

Try aa.set_autoscale_on(False) before your make_xaxis call (but after xlim and ylim changed). When you plot something, the xlim and ylim is automatically adjusted (unless you set autoscale=False). -JJ On Wed, Mar 11, 2009 at 2:31 PM, Nicholas Stephens nicholas.steph...@univ-brest.fr wrote:

### Re: [Matplotlib-users] legend bug?

It can be tricky to give you a correct answer without knowing what version of mpl you're using. The legend for the scatter plot has been added rather recently so my answer below may not work for you. Anyhow, this seems to be a bug in the documentation, not the code. The legend for scatter plot

### Re: [Matplotlib-users] problems with contourf alpha

Reading Eric's reply on the previous email, my impression is that contourf is not supposed to draw the boundary (no stroke!). But it seems it still does. for c in cs.collections: c.set_edgecolor(none) After this, I can get rid of the vertical lines. I can see slight gaps between filled

### Re: [Matplotlib-users] Wide y-axis major tick labels

http://matplotlib.sourceforge.net/faq/howto_faq.html#move-the-edge-of-an-axes-to-make-room-for-tick-labels something like fig.subplots_adjust(left=0.2) would work. -JJ On Tue, Mar 24, 2009 at 11:43 AM, Andy Yates newsp...@gmail.com wrote: I am trying to generate plots where the y-axis major

### Re: [Matplotlib-users] offset in dragging a legend

I don't have wx installed, so i'm not able to test your code. However, here are some of my thoughts. The location of the legend is the location of the lower-left corner in the normalized coordinate of its parent. In your case, it would be normalized axes coordinates. However, it seems that you're

### Re: [Matplotlib-users] Leftmost column of PNG output is transparent

I couldn't reproduce it (my output has no transparent column). I'm running the current svn. I wonder if others can reproduce it. Kevin, what happen if you only do one of the pcolor or the contourf (it is not clear why you're calling pcolor as it will be overridden by contourf)? -JJ On Mon, Mar

### Re: [Matplotlib-users] offset in dragging a legend

As I said in my previous email, the _loc attribute of the legend need to be in the normalized axes coordinate, i.e., the lower left corner of the axes being (0,0) and the upper-right corner being (1,1). Thus, it needs to be something like below. loc_in_canvas = self.legend_x + mouse_diff_x,

### Re: [Matplotlib-users] offset in dragging a legend

On Wed, Mar 25, 2009 at 9:06 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote: As I said in my previous email, the _loc attribute of the legend need to be in the normalized axes coordinate, i.e., the lower left corner of the axes being (0,0) and the upper-right corner being (1,1). Thus, it needs

### Re: [Matplotlib-users] Working with arrows

You need to adjust the keyword arguments, such as head_width, etc. The arrow command itself is poorly documented and its keyword arguments are explained in matplitlib.patches.FancyArrow. However, I recommend you to use annotate command instead of arrow (you can give empty string if you just need

### Re: [Matplotlib-users] offset in dragging a legend

Ah, my bad. Try self.legend.parent.transAxes.inverted().transform_point(loc_in_canvas) legend.parent points to the parent axes. -JJ On Wed, Mar 25, 2009 at 9:36 PM, C M cmpyt...@gmail.com wrote: On Wed, Mar 25, 2009 at 9:06 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote: As I said in my

### Re: [Matplotlib-users] offset in dragging a legend

speed, you may consider to use blit method. http://matplotlib.sourceforge.net/examples/animation/animation_blit_wx.html -JJ On Wed, Mar 25, 2009 at 10:55 PM, C M cmpyt...@gmail.com wrote: On Wed, Mar 25, 2009 at 9:58 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote: Ah, my bad. Try

### Re: [Matplotlib-users] legend with errorbar() problem

Hi, Unfortunately, the current legend frame work does not support errorbars. And I don't think implementing this is easy. The thing is that errorbar creates multiple artists instead of single one. The best workaround I can think of is to make the legend only with markers (and lines if you want),