Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-15 Thread Neil Girdhar
Come to think of it, I think the inheritance of draw and fill attributes that happen along the path would take advantage of traitlets if you guys decide to go that route. On Fri, May 15, 2015 at 11:40 AM, Neil Girdhar wrote: > Okay, I'm going to wait for more feedback. An hour of design can be

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-15 Thread Neil Girdhar
Okay, I'm going to wait for more feedback. An hour of design can be worth ten hours of implementation :) On Fri, May 15, 2015 at 11:11 AM, Thomas Caswell wrote: > I would advocate for calling yours something different. path.Path is > really a container for a Bezier curve and is probably best l

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-15 Thread Thomas Caswell
I would advocate for calling yours something different. path.Path is really a container for a Bezier curve and is probably best left as simple as possible. There is probably an interesting discussion about right is-a and has-a relations between Path, FancyPath (don't use that name!), and FancyAr

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-15 Thread Neil Girdhar
On Fri, May 15, 2015 at 10:53 AM, Thomas Caswell wrote: > A few very quick comments (just skimmed the docstrings) > > We already have a mpl.path.Path class, please don't shadow that. > I read the Path class and based mine on that. The problem is that I want to be able to place nodes along the p

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-15 Thread Thomas Caswell
A few very quick comments (just skimmed the docstrings) We already have a mpl.path.Path class, please don't shadow that. Is your `Path` going to be an `Artist` that is responsible for drawing it's self or does in serve a role like the existing `Path` in that it is used by other artists as part of

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-15 Thread Neil Girdhar
I have a draft proposal of the long term goal for what an interface could look like for drawing arrows between coordinates or nodes. I based the design on the tikz manual (http://pgf.sourceforge.net/pgf_CVS.pdf), so it might help to flip through that to get an idea for the basis of this design. I

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Thomas Caswell
Sorry, I may have been being a bit dramatic In mpl.patches: Arrow, FancyArrow, YAArrow, FancyArrowPatch, ConnectionPatch + annotation related artists + some classes in axisartist which now that I look at them are not really general purpose arrow tools. I had not been counting quiver (or barbs) or

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Neil Girdhar
Okay, I'm looking at this in more detail and there may be some design concerns: The arrow placement is decided without asking the arrow any questions, such as its bounding box. Instead, the arrow should return a bounding box and then the line should retreat until the bounding box no longer inters

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Eric Firing
On 2015/05/13 4:14 PM, Neil Girdhar wrote: > Thanks, it works! > > I needed to add: > > import matplotlib.patches > > to one file and > > plt.show() > > to the other. > > Any word on the locations in the code of the seven arrow drawing methods? I'm not sure how to get to a count of seven. One of

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Neil Girdhar
Thanks, it works! I needed to add: import matplotlib.patches to one file and plt.show() to the other. Any word on the locations in the code of the seven arrow drawing methods? I've located the arrow drawing code in tikz, and so I can start porting it over. I'm curious, do we know the linewi

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Benjamin Reedlunn
Neil,I have attached code to draw the arrowhead.-Ben# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import custom_annotations import matplotlib.pyplot as plt plt.figure() ax = plt.subplot(111) length = 20.0 head_length = 7.0 #Convert the head length from mm into po

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Neil Girdhar
Do you have the code that you used to draw the arrowhead? I'm up to date now on the development workflow ( http://matplotlib.org/devel/gitwash/development_workflow.html), so I'm ready to start working. Thanks, Neil On Wed, May 13, 2015 at 9:10 PM, Benjamin Reedlunn wrote: > Yes, I fully agree

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Neil Girdhar
Wow, this looks great. Thank you all of you so far for the quick responses and pointers. I've already done many diagrams in Python-generated TikZ, which I want to port over to pure Python. They are basically variants of this: http://www.texample.net/tikz/examples/graph/ . Do you think this will

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Thomas Caswell
The other thing that should be done is to unify the (I think 7?!?) unique ways to draw arrows in mpl. On Wed, May 13, 2015 at 4:52 PM Neil Girdhar wrote: > Yes, I just noticed that as well. That's how the tikz pgf code looks (a > sequence of line_to and curve_to commands and so on) so it should

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Neil Girdhar
Yes, I just noticed that as well. That's how the tikz pgf code looks (a sequence of line_to and curve_to commands and so on) so it should be easy to port over the various shapes. On Wed, May 13, 2015 at 4:49 PM, Eric Firing wrote: > On 2015/05/13 10:12 AM, Neil Girdhar wrote: > >> If you want t

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Eric Firing
On 2015/05/13 10:12 AM, Neil Girdhar wrote: > If you want to make arrowheads look at all decent, they really need to > be enclosed in Bezier curves. See the diagram here: Mpl paths support Bezier curves. http://matplotlib.org/api/path_api.html?highlight=bezier > > http://tex.stackexchange.com/qu

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Neil Girdhar
If you want to make arrowheads look at all decent, they really need to be enclosed in Bezier curves. See the diagram here: http://tex.stackexchange.com/questions/150289/how-do-you-accomplish-stealth-with-the-new-arrows-meta/230965#230965 The first two look like garbage. The last one is the only

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Eric Firing
On 2015/05/13 9:36 AM, Neil Girdhar wrote: > I don't know matplotlib well enough (yet) to know what the change would > consist of. > > I suggest you take a look at the beautiful tikz manual: > http://pgf.sourceforge.net/pgf_CVS.pdf Very helpful, thank you. > > The arrows.meta on page 201–212 are

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Benjamin Root
Just to point out, matplotlib does have a fairly new PGF backend. Perhaps you might want to look at that and see where the TikZ library might fit in with that? Cheers! Ben Root On Wed, May 13, 2015 at 3:36 PM, Neil Girdhar wrote: > I don't know matplotlib well enough (yet) to know what the chan

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Neil Girdhar
I don't know matplotlib well enough (yet) to know what the change would consist of. I suggest you take a look at the beautiful tikz manual: http://pgf.sourceforge.net/pgf_CVS.pdf The arrows.meta on page 201–212 are really well-designed and beautiful. Compare this with matplotlib's custom arrows:

Re: [matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Eric Firing
On 2015/05/13 12:39 AM, Neil Girdhar wrote: > TikZ is an extremely well-designed library for generating professional > figures within the cumbersome TeX framework. Currently, my work flow is > to generate TikZ code using Python. The TikZ is compiled into PDFs, > which are then included in my LaTe

[matplotlib-devel] Incorporating TikZ into Matplotlib

2015-05-13 Thread Neil Girdhar
TikZ is an extremely well-designed library for generating professional figures within the cumbersome TeX framework. Currently, my work flow is to generate TikZ code using Python. The TikZ is compiled into PDFs, which are then included in my LaTeX files. I would like to work entirely in Python.