Re: [Matplotlib-users] [matplotlib-users] Figure dimensions issues

2010-01-19 Thread Jae-Joon Lee
On Mon, Jan 18, 2010 at 5:16 PM, Damon McDougall wrote: > The figure is actually cropped. Correct. > Is there another way around this that will get rid of the whitespace and have > the physical figure be 483.69687pt wide? Do not use bbox_inches="tight". Instead adjust the position of the axes

Re: [Matplotlib-users] Annotate Behaviour - Arrows Missing

2010-01-19 Thread Jae-Joon Lee
On Tue, Jan 19, 2010 at 2:48 AM, Kurt Forrester wrote: > I modified the script for the hax. annotate(...) to include the > annotate_clip=False, however there is no change in the behaviour of the > arrows. It should be "annotation_clip" not "annotate_clip", but it may be just a typo. Anyhow, as f

Re: [Matplotlib-users] Annotate Behaviour - Arrows Missing

2010-01-18 Thread Jae-Joon Lee
This is the feature that is not properly documented. You should call annotate with optional keyword annotation_clip=False, See below for the details. http://matplotlib.sourceforge.net/api/artist_api.html?highlight=annotation#matplotlib.text.Annotation.set_annotation_clip I'll fix the do

Re: [Matplotlib-users] Size of text for axes title

2010-01-18 Thread Jae-Joon Lee
http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels The above example is for ticklabels, but can be easily adopted for axes title. Regards, -JJ On Mon, Jan 18, 2010 at 12:07 PM, Jeremy Lewi wrote: > Hi, > > > > The title for my axes is being cutoff bec

Re: [Matplotlib-users] colorbar with date-time formatting

2010-01-15 Thread Jae-Joon Lee
Colorbar axes is a rather special and things need to be set during the initialization. Here is a slightly modified version of your script. While it does not produces error, I'm not sure if the result is correct. -JJ import numpy as np import matplotlib.pyplot as plt from matplotlib.dates impor

Re: [Matplotlib-users] white area around plots

2010-01-15 Thread Jae-Joon Lee
The svn version has a new keyword "bbox_extra_artists", which could be used. But, there is no easy way for the released version of matplotlib. Below is a workaround you may use, but it's a bit complicated. Regards, -JJ fig = figure(1) ax = fig.add_subplot(111) l1, = ax.plot([1,2,3]) leg = figl

Re: [Matplotlib-users] Possible bug in IndexFormatter

2010-01-14 Thread Jae-Joon Lee
This has indeed been fixed. http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/ticker.py?r1=7677&r2=7980 Some minor changes may not be listed in the changelog. Regards, -JJ On Thu, Jan 14, 2010 at 12:29 PM, Jeremy Lewi wrote: > Hello, > > > > I think I’m

Re: [Matplotlib-users] bezier curve through set of 2D points

2010-01-14 Thread Jae-Joon Lee
On Thu, Jan 14, 2010 at 4:38 AM, Mark Bakker wrote: > Does matplotlib have a routine that can fit a cubic Bezier curve through an > array of 2D points? > > I saw some Bezier routines in Path, but couldn't find what I am looking for. > As far as I know, no. > If matplotlib doesn't have it, does a

Re: [Matplotlib-users] Simple text style question

2010-01-13 Thread Jae-Joon Lee
On Wed, Jan 13, 2010 at 11:32 AM, Gökhan Sever wrote: > I printed the PNG and PS file. The result looks same on paper as well. I was > comparing the two ps file one from IDL one from MPL. IDL looks neat both on > the screen and printed. > Are you saying that the printout of the mpl-created postsc

Re: [Matplotlib-users] "Ordinal must be >= 1" with SuplotHost and dates

2010-01-13 Thread Jae-Joon Lee
The workarounds suggested in this thread does not work? To me, the ordinal thing is not actually a bug, but you need some extra caution to avoid this error happening. The issue with the label roration is a different matter though. Regards, -JJ On Wed, Jan 13, 2010 at 8:16 AM, Rodribat wrote:

Re: [Matplotlib-users] How can I customize a legend?

