# [Matplotlib-devel] Markup text

6 messages
Open this post in threaded view
|

## [Matplotlib-devel] Markup text

 Based on the example rainbow_text.py in the gallery, I've tried to implement a simple markup extension to the text directive (see code below). It's far from complete but I would like to know if there's any interest in that and if it's worth making a MEP (and if yes, could someone remind me the procedure for doing that ?). The idea is to be able to use pango-like markup text for quick/small changes of the text: Examples: "Hello world!" "Hello world!" "Hello world" Currently, the implementation only works for non-rotated text. Nicolas _______________________________________________ Matplotlib-devel mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-devel markup.py (4K) Download Attachment
Open this post in threaded view
|

## Re: Markup text

 Nicolas,Put an a PR adding a file to https://github.com/matplotlib/matplotlib/tree/master/doc/devel/MEP is the current MEP procedure.TomOn Mon, Oct 10, 2016 at 1:09 AM Nicolas P. Rougier <[hidden email]> wrote: Based on the example rainbow_text.py in the gallery, I've tried to implement a simple markup extension to the text directive (see code below). It's far from complete but I would like to know if there's any interest in that and if it's worth making a MEP (and if yes, could someone remind me the procedure for doing that ?). The idea is to be able to use pango-like markup text for quick/small changes of the text: Examples: "Hello world!" "Hello world!" "Hello world" Currently, the implementation only works for non-rotated text. Nicolas _______________________________________________ Matplotlib-devel mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-devel _______________________________________________ Matplotlib-devel mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-devel
Open this post in threaded view
|

## Re: Markup text

 Thanks Thomas. Just realized I've an old MEP (MEP28 https://github.com/matplotlib/matplotlib/pull/4384), should I create a MEP29 instead ? How do I know if someone else is already working on a different MEP 29 ? Nicolas > On 14 Oct 2016, at 16:06, Thomas Caswell <[hidden email]> wrote: > > Nicolas, > > Put an a PR adding a file to https://github.com/matplotlib/matplotlib/tree/master/doc/devel/MEP is the current MEP procedure. > > Tom > > On Mon, Oct 10, 2016 at 1:09 AM Nicolas P. Rougier <[hidden email]> wrote: > > > Based on the example rainbow_text.py in the gallery, I've tried to implement a simple markup extension to the text directive (see code below). It's far from complete but I would like to know if there's any interest in that and if it's worth making a MEP (and if yes, could someone remind me the procedure for doing that ?). > > The idea is to be able to use pango-like markup text for quick/small changes of the text: > > > Examples: > > "Hello world!" > "Hello world!" > "Hello world" > > > Currently, the implementation only works for non-rotated text. > > > Nicolas > > > _______________________________________________ > Matplotlib-devel mailing list > [hidden email] > https://mail.python.org/mailman/listinfo/matplotlib-devel_______________________________________________ Matplotlib-devel mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-devel
Open this post in threaded view
|

## Re: Markup text

 Good question, the only answer we have right now revolves around changing the MEP number at merge time into trunk.  If changing the MEP number exists as the only thing left to do, then it will get merged straight away, easy, so no having to come back to change it a 2nd time.Best,Oceanwolf From: Nicolas P. Rougier <[hidden email]> To: Thomas Caswell <[hidden email]> Cc: matplotlib development list <[hidden email]> Sent: Friday, 14 October 2016, 19:17 Subject: Re: [Matplotlib-devel] Markup text Thanks Thomas.Just realized I've an old MEP (MEP28 https://github.com/matplotlib/matplotlib/pull/4384), should I create a MEP29 instead ? How do I know if someone else is already working on a different MEP 29 ?Nicolas> On 14 Oct 2016, at 16:06, Thomas Caswell <[hidden email]> wrote:> > Nicolas,> > Put an a PR adding a file to https://github.com/matplotlib/matplotlib/tree/master/doc/devel/MEP is the current MEP procedure.> > Tom> > On Mon, Oct 10, 2016 at 1:09 AM Nicolas P. Rougier <[hidden email]> wrote:> > > Based on the example rainbow_text.py in the gallery, I've tried to implement a simple markup extension to the text directive (see code below). It's far from complete but I would like to know if there's any interest in that and if it's worth making a MEP (and if yes, could someone remind me the procedure for doing that ?).> > The idea is to be able to use pango-like markup text for quick/small changes of the text:> > > Examples:> > "Hello world!"> "Hello world!"> "Hello world"> > > Currently, the implementation only works for non-rotated text.> > > Nicolas> > > _______________________________________________> Matplotlib-devel mailing list> [hidden email]> https://mail.python.org/mailman/listinfo/matplotlib-devel_______________________________________________Matplotlib-devel mailing list[hidden email]https://mail.python.org/mailman/listinfo/matplotlib-devel _______________________________________________ Matplotlib-devel mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-devel
 Wouldn't it make more sense to implement this as improvements to mathtext? instead of"Hello world!""Hello world!""Hello world"haver"$\text{Hello \textbf{world}}$"r"$\text{Hello \textcolor{blue}{world}}$"r"$\text{Hello \textsf{\small world}}$"You'll be able to have a better layout this way too (reusing the mathtext layout engine).One could have some helper if "$\text{}$" is too much to type (but TBH you immediately gain back on the fact that you don't need closing tags...).Antony2016-10-14 12:05 GMT-07:00 OceanWolf via Matplotlib-devel :Good question, the only answer we have right now revolves around changing the MEP number at merge time into trunk.  If changing the MEP number exists as the only thing left to do, then it will get merged straight away, easy, so no having to come back to change it a 2nd time.Best,Oceanwolf From: Nicolas P. Rougier <[hidden email]> To: Thomas Caswell <[hidden email]> Cc: matplotlib development list <[hidden email]> Sent: Friday, 14 October 2016, 19:17 Subject: Re: [Matplotlib-devel] Markup text Thanks Thomas.Just realized I've an old MEP (MEP28 https://github.com/matplotlib/matplotlib/pull/4384), should I create a MEP29 instead ? How do I know if someone else is already working on a different MEP 29 ?Nicolas> On 14 Oct 2016, at 16:06, Thomas Caswell <[hidden email]> wrote:> > Nicolas,> > Put an a PR adding a file to https://github.com/matplotlib/matplotlib/tree/master/doc/devel/MEP is the current MEP procedure.> > Tom> > On Mon, Oct 10, 2016 at 1:09 AM Nicolas P. Rougier <[hidden email]> wrote:> > > Based on the example rainbow_text.py in the gallery, I've tried to implement a simple markup extension to the text directive (see code below). It's far from complete but I would like to know if there's any interest in that and if it's worth making a MEP (and if yes, could someone remind me the procedure for doing that ?).> > The idea is to be able to use pango-like markup text for quick/small changes of the text:> > > Examples:> > "Hello world!"> "Hello world!"> "Hello world"> > > Currently, the implementation only works for non-rotated text.> > > Nicolas> > > _______________________________________________> Matplotlib-devel mailing list> [hidden email]> https://mail.python.org/mailman/listinfo/matplotlib-devel_______________________________________________Matplotlib-devel mailing list[hidden email]https://mail.python.org/mailman/listinfo/matplotlib-devel _______________________________________________ Matplotlib-devel mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-devel _______________________________________________ Matplotlib-devel mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-devel