changing appearance of legend line entries

hi all,

i am plotting two distinct lines, one of the format ‘-o’ the other of the format ‘-s’ – i.e. one line with circular markers the other with a square marker. when i add a legend to the figure, it gives a legend that looks like this:

o—o label of circular marker line
s—s label of square marker line

however, in these types of plots, it’s standard for the line in the legend to only have one marker. meaning the legend should look like this:

–o-- label of circular marker line
–s-- label of square marker line

is there a way to get this modified legend appearance?

second question: how can i make the legend altogether smaller? or at least make the label text font smaller?

thanks.

http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=legend#matplotlib.pyplot.legend

numpoints=1 is what you want.

For font size and etc, check the similar question posted a few days ago.

http://www.nabble.com/formatting-help-with-legend-for-stacked-bar-graph-with-many-categories-td24526118.html#a24537195

-JJ

···

On Fri, Jul 17, 2009 at 6:12 PM, per freem<perfreem@...287...> wrote:

hi all,

i am plotting two distinct lines, one of the format '-o' the other of the
format '-s' -- i.e. one line with circular markers the other with a square
marker. when i add a legend to the figure, it gives a legend that looks like
this:

o---o label of circular marker line
s---s label of square marker line

however, in these types of plots, it's standard for the line in the legend
to only have *one* marker. meaning the legend should look like this:

--o-- label of circular marker line
--s-- label of square marker line

is there a way to get this modified legend appearance?

second question: how can i make the legend altogether smaller? or at least
make the label text font smaller?

thanks.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users