Text of discourse.matplotlib.org › t › patch-more-pythonic-rc-handling › 17100 as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

Patch: more Pythonic rc handling - matplotlib-devel - Matplotlib

Patch: more Pythonic rc handling Development matplotlib-devel Maciek_Dems July 10, 2012, 7:32pm 1 The standard RC parameters handling in Matplotlib has always troubled me. The syntax rc('figure.subplot', top=0.9) is not very conveniet if one wants to change a singe property. Direct rcParams['figure.subplot.top'] seems better suited in this case. However, as the dots are already used to indicate grouping in RC, it seems very natural to use the syntax like: rc.figure.subplot.top = 0.9 In my opinion this is very elegant, efficient and much Pythonic approach.

In the attachment I include a path to the current git main repo, which enables this way of handling RC properties. I would appreciate very much if they were reviewed and included in the next release of Matplotlib (the patch is not particularly large). Best regrds, Maciek 0001-Added-extended-rc-handling-enabling-elegant-Pythonic.patch (4.75 KB) ··· -- Maciek Dems http://dems.art.pl/ Amy_Dyer July 10, 2012, 8:15pm 2 Hi everyone, We're part of the summer 2012 batch at Hackerschool ( www.hackerschool.com ) and we chose to spend this week contributing to matplotlib.

We already submitted a handful of pull requests for bugs but we are looking for more to do. Are there any open issues or features you would like us to work on? - Amy, Vera, Beverly and Alan Benjamin_Root1 July 10, 2012, 8:18pm 3 Awesome! Here is a quick list of all github issues tagged with “wishlist”: https://github.com/matplotlib/matplotlib/issues?labels=wishlist&page=1&state=open Thanks! Ben Root ··· On Tue, Jul 10, 2012 at 4:15 PM, Amy Dyer <oxling@…149…> wrote: Hi everyone, We’re part of the summer 2012 batch at Hackerschool ( www.hackerschool.com ) and we chose to spend this week contributing to matplotlib.

We already submitted a handful of pull requests for bugs but we are looking for more to do. Are there any open issues or features you would like us to work on? Amy, Vera, Beverly and Alan Mike_Kaufman July 11, 2012, 12:20am 4 I probably should at some point submit this as a wishlist item, but I thought I'd mention it here: The other day, I was looking to make a ylabel with text of two different colors (I wanted to use the ylabel in a twinx rather than a legend to show that two of three plots on an axis used a particular scale).

See also: Unfortunately, I don't believe this solution is going to work in a xlabel or ylabel without finding the location of the ylabel and putting these concatenated text objects there. It would be nice to have the label and title methods take a Text object (and a list of text objects -- each of whom could supply a piece of different colored text) in addition to a string. A list of text objects would be automagically concatenated together.

How to generalize alignment of multiple text objects? Haven't thought that far yet. Either that or develop some additional color markup (and a parser) inside a string. Admittedly a bigger project -- though probably a better solution. M ··· On 7/10/12 4:18 PM, Benjamin Root wrote: On Tue, Jul 10, 2012 at 4:15 PM, Amy Dyer < [email protected] ... > <mailto:oxling@…149…>> wrote: Hi everyone, We're part of the summer 2012 batch at Hackerschool (www.hackerschool.com < http://www.hackerschool.com >) and we chose to spend this week contributing to matplotlib.

We already submitted a handful of pull requests for bugs but we are looking for more to do. Are there any open issues or features you would like us to work on? - Amy, Vera, Beverly and Alan Awesome! Here is a quick list of all github issues tagged with "wishlist": GitHub · Where software is built < GitHub · Where software is built ; Benjamin_Root1 July 11, 2012, 3:06am 5 That is already a wishlist item. Feel free to comment on its discussion thread with your ideas.

Ben Root ··· On Tuesday, July 10, 2012, Mike Kaufman wrote: On 7/10/12 4:18 PM, Benjamin Root wrote: On Tue, Jul 10, 2012 at 4:15 PM, Amy Dyer <oxling@…55…149… > > > mailto: [email protected] ... > wrote: Hi everyone, We're part of the summer 2012 batch at Hackerschool ([www.hackerschool.com](http://www.hackerschool.com) <[http://www.hackerschool.com](http://www.hackerschool.com)>) and we chose to spend this week contributing to matplotlib.

We already submitted a handful of pull requests for bugs but we are looking for more to do. Are there any open issues or features you would like us to work on? - Amy, Vera, Beverly and Alan Awesome! Here is a quick list of all github issues tagged with “wishlist”: https://github.com/matplotlib/matplotlib/issues?labels=wishlist&page=1&state=open < https://github.com/matplotlib/matplotlib/issues?labels=wishlist&page=1&state=open > I probably should at some point submit this as a wishlist item, but I thought I’d mention it here: The other day, I was looking to make a ylabel with text of two different colors (I wanted to use the ylabel in a twinx rather than a legend to show that two of three plots on an axis used a particular scale).

See also: http://stackoverflow.com/questions/9169052/partial-coloring-of-text-in-matplotlib Unfortunately, I don’t believe this solution is going to work in a xlabel or ylabel without finding the location of the ylabel and putting these concatenated text objects there. It would be nice to have the label and title methods take a Text object (and a list of text objects – each of whom could supply a piece of different colored text) in addition to a string.

A list of text objects would be automagically concatenated together. How to generalize alignment of multiple text objects? Haven’t thought that far yet. Either that or develop some additional color markup (and a parser) inside a string. Admittedly a bigger project – though probably a better solution. M Maciek_Dems July 11, 2012, 11:36am 6 Dnia wtorek, 10 lipca 2012 21:32:40 Maciek Dems pisze: In the attachment I include a path to the current git main repo, which enables this way of handling RC properties.

I would appreciate very much if they were reviewed and included in the next release of Matplotlib (the patch is not particularly large). I have posted the path to the github fork, as described in developer manual of matplotlib. The most recent changes are here: http://github.com/macdems/matplotlib/compare/master...better-rc Best regards, Maciek ··· -- Maciek Dems http://dems.art.pl/en/ Paul_Ivanov2 July 12, 2012, 12:16am 7 For reference, I believe Ben's referring to #697 [1], for which I provided a possible implementation, which has the automagic concatenation you seek.

1. https://github.com/matplotlib/matplotlib/issues/697 best, ··· On Tue, Jul 10, 2012 at 8:06 PM, Benjamin Root < [email protected] ...> wrote: On Tuesday, July 10, 2012, Mike Kaufman wrote: It would be nice to have the label and title methods take a Text object (and a list of text objects -- each of whom could supply a piece of different colored text) in addition to a string. A list of text objects would be automagically concatenated together.

How to generalize alignment of multiple text objects? Haven't thought that far yet. Either that or develop some additional color markup (and a parser) inside a string. Admittedly a bigger project -- though probably a better solution. M That is already a wishlist item. Feel free to comment on its discussion thread with your ideas. -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7