2010-01-13 Thread Jae-Joon Lee
You may consider to use proxy artists. plot([1,2,3], "s-") plot([1,3,2], "d-") l1 = Line2D([0], [0], marker="s", color="k") l2 = Line2D([0], [0], marker="d", color="k") p1 = Rectangle((0, 0), 1, 1, fc="b", ec="none") p2 = Rectangle((0, 0), 1, 1, fc="g", ec="none") legend([p1, p2, l1, l2], ["col

Re: [Matplotlib-users] Simple text style question

2010-01-13 Thread Jae-Joon Lee
On Tue, Jan 12, 2010 at 9:56 PM, Gökhan Sever wrote: > What could be causing this discrepancy? Is there any way to use an > alternative PS creator with MPL? or an option to increase e.g. bits per > pixel option somewhere in the configuration? > There can be a lot of things. However, you cannot ju

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-13 Thread Jae-Joon Lee
Regards, -JJ On Wed, Jan 13, 2010 at 3:16 AM, John Reid wrote: > > > Jae-Joon Lee wrote: >> I'm afraid that there is not much I can help anymore. >> >> Just in case, does the same error occur when my patch is not applied? >> >> Is it an error or just a war

Re: [Matplotlib-users] Simple text style question

2010-01-12 Thread Jae-Joon Lee
On Mon, Jan 11, 2010 at 3:20 PM, Gökhan Sever wrote: > Another thing I noted in these images, Qt4Agg produced one looks much > prettier to my eyes than the PS. What could be causing the jiggly rendering > in the PS? > The rendering quality of the fonts depends on a lot of things. And I think your

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-12 Thread Jae-Joon Lee
ee if turning that on and off make any difference. Regards, -JJ On Tue, Jan 12, 2010 at 5:29 AM, John Reid wrote: > > > Jae-Joon Lee wrote: >> When you check out the svn, please try to apply the patch attached. >> >> patch -p1 < ps_distiller.patch >> >>

Re: [Matplotlib-users] Re using a subplot on two different figures

2010-01-12 Thread Jae-Joon Lee
On Tue, Jan 12, 2010 at 12:21 PM, dugolo wrote: > Basically, I would like to put ax1 on both fig1 and fig2 without having to > repeat all of the code for plots on ax1. > The Axes instances in matplotlib can only have one parent figure, i.e., the axes cannot be shared among different figures. But

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread Jae-Joon Lee
When you check out the svn, please try to apply the patch attached. patch -p1 < ps_distiller.patch I hope this solves your problem. Regards, -JJ On Mon, Jan 11, 2010 at 7:25 PM, Jae-Joon Lee wrote: > On Mon, Jan 11, 2010 at 6:49 PM, John Reid > wrote: >> Thanks for help s

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread Jae-Joon Lee
On Mon, Jan 11, 2010 at 6:49 PM, John Reid wrote: > Thanks for help so far. Any more ideas? I'll try the svn if it is just a > case of checking it out and compiling. > Please try. I don't think the current svn version will make any difference. But, at least I can send you a patch that I think fi

Re: [Matplotlib-users] contour plots with logarithmic axes

2010-01-11 Thread Jae-Joon Lee
Contour will work as expected if the axes is in log scale. See below. z = np.arange(100).reshape((10,10)) x = np.logspace(0, 4, 10) y = np.logspace(0, 4, 10) ax1 = subplot(121) ax1.contour(np.log10(x), np.log10(y), z) ax2 = subplot(122) ax2.set_xscale("log") ax2.set_yscale("log") ax2.contour(x,

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread Jae-Joon Lee
it only doesn't work when I set > ps.usedistiller to xpdf. With False or ghostscript it works ok but gives > me output with different page sizes. AFAIK xpdf is the way to go for > publication quality graphics. Do you know how I can get it to work? Is > it worth trying the svn version? >

Re: [Matplotlib-users] another problem with hardcoded colors

2010-01-11 Thread Jae-Joon Lee
On Mon, Jan 11, 2010 at 2:38 PM, Dominik Szczerba wrote: > Hmmm, that property really deserves its own rc param, but if you do not > like it, it should at least be somewhere automatically set to the > current background color to be resistant against people like me ;) I > would be happy to have suc

Re: [Matplotlib-users] another problem with hardcoded colors

2010-01-11 Thread Jae-Joon Lee
On Sat, Jan 9, 2010 at 4:27 PM, Dominik Szczerba wrote: > When using white over back color scheme the legend() is unreadable, with > apparently hard-coded white legend background - or is there a way to set > it in the rc file? > Unfortunately no. I recommend you to manually change the color of th

Re: [Matplotlib-users] Simple text style question

2010-01-11 Thread Jae-Joon Lee
First of all, to use "\color" with TeX, you need to use "color" package, i.e., you need to modify your latex preamble to include that package. This can be done by import matplotlib.pyplot as plt plt.rcParams["text.latex.preamble"] = r"\usepackage{color}" I guess the error you encounter is because

Re: [Matplotlib-users] Setting Relative Heights For Figure Rows

2010-01-11 Thread Jae-Joon Lee
See this example http://matplotlib.sourceforge.net/examples/pylab_examples/scatter_hist.html Or, you're willing to learn something new, you may use axes_grid toolkit. http://matplotlib.sourceforge.net/examples/axes_grid/scatter_hist.html -JJ ---

Re: [Matplotlib-users] Save eps ghostscript error

2010-01-11 Thread Jae-Joon Lee
You code works okay with the current svn. See if changing the distiller option makes any difference ("ps.usedistiller" in the rc file). The best would be for you to upgrade to the recent release of matplotlib if possible. Regards, -JJ On Mon, Jan 11, 2010 at 8:35 AM, John Reid wrote: > Hi, >

Re: [Matplotlib-users] matplotlib CRASHes when saving as a postscript file

2010-01-09 Thread Jae-Joon Lee
On Sat, Jan 9, 2010 at 8:20 AM, Eric Emsellem wrote: > Hi > thanks A LOT for taking the time to test this and for the suggestions. > > Yes, pcolormesh is needed (or at least I think) because in the "real" > example (the figures I am trying to make) the pixels are rotated meaning > that these are p

Re: [Matplotlib-users] matplotlib CRASHes when saving as a postscript file

2010-01-08 Thread Jae-Joon Lee
I can reproduce this error with the current svn. I doubt if this is a matplotlib issue, because it works fine if the number of axes is small. To me, it seems as some memory error in the ghostscript, but my quick googling did not show any relevant information. So, I hope some postscript expert take

Re: [Matplotlib-users] dividing up subplots?

2010-01-08 Thread Jae-Joon Lee
On Sun, Jan 3, 2010 at 4:30 PM, per freem wrote: > is there a way to do this in matplotlib? With subplots, I believe the answer is no. You may try to fiddle with anchor positions of individual subplots, but this will only work for some limited cases. With axes_grid toolkit, yes. -JJ --

Re: [Matplotlib-users] [matplotib-users] missing legend-entry using twinx()

2010-01-08 Thread Jae-Joon Lee
This is because "legend" creates a legend only in the current axes. Note that "twinx" creates a separate axes. You need to manually specify which plot items to show in the legend. http://matplotlib.sourceforge.net/users/legend_guide.html Or, you may use axes_grid.parasite_axes which does this jo

Re: [Matplotlib-users] Bug in demo_parasite_axes2 example?

2010-01-08 Thread Jae-Joon Lee
What version of matplotlib are you using? This may be the bug that already have been fixed. Neither with the maintenance branch nor the current svn reproduce this problem, as can be easily seen from the gallery http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes2.html -JJ On

Re: [Matplotlib-users] Proper display of histograms with fixed bar widths

2010-01-08 Thread Jae-Joon Lee
On Wed, Jan 6, 2010 at 5:50 AM, Gergely Ungvary wrote: > I guess I'm not > the only one plotting statistical data with manually specified bins. Yes, and mpl works fine with manually specified bins. On the other hand, I don't see why you want to change the widths of the bar. As far as I can see, t

Re: [Matplotlib-users] move annotation

2010-01-08 Thread Jae-Joon Lee
I think the current method names of Annotation class (originally from the Text class) is a bit confusing. And this needs to be fixed. Anyhow, instead of calling set_position method, you need to set the "xytext" attribute directly. this_annotation.xytext = (event.x, event.y) Regards, -JJ

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] Auto adjust subplot params?

2009-12-30 Thread Jae-Joon Lee
http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels -JJ On Wed, Dec 30, 2009 at 6:30 AM, Eero Nevalainen wrote: > Hi, > > I find myself repeatedly manually adjusting subplot params, e.g. > figure.subplot.left, to remove extra white space on my figures. Is

Re: [Matplotlib-users] Problem generating postscript

2009-12-30 Thread Jae-Joon Lee
This is a kind of bug that is quite hard to trace unless we can reproduce the error. As far as I know, there has been a report that matplotlib does not work well with GPL Ghostscript 8.63. And I'm not sure if it is related. http://old.nabble.com/Segmentation-fault-with-EPS-output-on-matplotlib->%

Re: [Matplotlib-users] Colours of histograms?

2009-12-30 Thread Jae-Joon Lee
On Wed, Dec 30, 2009 at 12:05 PM, Eric Emsellem wrote: > I have tried with rgba sequences but no luck there. The help of hist > << color: matplotlib color arg or sequence of rgba tuples >> > Based on my quick look at the code, it seems that the documentation is incorrect. I believe it should be

Re: [Matplotlib-users] Line update: set_data vs recache issue

2009-12-28 Thread Jae-Joon Lee
On Mon, Dec 28, 2009 at 12:39 AM, Eric Firing wrote: > So, which way is better?  I assume the change is an improvement, because >  the behavior with a list should be the same as with an ndarray. > I agree with you. > > We could split the recaching up into parts that can be done independently on

Re: [Matplotlib-users] Line update: set_data vs recache issue

2009-12-27 Thread Jae-Joon Lee
On Sun, Dec 27, 2009 at 7:31 PM, Eric Firing wrote: > I don't understand what your script, below, is intended to do or show. I > haven't run it with mpl prior to my change.  With the change, it simply > draws a single line, or at least that is all I see on the plot. Before your change, it draws t

Re: [Matplotlib-users] Line update: set_data vs recache issue

2009-12-27 Thread Jae-Joon Lee
On Sun, Dec 27, 2009 at 2:37 PM, Eric Firing wrote: > What are the circumstances under which one would call set_data() and not > want or need an update? If you ask me, I'm +1 to update the plot always. But, apparently, the original author of this code wanted to do some checks to avoid unnecessary

Re: [Matplotlib-users] dividing up subplots?

2009-12-26 Thread Jae-Joon Lee
On Thu, Dec 24, 2009 at 3:53 PM, per freem wrote: > i want it to eliminate the second > subplot of the first row and instead make the first subplot on the > first row take up two plots worth of space, Matpltlib's subplot does not support it as of now. There a few work around you may try, but it

Re: [Matplotlib-users] yticks/ylabel on the right

2009-12-24 Thread Jae-Joon Lee
ax = gca() ax.yaxis.set_ticks_position("right") # ticks and ticklabels ax.yaxis.set_label_position("right") # axis label -JJ On Thu, Dec 24, 2009 at 8:34 AM, Maximilian Fabricius wrote: > Hello, > I apologize if this is the n-th time this question is asked. > I wondered what the canonical way i

Re: [Matplotlib-users] python make.py html failure

2009-12-22 Thread Jae-Joon Lee
As far as I can see, this happens when there are obsolete rst files (related with the Gallery I guess), created during the doc. build with previous svn checkout. For example, I recently removed mpl_examples/axes_grid/demo_fixed_size_axes.py from the svn. But if you ever have built the documentatio

Re: [Matplotlib-users] Resizing figure windows?

2009-12-21 Thread Jae-Joon Lee
set_size_inches method takes a "forward" parameter, which adjusts the window size if True, which I believe is what you want. However, according to the documentation, this is only supported in the Gtk and Wx backend. So, easy way would be to switch to other backend if possible. I quickly go through

Re: [Matplotlib-users] Line update: set_data vs recache issue

2009-12-19 Thread Jae-Joon Lee
I just filed a bug related with this. https://sourceforge.net/tracker/?func=detail&aid=2917758&group_id=80706&atid=560720 I think the possible solution could be 1) we keep the copied version of the input data as a cache, and provide a api to access the cache. 2) Or forsce set_[x|y]data to alw

Re: [Matplotlib-users] clabel( CS, manual=True ) / ginput_manual_clabel.py - broken?

2009-12-19 Thread Jae-Joon Lee
I can reproduce this bug with the current svn. Matthias, can you file a bug on this in the issue tracker? I think the bug is related with the changes made back in august. http://old.nabble.com/ginput-default-mouse-configuration-td24924861.html Attached is a quick fix, so please test it. I didn'

Re: [Matplotlib-users] Storing matplotlib figure's image data straightway to SQL Server

2009-12-19 Thread Jae-Joon Lee
On Fri, Dec 18, 2009 at 3:06 AM, Panagiotis Kontaxis wrote: > I found only the figure.savefig() function that saves figure's image only as > a filename in the filesystem and not in a local variable. http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.savefig savefig can take

Re: [Matplotlib-users] simple colorbar question

2009-12-16 Thread Jae-Joon Lee
There is no automatic way (that are implemented in matplotlib) to adjust the location of the colorbar axes to match that of the parent axes. Thus you need to manually do this. The axes_grid toolkit (which is included in 0.99) provide some helper function for it though. Check out the function "demo

Re: [Matplotlib-users] Automatic resizing of colorbar

2009-12-14 Thread Jae-Joon Lee
Yes, axes location in mpl, by design, is specified in normalized figure coordinate. And, for the colorbar axes to match the height (or width) of the parent axes always , you need to manually update the location of the colorbar axes. There are a few ways to do this. You may use event callbacks, use

Re: [Matplotlib-users] AxesGrid: X axis dates and other axis questions.

2009-12-11 Thread Jae-Joon Lee
On Fri, Dec 11, 2009 at 2:34 PM, Ryan Neve wrote: > Thank you for your help. I found the problem. It was caused by using > pyplot.title(). It is working better now. > I next have to figure out how to do the following within AxesGrid: > >1. How to convert the x axis labels from an integer valu

Re: [Matplotlib-users] Right align legend contents

2009-12-08 Thread Jae-Joon Lee
plot([1,2,3], label="Label 1") plot([2,1,3], label="Long Label 2") leg = legend() # swap_and_right_align_legend vp = leg._legend_box._children[-1]._children[0] for c in vp._children: c._children.reverse() vp.align="right" draw() Does this close to waht you want? -JJ On Wed, Dec 9, 2009

Re: [Matplotlib-users] AxesGrid problem.

2009-12-08 Thread Jae-Joon Lee
1241378212 13.1241378212 ..., -- -- --] > ..., > [-- 12.081481385 12.081481385 ..., 10.3037038589 -- --] > [-- 11.0882356451 11.0882356451 ..., 9.95714437393 -- --] > [-- 13.4448273754 13.4448273754 ..., -- -- --]], > mask = > [[ True False False ..., False

Re: [Matplotlib-users] cone plots

2009-12-08 Thread Jae-Joon Lee
but I could not get there. > > Can u pass me the link. > > Cheers Ihab > > On Mon, Dec 7, 2009 at 9:25 PM, Jae-Joon Lee wrote: >> >> I updated the axes_grid toolkit in the svn, and I hope it is more useful. >> >> Check the example >> >> exa

Re: [Matplotlib-users] cone plots

2009-12-07 Thread Jae-Joon Lee
I updated the axes_grid toolkit in the svn, and I hope it is more useful. Check the example examples/axes_grid/demo_floating_axes.py The output is attached. -JJ On Wed, Nov 4, 2009 at 9:19 AM, Jae-Joon Lee wrote: > Are you running svn version of mpl? > Also, as I said, the example is

Re: [Matplotlib-users] AxesGrid problem.

2009-12-04 Thread Jae-Joon Lee
On Fri, Dec 4, 2009 at 2:49 PM, Ryan Neve wrote: > Than you for your assistance with AxesGrid. > > Concerning the documentation, on this page: > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.htmit > says: >Name Default Description aspect True aspect of axes > then

Re: [Matplotlib-users] Rotating X-Labels on AxesGrid?

2009-12-04 Thread Jae-Joon Lee
First of all, unless you're displaying multiple images (with aspect), there is not much of benefit of using axes_grid toolkit. So I strongly recommend you to stick to subplot. axes_grid toolkit uses different kind of artists to draw ticklabels. Therefore, most of the matplotlib command that try

Re: [Matplotlib-users] AxesGrid problem.

2009-12-03 Thread Jae-Joon Lee
some of the labels invisible. Please post a "complete", but simple, script that reproduces your problem. Otherwise, it is hard to track down what is wrong. Also, please report what version of matplotlib you're using. The axes_grid toolkit is relatively new and some of the feature ma

Re: [Matplotlib-users] Plotting curves filled with nonuniform color patch

2009-12-03 Thread Jae-Joon Lee
line 1486 of _backend_agg.cpp says /* TODO: Support clip paths */ So, it seems that, apparently, clipping with arbitrary path has not been implemented yet for gouraud shading (pcolormesh will be properly clipped if shading is not used). I hope Michael pick this up some time soon. Meanwhile, yo

Re: [Matplotlib-users] Cross axis arrows

2009-12-03 Thread Jae-Joon Lee
You need to add the patch to the second axes. patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data', axesA=ax1, axesB=ax2, zorder=100, arrowstyle='fancy', connectionstyle='Angle3', mutation_scale=1

Re: [Matplotlib-users] countour plot custom labels

2009-12-02 Thread Jae-Joon Lee
This would only meaningful if you set contour levels manually. plt.figure() levels = [-1, 0, 1] fmt = {-1.:"-1", 0.:"0", 1.:"+1"} CS = plt.contour(X, Y, Z, levels) plt.clabel(CS, inline=1, fontsize=10, fmt=fmt) Regards, -JJ On Wed, Dec 2, 2009 at 6:32 AM, Momme Butenschön wrote:

Re: [Matplotlib-users] Extending patches.Rectangle class

2009-12-02 Thread Jae-Joon Lee
On Tue, Dec 1, 2009 at 8:48 AM, Jorge Scandaliaris wrote: > How difficult would be to extend the Rectangle class so besides its permimeter > it draws lines showing halfs or thirds of the width and height? It depends on your mileage. However, a patch in matplotlib usually means a closed path. If

Re: [Matplotlib-users] AxesGrid problem.

2009-12-02 Thread Jae-Joon Lee
This happens because, when the AxesGrid is created, gca() is set to the last axes, which is the last colobar axes. If you use axes_grid toolkit, you'd better not use pyplot command that works on axes. Instead, use axes method directly. For example, instead of "pyplot.pcolor(..)" , use "ax.pcolor

Re: [Matplotlib-users] adjusting space between axes label and axes

2009-12-02 Thread Jae-Joon Lee
On Sun, Nov 22, 2009 at 11:16 AM, per freem wrote: > is there an existing parameter that just controls the distance between > the xticks and the label? As you first tried (with your example with axes_grid), labelpad parameter does what you want. plt.xlabel("xlabel", labelpad=0) or ax.xaxis.lab

Re: [Matplotlib-users] gtkagg backend - update behavior question

2009-11-27 Thread Jae-Joon Lee
Maybe this thread is helpful. http://old.nabble.com/Problem-with-simple-use-of-draw%28%29-in-animations-of-arrays-tt26174627.html#a26175190 I guess your code will work simply by calling "recache()" instead of set_ydata. Regards, -JJ On Sat, Nov 28, 2009 at 4:50 AM, Alastair McKinley wrote: >

Re: [Matplotlib-users] markerfacecolor in legend

2009-11-26 Thread Jae-Joon Lee
One option would be to use a proxy artist, an artist with properties you want. http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist Regards, -JJ On Fri, Nov 20, 2009 at 7:01 PM, Zunbeltz Izaola wrote: > Hi, > > I would like to have a different marker facecolor in the

Re: [Matplotlib-users] FancyArrows don't connect

2009-11-18 Thread Jae-Joon Lee
http://matplotlib.sourceforge.net/api/artist_api.html?highlight=fancyarrowpatch#matplotlib.patches.FancyArrowPatch try to set shrinkA and shrinkB to 0. Also see below for how arrows are drawn. http://matplotlib.sourceforge.net/users/annotations_guide.html#annotating-with-arrow -JJ On Thu, Nov

Re: [Matplotlib-users] why doesn't this animation work?

2009-11-14 Thread Jae-Joon Lee
What backend are you using? There was a similar report that the "draw" method of the qt4agg backend does not update the screen immediately but wait until it gets idle. See if using other backends makes any change. -JJ On Sat, Nov 14, 2009 at 3:21 PM, Brian Blais wrote: > Hello, > I was wonde

Re: [Matplotlib-users] changing the xtick/ytick pads for subplots?

2009-11-14 Thread Jae-Joon Lee
What version of matplotlib are you using? With the current svn, your code works okay. -JJ On Fri, Nov 13, 2009 at 10:37 AM, per freem wrote: > hi all, > > i am trying to adjust the space (padding) between the tickmarks on an > axes and the labels. usually, i can do this by setting > 'xtick.majo

Re: [Matplotlib-users] adjusting space between axes label and axes

2009-11-13 Thread Jae-Joon Lee
I think I have said this a few times, but if you're using axes_grid toolkit, it is likely that most of the ticks, ticklabels and axis-related command of the original matplotlib may NOT work. And that is why I recommend you to use the spines instead. Anyhow, adjusting the pad between axis and the

Re: [Matplotlib-users] rasterizing a figure

2009-11-12 Thread Jae-Joon Lee
On Thu, Nov 12, 2009 at 6:32 PM, Geoffrey Ely wrote: > Thanks for the help. With that I get: > > AttributeError: 'function' object has no attribute '__buffer__' > > shape = fig.canvas.get_width_height()[::-1] + (4,) im = np.frombuffer(fig.canvas.buffer_rgba(0,0), dtype=np.uint

Re: [Matplotlib-users] bug in set_yscale of bar graphs?

2009-11-12 Thread Jae-Joon Lee
On Thu, Nov 12, 2009 at 12:07 PM, per freem wrote: > ax.axis["xzero"].set_visible(True) > # make other axis (bottom, top, right) invisible. The ax.axis["xzero"] is drawn along the y=0 line. Therefore, if you use logscale, this axis become invisible. > invisible = ["bottom", "top", "right"] > for

Re: [Matplotlib-users] bug in set_yscale of bar graphs?

2009-11-11 Thread Jae-Joon Lee
The bar command makes rectangles whose bottom position is 0. The reason that bars disappear when you set log scale is that bottom position of the bar become -infinity. You may * set log scale before calling the bar or * create bar plot but with reasonable (positive) bottom value. Take a look

Re: [Matplotlib-users] differnet colormaps with pcolormesh

2009-11-11 Thread Jae-Joon Lee
I'm not exactly sure what you're trying to do. but I think what you want can be easily achieved by simply using the masked array. Is the example below similar to what you need? a = np.arange(100).reshape((10,10)) m1 = np.triu(a, 1) > 0 m2 = np.tril(a, -1) > 0 #m2 = ~m1 am1 = np.ma.array(a, mask=

Re: [Matplotlib-users] axes_grid divider with room for axis

2009-11-09 Thread Jae-Joon Lee
On Mon, Nov 9, 2009 at 6:03 PM, Brent Pedersen wrote: > how can i have the divider account for the room needed > for the > labels and ticks? Doing this automatically is not straight forward. So you need to manually adjust the area occupied by the axes. Note that rect is [left, bottom, width, heig

Re: [Matplotlib-users] add_axes in inches

2009-11-09 Thread Jae-Joon Lee
On Thu, Nov 5, 2009 at 2:31 PM, Thomas Robitaille wrote: > Is there an easy way to add axes to a figure, but specify the 'rect' > in real rather than relative units? For example, something like: > unfortunately no. And I'm not sure if matplotlib will ever going to support it internally. However,

Re: [Matplotlib-users] cone plots

2009-11-04 Thread Jae-Joon Lee
lly great. > > I can then fine tune it to my needs. > > Thanks Ihab > > Jae-Joon Lee wrote: >> >> Unfortunately, I don't think something like cone plots can be easily >> done with current matplotlib. >> >> I guess you can define custom projection

Re: [Matplotlib-users] Legend fails to make sample symbols for legends outside of the plot area

2009-11-04 Thread Jae-Joon Lee
On Wed, Nov 4, 2009 at 12:00 AM, Greg Novak wrote: > Is this the intended behavior?  How can I get complete sample lines > when the legend lies outside the plot area? No, this is not intended. It seems to me that wrong clip path is set for those legend handles. However, your code works fine with

Re: [Matplotlib-users] cone plots

2009-11-02 Thread Jae-Joon Lee
Unfortunately, I don't think something like cone plots can be easily done with current matplotlib. I guess you can define custom projection and such, as in the example below http://matplotlib.sourceforge.net/examples/api/custom_projection_example.html but this will involve some (maybe a lot) cod

Re: [Matplotlib-users] Problem with simple use of draw() in animations of arrays

2009-11-02 Thread Jae-Joon Lee
On Mon, Nov 2, 2009 at 10:52 PM, David Sanders wrote: > from pylab import * > > ion() > > N = 1000 > pos = zeros((N,2)) > > figure(figsize=(8,8)) > points, = plot(pos[:,0], pos[:,1], ',') > axis([-20,20,-20,20]) > > for t in range(1000): > >     pos += uniform(-1,1,N*2).reshape(N,2) >     points.s

Re: [Matplotlib-users] Text annotation misaligned with png backend.

2009-10-30 Thread Jae-Joon Lee
I don't see such problem in my installations. I may be wrong but It seems to me that it is a font issue (I believe you're not using usetex mode). Can you try to use other fonts? For example, my current installation picks up the following font (Vera Serif?). In [10]: matplotlib.font_manager.findf

Re: [Matplotlib-users] spines are tricky!

2009-10-28 Thread Jae-Joon Lee
ecessary to modify anything else. # Dr. Phillip M. Feldman, 27 Oct, 2009 # Acknowledgment: This program is based on code written by Jae-Joon Lee, # URL= http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/ # examples/pylab_examples/multiple_yaxis_with_spines.py?revisio

Re: [Matplotlib-users] spines are tricky!

2009-10-28 Thread Jae-Joon Lee
On Tue, Oct 27, 2009 at 11:12 PM, Dr. Phillip M. Feldman wrote: > (1) Not only is the y-axis for dependent variable #1 blue (as it should be), > but the entire frame around the plot is blue. > at line 158, you're changing the color of all spines. Change the color of spine that you only want to ch

Re: [Matplotlib-users] Axis problem demo program

2009-10-28 Thread Jae-Joon Lee
On Wed, Oct 28, 2009 at 9:55 AM, Michael Droettboom wrote: > Does anyone with more experience with the scientific notation/offset > code have any further comments? While it is possible to turn off using the offset (or setting it manually), the api is not very friendly. fmt = gca().xaxis.get_majo

Re: [Matplotlib-users] drawing arrows

2009-10-26 Thread Jae-Joon Lee
The only case I can think of now is that the two points are too close (with in a few points). This could happen during the "shrink", or during the "mutate" (http://matplotlib.sourceforge.net/users/annotations_guide.html#annotating-with-arrow). But it would be great if you can pinpoint this down and

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

2009-10-26 Thread Jae-Joon Lee
On Sun, Oct 25, 2009 at 7:30 PM, George Nurser wrote: > it seems a pity that > fig.add_axes can't accept the transform directly. While this is certainly possible, but it is a bit tricky to get it correct due to the underlying design of the matplotlib. On the other hand, I think it solves some pro

Re: [Matplotlib-users] Movable Legend

2009-10-26 Thread Jae-Joon Lee
This is a known bug. While this is fixed in the svn, this did go into the maint. branch. As a workaround, add the following line after line 70. self.legend.set_axes(self.subplot) Regards, -JJ On Mon, Oct 26, 2009 at 9:44 AM, Andrea Gavana wrote: > Hi All, > >    a while ago, Che poste

Re: [Matplotlib-users] Possible to get four y axes on a single plot?

2009-10-25 Thread Jae-Joon Lee
Using axes_grid toolkit is not recommended unless you're familiar with some of the internals of matplotlib. Instead, you should use spines. While the current example gallery does not have such an example, I just added one in the svn. The result should be identical to the axes_grid example. While no

Re: [Matplotlib-users] Extraneous line drawn using pyplot

2009-10-23 Thread Jae-Joon Lee
Your data repeat itself twice. Please check your data and report back if you still see the problem. Regards, -JJ On Fri, Oct 23, 2009 at 3:58 PM, Jeremy Conlin wrote: > Hello list.  I am having trouble with an extraneous line drawn from my > last data point back to the first data point.  I I d

Re: [Matplotlib-users] zap symbols

2009-10-23 Thread Jae-Joon Lee
If that symbol is included in any of the font (I don't know of any), you can simply use them. Or, you need to create your own path. There are a few ways to do it, and I guess using scatter is one of the easiest. zap0 = [[-1.,0.], [-0.5, 0.5], [0.,0.], [0.5,-0.5],[1.,0.]] zap = zap0 + zap0[-

Re: [Matplotlib-users] How to rotate label on a twin axes

2009-10-23 Thread Jae-Joon Lee
The below line is supposed to work but it does not, which is a bug. pary.axis["right"].label.set_rotation(270) Meanwhile, use may use something like below, pary.axis["right"].get_helper()._label_angles["right"]=270 Regards, -JJ On Fri, Oct 23, 2009 at 2:13 PM, Gökhan Sever wrote: > Hel

Re: [Matplotlib-users] fill_between, legends, and "label" parameter

2009-10-23 Thread Jae-Joon Lee
I think you misunderstood what I meant by proxy artist (I'm not sure if this is a right choice of the word, as a matter of fact). Again, PolyCollection instance that is returned by fill_between is not supported by legend. Therefore, you have to use other kind of artist (which I call proxy artist)

Re: [Matplotlib-users] Setting Figure = Figure possible?

2009-10-22 Thread Jae-Joon Lee
I guess you need to update the canvas itself, but there could be more things to do. My recommendation is not to switch figure, but to switch axes (or just contours). You may create several axes in a same figure and make them invisible (or temporarily remove them from the figure) except the one you

Re: [Matplotlib-users] fill_between, legends, and "label" parameter

2009-10-22 Thread Jae-Joon Lee
> Why is that? "fill" creates Patches (http://matplotlib.sourceforge.net/api/artist_api.html?highlight=patch#matplotlib.patches.Patch) but fill_between creates PolyCollection (http://matplotlib.sourceforge.net/api/collections_api.html?highlight=polycollection#matplotlib.collections.PolyCollection)

Re: [Matplotlib-users] error bar line width in bar function, cap width in errorbar function

2009-10-22 Thread Jae-Joon Lee
On Thu, Oct 22, 2009 at 8:59 AM, Johan Carlin wrote: > 1. Is there a way to change error bar line width directly with the bar > function? Maybe not. It seems that the "bar" function currently does not return errorbar-related artists. You can find them by looking through axes.lines and axes.colle

Re: [Matplotlib-users] What about providing a chm version of the API

2009-10-22 Thread Jae-Joon Lee
I recommend you to open a feature request ticket on the sourceforge site. http://sourceforge.net/tracker/?atid=560723&group_id=80706&func=browse This is more like an sphinx issue than matplotlib one, and it seems that sphinx have some support for chm format. So I guess this could be done quite ea

Re: [Matplotlib-users] Colorbar with labels on top

2009-10-21 Thread Jae-Joon Lee
The api related to ticks and ticklabels is a bit confusing, at least for me. So, often, it seems best to directly change the tick properties. for t in axcbar.xaxis.get_major_ticks(): t.tick1On = True t.tick2On = True t.label1On = False t.label2On = True -JJ On Wed, Oct 21, 2009

Re: [Matplotlib-users] Problem when specifying formatter

2009-10-20 Thread Jae-Joon Lee
On Tue, Oct 20, 2009 at 4:43 PM, Thomas Robitaille wrote: > ax.xaxis.set_major_formatter(NullFormatter) http://matplotlib.sourceforge.net/api/axis_api.html?highlight=set_major_formatter#matplotlib.axis.Axis.set_major_formatter An instance of NullFormatter is needed, instead of the class itself.

Re: [Matplotlib-users] drawing points on simplex?

2009-10-20 Thread Jae-Joon Lee
http://www.nabble.com/Re%3A-Three-Phase-Diagrams-with-matplotlib-p25122618.html Maybe this is close to what you want? -JJ On Sun, Oct 18, 2009 at 8:23 PM, per freem wrote: > hi all, > > i would like to draw points on the 3-d simplex, like that of a > dirichlet distribution with 3 parameters.

Re: [Matplotlib-users] bar plot errorbars

2009-10-19 Thread Jae-Joon Lee
It seems that this is not possible with bar or barh. I guess the best way is to use a separate errorbar comannd import matplotlib.pyplot as plt import numpy as np val = 3+10*np.random.rand(5)# the bar lengths pos = np.arange(5)+.5# the bar centers on the y axis yerr = np.random.rand(5) p

Re: [Matplotlib-users] _legmarker attribute error in in legend using vlines

2009-10-16 Thread Jae-Joon Lee
I guess this is a known bug and already fixed. Maybe ubuntu 9.4 sheeps with the older version though (the bug was fixed in this January, so, I'm not sure). http://www.nabble.com/unable-to-create-legend-for-vlines-graph-td21707558.html#a21707558 You may try to install the latest version. Or you ma

Re: [Matplotlib-users] Log scale for horizontal bar chart (2 bugs)

2009-10-15 Thread Jae-Joon Lee
barh takes an optional argument "log". set this True (or you may set "left" with some meaningful value, other than 0) http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.barh -JJ On Wed, Oct 14, 2009 at 4:30 PM, Donovan Parks wrote: > Hello, > > I've encountered two bugs r

<    1   2   3   4   5   6   7   8   9   >