Re: [Matplotlib-users] Outline for histogram bars

2013-11-15 Thread Benjamin Root
On Wed, Nov 13, 2013 at 8:16 PM, Ted To  wrote:

> Thanks Ben!
>
> I was wondering if you can help me with a related question.  How does
> one change the artist for the legend?  Since I have a "step" histogram,
> it would be nice to have the legend display lines rather than outlined
> rectangles.
>
> Thanks,
> Ted
>
>
I am not really an expert on that topic, but this question (or one very
similar) has come up before. I think the answer is to use "Proxy Artists".
If you search for proxy artists in the documentation, you should find stuff
about that.

Cheers!
Ben Root
--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Outline for histogram bars

2013-11-13 Thread Ted To
Thanks Ben!

I was wondering if you can help me with a related question.  How does
one change the artist for the legend?  Since I have a "step" histogram,
it would be nice to have the legend display lines rather than outlined
rectangles.

Thanks,
Ted

On 11/13/2013 09:35 AM, Benjamin Root wrote:
> 
> 
> 
> On Tue, Nov 12, 2013 at 8:01 PM, Ted To  > wrote:
> 
> Perfect!  Many thanks!  Seems to be an undocumented feature...
> 
> 
> Not undocumented. In the docs for hist(), it says that it accepts any
> parameter that is used for Patch artists. This is also generally true
> for many of the other plotting functions. They usually take any
> additional keyword arguments that could be passed on to whatever the
> artist is that is returned. This isn't a hard-and-fast rule, but it is
> true more often than not.
> 
>  
> 
> Out of curiosity, what is the rationale behind using 'dashed' and
> 'dashdot' instead of '--' and '-.'?
> 
> 
> This is an inadvertent oversight. I noted this in
> https://github.com/matplotlib/matplotlib/issues/2136
> 
> Cheers!
> Ben Root

--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Outline for histogram bars

2013-11-13 Thread Benjamin Root
On Tue, Nov 12, 2013 at 8:01 PM, Ted To  wrote:

> Perfect!  Many thanks!  Seems to be an undocumented feature...
>
>
Not undocumented. In the docs for hist(), it says that it accepts any
parameter that is used for Patch artists. This is also generally true for
many of the other plotting functions. They usually take any additional
keyword arguments that could be passed on to whatever the artist is that is
returned. This isn't a hard-and-fast rule, but it is true more often than
not.



> Out of curiosity, what is the rationale behind using 'dashed' and
> 'dashdot' instead of '--' and '-.'?
>
>
This is an inadvertent oversight. I noted this in
https://github.com/matplotlib/matplotlib/issues/2136

Cheers!
Ben Root
--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Outline for histogram bars

2013-11-12 Thread Ted To
Perfect!  Many thanks!  Seems to be an undocumented feature...

Out of curiosity, what is the rationale behind using 'dashed' and
'dashdot' instead of '--' and '-.'?

Ted To

On 11/12/2013 04:59 PM, Benjamin Root wrote:
> 
> 
> 
> On Tue, Nov 12, 2013 at 4:26 PM, Ted To  > wrote:
> 
> Hi,
> 
> Is there an option to change the line style for the outline of histogram
> bars?  What I am looking for some something like the attached kernel
> density plot.  I can set different colors (attached) but this is not
> very useful when printing in black and white.
> 
> Thanks,
> Ted To
> 
> 
> You should be able to specify linestyle='dashed' (or 'dashdot', or
> 'dotted') when you call hist().
> 
> I hope that helps!
> Ben Root

--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Outline for histogram bars

2013-11-12 Thread Benjamin Root
On Tue, Nov 12, 2013 at 4:26 PM, Ted To  wrote:

> Hi,
>
> Is there an option to change the line style for the outline of histogram
> bars?  What I am looking for some something like the attached kernel
> density plot.  I can set different colors (attached) but this is not
> very useful when printing in black and white.
>
> Thanks,
> Ted To
>
>
You should be able to specify linestyle='dashed' (or 'dashdot', or
'dotted') when you call hist().

I hope that helps!
Ben Root
--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users