On Fri, Nov 19, 2010 at 9:19 AM, John Hunter <jdh2...@gmail.com> wrote:
> On Fri, Nov 19, 2010 at 9:10 AM, Kynn Jones <kyn...@gmail.com> wrote:
> >
> >
> > When I read your message about implementing the non-GUI mode, it turns
> this simple picture completely on its head, which tells me that matplotlib's
> architecture is, at this point, beyond my comprehension. One of the reasons
> for looking forward to your implementation of the non-GUI mode for the
> MacOSX backend is that, by studying a diff between this enhanced version and
> the previous version I may be able to finally understand matplotlib's basic
> architecture.
> >
>
> >From the introduction: http://matplotlib.sourceforge.net/users/intro.html
> ::
>
> The matplotlib code is conceptually divided into three parts: the
> pylab interface is the set of functions provided by matplotlib.pylab
> which allow the user to create plots with code quite similar to
> MATLAB figure generating code (Pyplot tutorial). The matplotlib
> frontend or matplotlib API is the set of classes that do the heavy
> lifting, creating and managing figures, text, lines, plots and so on
> (Artist tutorial). This is an abstract interface that knows nothing
> about output. The backends are device dependent drawing devices, aka
> renderers, that transform the frontend representation to hardcopy or
> a display device (What is a backend?). Example backends: PS creates
> PostScript? hardcopy, SVG creates Scalable Vector Graphics hardcopy,
> Agg creates PNG output using the high quality Anti-Grain Geometry
> library that ships with matplotlib, GTK embeds matplotlib in a Gtk+
> application, GTKAgg uses the Anti-Grain renderer to create a figure
> and embed it a Gtk+ application, and so on for PDF, WxWidgets,
> Tkinter etc.
>
> matplotlib is used by many people in many different contexts. Some
> people want to automatically generate PostScript files to send to a
> printer or publishers. Others deploy matplotlib on a web application
> server to generate PNG output for inclusion in dynamically-generated
> web pages. Some use matplotlib interactively from the Python shell
> in Tkinter on Windows?. My primary use is to embed matplotlib in a
> Gtk+ EEG application that runs on Windows, Linux and Macintosh OS X.
>
>
>
> Elaborating a little bit: the middle part of matplotlib, the artist
> hierarchy, is what I think you are looking for. That is where
> abstractions like Line2D, Circle and Text live. There is no concept
> of a GUI or a render at that abstraction.
>
> http://matplotlib.sourceforge.net/users/artists.html#artist-tutorial
>
>
Exactly, this is the part of matplotlib that Kynn should focus on -- as a
hierarchy of artist objects. I do think that Kynn would have a somewhat
valid argument with regards to how matplotlib is presented, though. For
example, the pylab interface is completely "magical" and utterly bypasses
any object-oriented-ness. Then, the pyplot interface (which I use most of
the time) provides a more OOP-esque interface. However, the documentation
and examples for the plotting functions do not emphasize the fact that they
return graphing objects, mostly because they get automatically attached to
the axes object and it is unnecessary to do anything with those objects.
Usually, users just let the functions return those objects without an
assignment to anywhere.
While I think pyplot strikes the right balance (for me), I often wonder if
the way this interface is presented causes a logical hinderance to fully
understanding the final layer of the graphical artist objects and
collections. Because the underlying graphical objects are typically ignored
by the users and handled automatically, this layer doesn't receive as much
developer attention to make it more versatile and complete.
Just my 2 cents on this issue. Actual value of the thought varies based
upon the current value of the dollar in your area...
Ben Root
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel