Re: [Matplotlib-users] Legend frame edgecolor and linewidth

2015-11-18 Thread Daniele Nicolodi
Hello, after looking at the code I found that there are two settings that are not documented (they are not in the template matplotlibrc) that control the legend frame: "legend.edgecolor" and "legend.facecolor". The first is enough for my needs, however I think it would be nice to add the possibil

Re: [Matplotlib-users] Legend frame edgecolor and linewidth

2015-11-13 Thread Benjamin Root
Indeed, it looks like there isn't a very good way to control all of the properties of the frame portion of a legend. This could certainly use some improvements, partly in allowing a dictionary of property values to be passed in `plt.legend()` (there is already a dictionary of font properties), but

[Matplotlib-users] Legend frame edgecolor and linewidth

2015-11-13 Thread Daniele Nicolodi
Hello, there is a way to control the edgecolor and the linewidth of the frame drawn around the legend? I set the axes linewidth to 0.5 but the legend frame linewidth is set to 1.0 and it does not look nice. Also, most of the time I don't want the frame edge to be drawn at all. Always doing: l

[Matplotlib-users] legend--plot obj association

2015-10-11 Thread Nico Schlömer
Hi everyone, Given a legend [1], I'm trying to figure out which plot objects it references. Is this possible at all? The reverse would also be fine, i.e., given a plot object (e.g., a line), find the legend(s) in which it is referenced. Cheers, Nico [1] http://matplotlib.org/api/legend_api.html

[Matplotlib-users] Legend cut off figure

2015-05-22 Thread njs
I've tried several methods on stackoverflow (http://stackoverflow.com/questions/10101700/moving-matplotlib-legend-outside-of-the-axis-makes-it-cutoff-by-the-figure-box) and I'm still seeing issues with matplotlib cutting off my legend. The figure and code are posted below, note that I am using f

Re: [Matplotlib-users] legend issue while embedding fonts in eps figure

2013-11-26 Thread Grigoris Maravelias
Thanks to this post ( http://nerdjusttyped.blogspot.gr/2010/07/type-1-fonts-and-matplotlib-figures.html) I used the rcParams['text.usetex'] = True (after installing dvipng) and the final plot had only Type 1 fonts. Grigoris On 11/23/2013 02:21 PM, Grigoris Maravelias wrote: > Hello! > > I am cr

[Matplotlib-users] legend issue while embedding fonts in eps figure

2013-11-23 Thread Grigoris Maravelias
Hello! I am creating a plot and I select the font type to be TrueType (by using rcParams['ps.fonttype'] = 42). I am using this image later on in a tex file and when I am creating the pdf file I check for the font types and I see name type emb sub uni

[Matplotlib-users] legend and text

2013-05-24 Thread Sudheer Joseph
Dear users,              I was trying to figure out 2 things for my below script.  1) How do I put a correct legend in below plot for both the bar and line? Also if I wanted add another set of bars(for comparison) side by side with a different color is ut possible with proper legend? 2) Is there

Re: [Matplotlib-users] legend marker update problem

2013-05-21 Thread Gregorio Bastardo
Thanks, I opened an issue for it: https://github.com/matplotlib/matplotlib/issues/2035 2013/5/17 Sterling Smith : > Gregorio, > > I'm glad that helped. I have not reported it on the issue tracker, but your > case certainly has more of a bug with it (where it works sometimes, but not > always),

Re: [Matplotlib-users] legend marker update problem

2013-05-17 Thread Sterling Smith
Gregorio, I'm glad that helped. I have not reported it on the issue tracker, but your case certainly has more of a bug with it (where it works sometimes, but not always), so I would recommend it. -Sterling On May 17, 2013, at 2:10AM, Gregorio Bastardo wrote: > Hi Sterling, > > Thanks for

Re: [Matplotlib-users] legend marker update problem

2013-05-17 Thread Gregorio Bastardo
Hi Sterling, Thanks for the hint, using "line._legmarker" attribute solved the problem. I see the reason behind, however I still consider this as an incorrect behaviour, since marker toggling works in case the line is originally added to the legend without marker (so legend line and marker do not

Re: [Matplotlib-users] legend marker update problem

2013-05-16 Thread Sterling Smith
Gregorio, I experienced a similar issue with trying to change the marker color. See below the previous response from JJ for accessing the legend marker or using a proxy artist. -Sterling > On Sep 4, 2012, at 5:33PM, Jae-Joon Lee wrote: > > On Wed, Sep 5, 2012 at 6:05 AM, Sterling Smith wro

[Matplotlib-users] legend marker update problem

2013-05-16 Thread Gregorio Bastardo
Hi, I've recently come accross an issue when working on an interactive marker toggling callback. The problem is illustrated below: import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) line, = ax.plot(range(10), range(10)) # uncomment next line to reproduce bug # line.set_m

Re: [Matplotlib-users] legend on a plot with broken_barh()

2013-01-04 Thread gsal
Great, thank you very much...that did the trick. I don't know why broken_barh does not come in the legend, either; maybe is because of the ambiguity as to which color to use in the legend...a single broken barh command can have several bars with different colors. gsal -- View this message in

Re: [Matplotlib-users] legend on a plot with broken_barh()

2013-01-04 Thread Paul Hobson
[Forgot to reply-all, sorry for the dup, gsal] On Fri, Jan 4, 2013 at 1:22 PM, gsal wrote: > can you provide an example? The reference help is only two lines! > > Given: > [code] > import numpy as np > import matplotlib.pyplot as plt > > fig = plt.figure() > ax = fig.add_subplot(111) > ax.broken

Re: [Matplotlib-users] legend on a plot with broken_barh()

2013-01-04 Thread gsal
can you provide an example? The reference help is only two lines! Given: [code] import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.broken_barh([ (110, 30), (150, 10) ] , (10, 9), facecolors='b', label='barh') ax.set_xlim((0,200)) ax.set_ylim((0,5

Re: [Matplotlib-users] legend on a plot with broken_barh()

2013-01-04 Thread Paul Hobson
On Fri, Jan 4, 2013 at 8:41 AM, gsal wrote: > So, it looks like broken_barh's do not show up on the legend...is there > work > around for this? > > Or, > > Is there a way to fake a legend? A way to set legend to whatever I want? > > Thanks, > > gsal > > To fake a legend, try using so-called proxy

[Matplotlib-users] legend on a plot with broken_barh()

2013-01-04 Thread gsal
So, it looks like broken_barh's do not show up on the legend...is there work around for this? Or, Is there a way to fake a legend? A way to set legend to whatever I want? Thanks, gsal -- View this message in context: http://matplotlib.1069221.n5.nabble.com/legend-on-a-plot-with-broken-barh

Re: [Matplotlib-users] legend(loc='best') not so great

2012-09-12 Thread Damon McDougall
On Wed, Sep 12, 2012 at 5:57 PM, Aronne Merrelli wrote: > On Tue, Sep 11, 2012 at 10:49 AM, Damon McDougall > wrote: >> On Tue, Sep 11, 2012 at 3:34 PM, Neal Becker wrote: >>> OK, I've attached my sanitized example >>> >> >> ImportError: No module named pandas. >> >> Can you provide an example t

Re: [Matplotlib-users] legend(loc='best') not so great

2012-09-12 Thread Aronne Merrelli
On Tue, Sep 11, 2012 at 10:49 AM, Damon McDougall wrote: > On Tue, Sep 11, 2012 at 3:34 PM, Neal Becker wrote: >> OK, I've attached my sanitized example >> > > ImportError: No module named pandas. > > Can you provide an example that doesn't depend on pandas? > I was playing with this example to

Re: [Matplotlib-users] legend(loc='best') not so great

2012-09-11 Thread Damon McDougall
On Tue, Sep 11, 2012 at 3:34 PM, Neal Becker wrote: > OK, I've attached my sanitized example > ImportError: No module named pandas. Can you provide an example that doesn't depend on pandas? > Benjamin Root wrote: > >> On Tue, Sep 11, 2012 at 9:29 AM, Neal Becker >> wrote: >> >>> I tried a scat

Re: [Matplotlib-users] legend(loc='best') not so great

2012-09-11 Thread Neal Becker
OK, I've attached my sanitized example Benjamin Root wrote: > On Tue, Sep 11, 2012 at 9:29 AM, Neal Becker > wrote: > >> I tried a scatterplot with legend(loc='best'), but the legend >> appears on the upper right, covering a data point. There is nothing >> anywhere >> in the graph on the upper

Re: [Matplotlib-users] legend(loc='best') not so great

2012-09-11 Thread Benjamin Root
On Tue, Sep 11, 2012 at 9:29 AM, Neal Becker wrote: > I tried a scatterplot with legend(loc='best'), but the legend > appears on the upper right, covering a data point. There is nothing > anywhere > in the graph on the upper left, which is where 'best' should go. > > A small, self-contained exam

[Matplotlib-users] legend(loc='best') not so great

2012-09-11 Thread Neal Becker
I tried a scatterplot with legend(loc='best'), but the legend appears on the upper right, covering a data point. There is nothing anywhere in the graph on the upper left, which is where 'best' should go. -- Live Security

Re: [Matplotlib-users] Legend Marker Color Bug

2012-09-05 Thread Sterling Smith
On Sep 4, 2012, at 5:33PM, Jae-Joon Lee wrote: > On Wed, Sep 5, 2012 at 6:05 AM, Sterling Smith wrote: >> I still do not get black markers. Furthermore, if you try to make a new >> legend with the result of leg.get_lines(), you will get lines without >> markers, which leads me to the conclusio

Re: [Matplotlib-users] Legend Marker Color Bug

2012-09-04 Thread Jae-Joon Lee
On Wed, Sep 5, 2012 at 6:05 AM, Sterling Smith wrote: > I still do not get black markers. Furthermore, if you try to make a new > legend with the result of leg.get_lines(), you will get lines without > markers, which leads me to the conclusion I stated in my previous email > (which you did not

Re: [Matplotlib-users] Legend Marker Color Bug

2012-09-04 Thread Sterling Smith
On Aug 31, 2012, at 11:29AM, Goyo wrote: > 2012/8/30 Sterling Smith : > >> Thank you for taking the time to consider my question. I'm sorry that I >> didn't pose my question correctly. I should have said: 'Consider the >> _results_ of the following script:' I originally tried to attach the

Re: [Matplotlib-users] Legend Marker Color Bug

2012-08-31 Thread Goyo
2012/8/30 Sterling Smith : > Thank you for taking the time to consider my question. I'm sorry that I > didn't pose my question correctly. I should have said: 'Consider the > _results_ of the following script:' I originally tried to attach the results > I obtained, which showed no change in c

Re: [Matplotlib-users] Legend Marker Color Bug

2012-08-30 Thread Sterling Smith
On Aug 30, 2012, at 12:35PM, Benjamin Root wrote: > > > On Thu, Aug 30, 2012 at 3:26 PM, Goyo wrote: > 2012/8/28 Sterling Smith : > > List, > > > > Consider the following script: > > > > import pylab > > pylab.plot(pylab.linspace(0,1,100),label='Test',marker='o',ls='') > > pylab.plot(pylab.lin

Re: [Matplotlib-users] Legend Marker Color Bug

2012-08-30 Thread Benjamin Root
On Thu, Aug 30, 2012 at 3:26 PM, Goyo wrote: > 2012/8/28 Sterling Smith : > > List, > > > > Consider the following script: > > > > import pylab > > pylab.plot(pylab.linspace(0,1,100),label='Test',marker='o',ls='') > > pylab.plot(pylab.linspace(0,1,100),label='Test2',marker='o',ls='-') > > leg=pyl

Re: [Matplotlib-users] Legend Marker Color Bug

2012-08-30 Thread Goyo
2012/8/28 Sterling Smith : > List, > > Consider the following script: > > import pylab > pylab.plot(pylab.linspace(0,1,100),label='Test',marker='o',ls='') > pylab.plot(pylab.linspace(0,1,100),label='Test2',marker='o',ls='-') > leg=pylab.legend(loc='best') > line=leg.get_lines() > line[0].set_color(

[Matplotlib-users] Legend Marker Color Bug

2012-08-28 Thread Sterling Smith
List, Consider the following script: import pylab pylab.plot(pylab.linspace(0,1,100),label='Test',marker='o',ls='') pylab.plot(pylab.linspace(0,1,100),label='Test2',marker='o',ls='-') leg=pylab.legend(loc='best') line=leg.get_lines() line[0].set_color('black') line[1].set_color('black') pylab.dra

[Matplotlib-users] Legend frameon and tight bounding boxes

2012-08-19 Thread Freddie Witherden
Hello, With matplotlib 1.1.1 on Gentoo I have been observing some strange behaviour relating to ax.legend(frameon=False) and print_figure(bbox_inches='tight'): from matplotlib.figure import Figure from matplotlib.artist import setp from matplotlib.backends.backend_cairo import FigureCanvasCairo i

Re: [Matplotlib-users] legend label for fill_between (or similar)

2012-06-21 Thread Andre' Walker-Loud
Hi Tony, > Unfortunately, I think the preferred method is to create a proxy artist: > > http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist > > Basically, you draw a fake patch with the same parameters as your fill (see > example below). > > Hope that helps, Yes, that

Re: [Matplotlib-users] legend label for fill_between (or similar)

2012-06-21 Thread Tony Yu
On Thu, Jun 21, 2012 at 4:09 PM, Andre' Walker-Loud wrote: > Hi All, > > Sometimes, instead of using data points with error bars, I instead use > fill_between to create a little bar, with a band which I use alpha=.3 or so. > > I have tried unsuccessfully to find an easy way to create a legend labe

[Matplotlib-users] legend label for fill_between (or similar)

2012-06-21 Thread Andre' Walker-Loud
Hi All, Sometimes, instead of using data points with error bars, I instead use fill_between to create a little bar, with a band which I use alpha=.3 or so. I have tried unsuccessfully to find an easy way to create a legend label for this band - I am trying to have a similar band appear in my le

Re: [Matplotlib-users] legend not draggable when secondary y-axis present

2012-02-05 Thread gsal
Yeap, that did the trick. Thanks. -- View this message in context: http://old.nabble.com/legend-not-draggable-when-secondary-y-axis-present-tp33163397p33266687.html Sent from the matplotlib - users mailing list archive at Nabble.com. ---

Re: [Matplotlib-users] legend not draggable when secondary y-axis present

2012-02-05 Thread Jae-Joon Lee
For the legend to be picked by mouse, it must be placed in the top most axes. ax = subplot(111) l1, = ax.plot([1,3,2]) ax2 = ax.twinx() lab = ax2.legend([l1], ["test"]) I hope this clarifies your issue. If not, please post a simple but complete example that demonstrates your problem. Regards, -

[Matplotlib-users] legend not draggable when secondary y-axis present

2012-01-18 Thread German Salazar
Any ideas? Also, as in the example here, the legend seems to be behind the quantity being plotted against the one of the secondary y-axisdoes this have anything to do with that?...it is that maybe the le

[Matplotlib-users] legend not draggable when secondary y-axis present

2012-01-18 Thread gsal
Any ideas? Also, as in the example http://matplotlib.sourceforge.net/examples/pylab_examples/multiple_yaxis_with_spines.html here , the legend seems to be behind the quantity being plotted against the one of the secondary y-axisdoes this have anything to do with that?...it is that maybe the

Re: [Matplotlib-users] legend border, frameon keyword

2011-11-11 Thread Paul Ivanov
On Fri, Nov 11, 2011 at 12:40 PM, magurling wrote: > I updated matplotlib to 1.1.0; both methods work now. Thanks for letting us know, and glad it works for you now - that information is useful for those who search for similar error messages in the future and find this thread. > I would say "Tha

Re: [Matplotlib-users] legend border, frameon keyword

2011-11-11 Thread magurling
I updated matplotlib to 1.1.0; both methods work now. I would say "Thanks Paul and Francesco" but I just read the mailing list etiquette. -- View this message in context: http://old.nabble.com/legend-border%2C-frameon-keyword-tp32807933p32828355.html Sent from the matplotlib - users mailing list

Re: [Matplotlib-users] legend border, frameon keyword

2011-11-11 Thread Paul Ivanov
>> On Fri, Nov 11, 2011 at 8:53 AM, Paul Ivanov wrote: >>> might you be on an old matplotlib.__version__? On Fri, Nov 11, 2011 at 11:18 AM, magurling wrote: > This is probably it. I installed by "apt-get install" but keep getting > version 0.99.3 installed. > I need to install a more recent vers

Re: [Matplotlib-users] legend border, frameon keyword

2011-11-11 Thread magurling
This is probably it. I installed by "apt-get install" but keep getting version 0.99.3 installed. I need to install a more recent version before I trouble anyone further. Which version are you using Paul? Paul Ivanov wrote: > > Oops, didn't reply to list last time: > > On Fri, Nov 11, 2011 at 8

Re: [Matplotlib-users] legend border, frameon keyword

2011-11-11 Thread magurling
Thanks Francesco, but I've also tried to use the "draw_frame(False)" method with no luck. montefra wrote: > > Hi, > > I usually do like this > > l = ax.legend( (rects1[0], rects2[0]), ('set1', 'set2')) > l.draw_frame(False) > > Cheers, > > Francesco > > 2011/11/9 magurling : >> >> I want a

Re: [Matplotlib-users] legend border, frameon keyword

2011-11-11 Thread Paul Ivanov
Oops, didn't reply to list last time: On Fri, Nov 11, 2011 at 8:53 AM, Paul Ivanov wrote: > On Tue, Nov 8, 2011 at 4:49 PM, magurling wrote: >> >> I want a legend without the black border. I've tried a few things that have >> been suggested on this forum and elsewhere to no avail. According to w

Re: [Matplotlib-users] legend border, frameon keyword

2011-11-11 Thread Francesco Montesano
Hi, I usually do like this l = ax.legend( (rects1[0], rects2[0]), ('set1', 'set2')) l.draw_frame(False) Cheers, Francesco 2011/11/9 magurling : > > I want a legend without the black border. I've tried a few things that have > been suggested on this forum and elsewhere to no avail. According to

[Matplotlib-users] legend border, frameon keyword

2011-11-11 Thread magurling
I want a legend without the black border. I've tried a few things that have been suggested on this forum and elsewhere to no avail. According to what I've seen, it should be as simple as: import matplotlib.pyplot as plt import numpy as np N = 5 Means1 = (20, 35, 30, 35, 27) Means2 = (25, 32, 34,

[Matplotlib-users] legend with proxy artists

2011-11-09 Thread Richard Ree
Hi, I read the legend guide, so when I did this: ax.legend([Circle((0,0),1,fc='red')], ['red circle']) I expected the symbol in the legend to be a red circle, but got a red rectangle. In fact, no matter what artists I pass in as the first argument, the legend shows rectangles (the colors are co

Re: [Matplotlib-users] Legend and proxy artists

2011-10-28 Thread John Hunter
On Thu, Oct 27, 2011 at 8:12 AM, Adam Mercer wrote: > Hi > > I have recently updated to Matplotlib-1.1.0 and now one of my scripts > displays the following warning: > > UserWarning: Legend does not support [[ at 0x1026296d0>]] > Use proxy artist instead. > > http://matplotlib.sourceforge.net/users

Re: [Matplotlib-users] Legend and proxy artists

2011-10-27 Thread Adam Mercer
On Fri, Oct 28, 2011 at 00:56, Sterling Smith wrote: > Here is a working example: > > from pylab import figure, arange > fig = figure(1) > fig.clear() > ax = fig.add_subplot(111) > x = arange(0,1,.25) > y1 = x > y2 = x**2 > y3 = x**3 > l1 = ax.plot(x,y1,'bo-') > l2 = ax.plot(x,y2,'go-') > l3 = []

Re: [Matplotlib-users] Legend and proxy artists

2011-10-27 Thread Sterling Smith
Adam, I'm sorry that I wasn't clear before. Here is a working example: from pylab import figure, arange fig = figure(1) fig.clear() ax = fig.add_subplot(111) x = arange(0,1,.25) y1 = x y2 = x**2 y3 = x**3 l1 = ax.plot(x,y1,'bo-') l2 = ax.plot(x,y2,'go-') l3 = [] for xi,x1 in enumerate(x): l3.a

Re: [Matplotlib-users] Legend and proxy artists

2011-10-27 Thread Adam Mercer
On Thu, Oct 27, 2011 at 12:05, Sterling Smith wrote: > Your example is not complete.  I don't understand the value variable that you > are iterating over, or how it affects the different plots you are making. value is simply a list of different datasets to plot, read in using: value = [] for v

Re: [Matplotlib-users] Legend and proxy artists

2011-10-27 Thread Sterling Smith
gests. > > > From: Adam Mercer > Date: October 27, 2011 6:12:50 AM PDT > To: matplotlib-users@lists.sourceforge.net > Subject: [Matplotlib-users] Legend and proxy artists > > > Hi > > I have recently updated to Matplotlib-1.1.0 and now one of my sc

[Matplotlib-users] Legend and proxy artists

2011-10-27 Thread Adam Mercer
Hi I have recently updated to Matplotlib-1.1.0 and now one of my scripts displays the following warning: UserWarning: Legend does not support [[]] Use proxy artist instead. http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist The link it refers to doesn't seem to be much

Re: [Matplotlib-users] Legend for stacked histogram?

2011-06-30 Thread Russell E. Owen
In article , "Russell E. Owen" wrote: > I am trying to make a legend for a stacked histogram using matplotlib > 1.0.1 and it's not working. > > Here's what I've tried so far: > > count, bins, ignored = pyplot.hist( > (matchedStarPsfMags, unmatchedRefStarPsfMags, > unmatc

[Matplotlib-users] Legend for stacked histogram?

2011-06-30 Thread Russell E. Owen
I am trying to make a legend for a stacked histogram using matplotlib 1.0.1 and it's not working. Here's what I've tried so far: count, bins, ignored = pyplot.hist( (matchedStarPsfMags, unmatchedRefStarPsfMags, unmatchedSourcePsfMags), bins=30, histtype='barstacked'

Re: [Matplotlib-users] legend font weight with TeX

2011-04-05 Thread Eli Brosh
Thanks, label=r'$\bf{label1}$' worked. Regards, Eli On Tue, Apr 5, 2011 at 10:14 PM, Darren Dale wrote: > On Tue, Apr 5, 2011 at 2:51 PM, Eli Brosh wrote: > > Hello, > > > > I am using pylab with the rc parameter > > rcParams['text.usetex']=True > > > > Now, I would like to make a legend with

Re: [Matplotlib-users] legend font weight with TeX

2011-04-05 Thread Darren Dale
On Tue, Apr 5, 2011 at 2:51 PM, Eli Brosh wrote: > Hello, > > I am using pylab with the rc parameter > rcParams['text.usetex']=True > > Now, I would like to make a legend with bold fonts. > So, I tried two options: > > 1) > from matplotlib.font_manager import fontManager, FontProperties > font= Fo

[Matplotlib-users] legend font weight with TeX

2011-04-05 Thread Eli Brosh
Hello, I am using pylab with the rc parameter rcParams['text.usetex']=True Now, I would like to make a legend with bold fonts. So, I tried two options: 1) from matplotlib.font_manager import fontManager, FontProperties font= FontProperties(weight='bold',size=26) plot([1,2,3],[1,2,3],'k',label='l

Re: [Matplotlib-users] Legend outside the plot

2011-03-08 Thread Yuri D'Elia
On Tue, 8 Mar 2011 02:35:52 +0900 Jae-Joon Lee wrote: > On Mon, Mar 7, 2011 at 8:22 PM, Yuri D'Elia wrote: > > With matplotlib, I have to do the following: > > > > legend(bbox_to_anchor=(1, 1 + ?), loc=2) > > > > but how do I calculate the vertical location? > > Maybe you want to try something

Re: [Matplotlib-users] Legend outside the plot

2011-03-07 Thread Jae-Joon Lee
On Mon, Mar 7, 2011 at 8:22 PM, Yuri D'Elia wrote: > With matplotlib, I have to do the following: > > legend(bbox_to_anchor=(1, 1 + ?), loc=2) > > but how do I calculate the vertical location? Maybe you want to try something like leg = legend([l1], ["Test"], borderaxespad=0, bbox_to

Re: [Matplotlib-users] Legend outside the plot

2011-03-07 Thread Yuri D'Elia
On Mon, 7 Mar 2011 09:08:29 -0600 Benjamin Root wrote: > Matplotlib is designed to give you maximum control over the figure elements > while still maintaining sensible defaults. This is helpful in some cases, > and not so helpful in others. In your case of placing a legend outside an > axes, ca

Re: [Matplotlib-users] Legend outside the plot

2011-03-07 Thread Benjamin Root
On Mon, Mar 7, 2011 at 5:22 AM, Yuri D'Elia wrote: > Hi everyone. I'm a newbye to matplotlib, so excuse my naive questions. I > have a large experience with gnuplot and asymptote, and I only recently > started to experiment with matplotlib. > > Some background: I'm trying to use matplotlib mostly

[Matplotlib-users] Legend outside the plot

2011-03-07 Thread Yuri D'Elia
Hi everyone. I'm a newbye to matplotlib, so excuse my naive questions. I have a large experience with gnuplot and asymptote, and I only recently started to experiment with matplotlib. Some background: I'm trying to use matplotlib mostly for complex plots with a lot of data. Gnuplot is usually f

Re: [Matplotlib-users] Legend outside plot?

2011-02-11 Thread Jeff Layton
On 02/11/2011 03:48 AM, Jae-Joon Lee wrote: > On Fri, Feb 11, 2011 at 8:38 AM, Jeff Layton wrote: >> I hate to be the first one to comment on this post but I forgot to give >> the error message and version of matplotlib. The error is, >> >> Traceback (most recent call last): >>File "./mult

Re: [Matplotlib-users] Legend outside plot?

2011-02-11 Thread Jae-Joon Lee
On Fri, Feb 11, 2011 at 8:38 AM, Jeff Layton wrote: >  I hate to be the first one to comment on this post but I forgot to give > the error message and version of matplotlib. The error is, > > Traceback (most recent call last): >   File "./multi_file_test_2.py", line 460, in >     ax.legend( (p1[0

Re: [Matplotlib-users] Legend outside plot?

2011-02-10 Thread Paul Anton Letnes
Matplotlib is great! I created all my figures in this paper [0] using matplotlib. I am impressed with the quality you get. I attach the plotting script for fig. 9, which does exactly what you want, I believe. There is a lot of other junk in there, so look for the "legend" function, it all happen

Re: [Matplotlib-users] Legend outside plot?

2011-02-10 Thread Gökhan Sever
Hi, I would simply try to attach the legend to the figure object instead of the axis. On Thu, Feb 10, 2011 at 4:20 PM, Jeff Layton wrote: > Good evening, > > I've been trying to find a way to move the legend outside > the plot so it doesn't cover it up. I've seen some things > online but I can

Re: [Matplotlib-users] Legend outside plot?

2011-02-10 Thread Jeff Layton
I hate to be the first one to comment on this post but I forgot to give the error message and version of matplotlib. The error is, Traceback (most recent call last): File "./multi_file_test_2.py", line 460, in ax.legend( (p1[0], p2[0]), ('IO Time', 'Total Elapsed Time'), bbox_to_anchor

[Matplotlib-users] Legend outside plot?

2011-02-10 Thread Jeff Layton
Good evening, I've been trying to find a way to move the legend outside the plot so it doesn't cover it up. I've seen some things online but I can quite get them to work (probably just my lack of knowledge about matplotlib). The section of code creating the plot looks like, fig = plt.fi

Re: [Matplotlib-users] Legend for contour plots

2011-01-22 Thread Francesco Montesano
Dear Paul, Thank you, it does exacly what I want to do. I searched a bit into the "contour" instance, but I was biased since I was looking for something like "get_line". cheers Francesco 2011/1/21 Paul Ivanov : > Francesco Montesano, on 2011-01-21 15:44,  wrote: >> Dear All, >> >> I am using c

Re: [Matplotlib-users] Legend for contour plots

2011-01-21 Thread Paul Ivanov
Francesco Montesano, on 2011-01-21 15:44, wrote: > Dear All, > > I am using contour plot and I am drawing different contours with > different colors and linestyles and I would like to have a legend with > a caption for each contour function used. > Here you can see an example of what I would like

Re: [Matplotlib-users] Legend in a multibars chart

2011-01-06 Thread Jae-Joon Lee
On Thu, Jan 6, 2011 at 12:43 PM, Benjamin Root wrote: > I can confirm the problem, and I have a few suspects as to the cause.  Most > notably that the legend code probably assumes that it is looking for line > objects, not patch objects and starts using its own color cycler when it > can't get a l

Re: [Matplotlib-users] Legend in a multibars chart

2011-01-06 Thread Alain Pascal Frances
nuary, 2011 04:43 To: Alain Pascal Frances Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Legend in a multibars chart On Wed, Jan 5, 2011 at 7:19 AM, Alain Pascal Frances mailto:frances17...@itc.nl>> wrote: Hi, I'm plotting two subplots using bar chart

Re: [Matplotlib-users] Legend in a multibars chart

2011-01-05 Thread Benjamin Root
On Wed, Jan 5, 2011 at 7:19 AM, Alain Pascal Frances wrote: > Hi, > > I'm plotting two subplots using bar charts, the first one contains one > dataset (one bar for each abscissa value), the second 3 dataset (3 bars for > each abscissa value, each one with its own color). The legend of the > multib

[Matplotlib-users] Legend in a multibars chart

2011-01-05 Thread Alain Pascal Frances
Hi, I'm plotting two subplots using bar charts, the first one contains one dataset (one bar for each abscissa value), the second 3 dataset (3 bars for each abscissa value, each one with its own color). The legend of the multibars chart is not correct, it shows the color of the first dataset for

Re: [Matplotlib-users] legend

2010-10-26 Thread Jae-Joon Lee
One option is to use proxy artists. http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist Regards, -JJ 2010/10/26 Marek Giebułtowski : > Dear All, > I use hist in pylab.I have different sets of data in different colours > in one chart. In legend all rectangulars are unfo

[Matplotlib-users] legend

2010-10-26 Thread Marek Giebułtowski
Dear All, I use hist in pylab.I have different sets of data in different colours in one chart. In legend all rectangulars are unfortunately blue. In plot() it is ok but not in hist(). How to receive correct colours in histogram legend? x is nested list x[1][2][3] is an ordinary list. for p in rang

Re: [Matplotlib-users] legend and bbox_to_anchor, and draggable()

2010-09-27 Thread Jae-Joon Lee
On Sun, Sep 26, 2010 at 4:11 AM, Jouni K. Seppänen wrote: > I'm not sure either. It seems that the two-number form of the bounding > box is meant to create a degenerate bounding box so that any kind of > location specifier ("upper right", "lower center", etc) will always hit > that exact place, bu

Re: [Matplotlib-users] legend and twiny

2010-09-26 Thread Jae-Joon Lee
Try something like handles1, labels1 = ax1.get_legend_handles_labels() handles2, labels2 = ax2.get_legend_handles_labels() ax2.legend(handles1+handles2, labels1+labels2) Also, see http://matplotlib.sourceforge.net/users/legend_guide.html Regards, -JJ On Sat, Sep 25, 2010 at 6:08 AM, Raju Sub

Re: [Matplotlib-users] legend and bbox_to_anchor, and draggable()

2010-09-25 Thread Jouni K . Seppänen
Daniel Hyams writes: > I was playing around with draggable legends, and some strange things started > happening (exception down in the depths of beckend_agg.py, accompanied by a > long stack trace). To make a long story short, I can reproduce this in the > draggable_legend.py example on the matp

[Matplotlib-users] legend and bbox_to_anchor, and draggable()

2010-09-24 Thread Daniel Hyams
I was playing around with draggable legends, and some strange things started happening (exception down in the depths of beckend_agg.py, accompanied by a long stack trace). To make a long story short, I can reproduce this in the draggable_legend.py example on the matplotlib website. All you have t

Re: [Matplotlib-users] legend and twiny

2010-09-24 Thread Benjamin Root
On Fri, Sep 24, 2010 at 4:08 PM, Raju Subban wrote: > Hi, > In the code below legend(label) for ax2 is shown as ax2.legend() is called > after ax1.legend(). > Both plots do show up as expected. > > What should I do to get the legends for both plots. > > Thank you > Raju > Raju, I think ax1.legen

[Matplotlib-users] legend and twiny

2010-09-24 Thread Raju Subban
Hi, In the code below legend(label) for ax2 is shown as ax2.legend() is called after ax1.legend(). Both plots do show up as expected. What should I do to get the legends for both plots. Thank you Raju -- import matplotlib.pyplot as plt import numpy as py x=np.a

Re: [Matplotlib-users] legend font color

2010-09-18 Thread musik
That works perfectly. Thank you all so much! Gökhan SEVER-2 wrote: > > On Fri, Sep 17, 2010 at 1:13 PM, musik wrote: > >> >> Is there a way to set the legend font color? I am plotting multiple sets >> of >> data using different colors. I basically want to set each legend font >> color >> the

Re: [Matplotlib-users] legend font color

2010-09-17 Thread Gökhan Sever
On Fri, Sep 17, 2010 at 1:13 PM, musik wrote: > > Is there a way to set the legend font color? I am plotting multiple sets of > data using different colors. I basically want to set each legend font color > the same as the corresponding data line color. Here is an example. > > x = arange(0,10,0.1)

Re: [Matplotlib-users] legend font color

2010-09-17 Thread Ted Kord
I misunderstood your question, musik. My apologies. Ted On 18 September 2010 02:15, Benjamin Root wrote: > On Fri, Sep 17, 2010 at 1:13 PM, musik wrote: > >> >> Is there a way to set the legend font color? I am plotting multiple sets >> of >> data using different colors. I basically want to s

Re: [Matplotlib-users] legend font color

2010-09-17 Thread Benjamin Root
On Fri, Sep 17, 2010 at 1:13 PM, musik wrote: > > Is there a way to set the legend font color? I am plotting multiple sets of > data using different colors. I basically want to set each legend font color > the same as the corresponding data line color. Here is an example. > > x = arange(0,10,0.1)

Re: [Matplotlib-users] legend font color

2010-09-17 Thread Ted Kord
It does this automatically. ted On 17 September 2010 19:13, musik wrote: > > Is there a way to set the legend font color? I am plotting multiple sets of > data using different colors. I basically want to set each legend font color > the same as the corresponding data line color. Here is an exa

[Matplotlib-users] legend font color

2010-09-17 Thread musik
Is there a way to set the legend font color? I am plotting multiple sets of data using different colors. I basically want to set each legend font color the same as the corresponding data line color. Here is an example. x = arange(0,10,0.1) y1 = sin(x) y2 = cos(x) plot(x,y1,'r-',x,y2,'b--') I wa

Re: [Matplotlib-users] legend: changing the text colour

2010-09-06 Thread karianne
Thank you, JJ, this solves my problems. I have one question to your reply: Jae-Joon Lee wrote: > > col, leg = "b", "test" > errorbar([1,2,3], [1,2,1],xerr=[0.1, 0.1, 0.1], yerr=[0.1, 0.1, 0.1], > fmt='.',color=col) > l2, = plot([],[], "+", color=col) > l2.remove() # remove from the axe

Re: [Matplotlib-users] legend: changing the text colour

2010-09-06 Thread karianne
Thank you, JJ, this solves my problems. I have one question to your reply: Jae-Joon Lee wrote: > > col, leg = "b", "test" > errorbar([1,2,3], [1,2,1],xerr=[0.1, 0.1, 0.1], yerr=[0.1, 0.1, 0.1], > fmt='.',color=col) > l2, = plot([],[], "+", color=col) > l2.remove() # remove from the axe

Re: [Matplotlib-users] legend: changing the text colour

2010-09-03 Thread Jae-Joon Lee
On Fri, Sep 3, 2010 at 11:04 PM, karianne wrote: > Hi, > > I am plotting several different symbols using 3 different colours. The > colours indicate different data sets, whereas the symbols need not be > explained. I would therefore like each label to have a different colour, > i.e. each line in m

[Matplotlib-users] legend: changing the text colour

2010-09-03 Thread karianne
Hi, I am plotting several different symbols using 3 different colours. The colours indicate different data sets, whereas the symbols need not be explained. I would therefore like each label to have a different colour, i.e. each line in my legend should be written in a different colour specified.

Re: [Matplotlib-users] legend missed one dataset

2010-08-26 Thread Ryan May
On Thu, Aug 26, 2010 at 6:18 AM, xyz wrote: > On 26/08/10 01:15, Benjamin Root wrote: >> I believe you are asking why the x axis starts at 2?  This is because >> matplotlib will automatically set the limits of your plot to show all >> of your data.  If you can control the axes yourself by calling

Re: [Matplotlib-users] legend missed one dataset

2010-08-26 Thread xyz
On 26/08/10 01:15, Benjamin Root wrote: > I believe you are asking why the x axis starts at 2? This is because > matplotlib will automatically set the limits of your plot to show all > of your data. If you can control the axes yourself by calling > set_xlim() and/or set_ylim(). > > ax.set_xlim

Re: [Matplotlib-users] legend missed one dataset

2010-08-25 Thread Benjamin Root
On Wed, Aug 25, 2010 at 4:53 AM, xyz wrote: > Thank you, but why the coordinates start from 2 and not from 0 with the > following code? > > from pylab import * > import matplotlib.pyplot as plt > > fig = plt.figure() > ax = fig.add_subplot(111) > > for i in [[2,2], [2,3], [4.2,3.5]]: > print i[

Re: [Matplotlib-users] legend missed one dataset

2010-08-25 Thread xyz
Thank you, but why the coordinates start from 2 and not from 0 with the following code? from pylab import * import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) for i in [[2,2], [2,3], [4.2,3.5]]: print i[0],i[1] plt.plot(i[0],i[1],'o') ax.grid(True) plt.legend(['

Re: [Matplotlib-users] legend missed one dataset

2010-08-24 Thread Michael Droettboom
You have plotted three lines, but only provided legend labels for two of them. Try: plt.legend(('Model length', 'Data length', 'Something else'), 'best', shadow=True, fancybox=True) Mike On 08/24/2010 06:33 AM, xyz wrote: > Hello, > the following script creates a legend for only

  1   2   3   >