What would be cool is if you had the code to do the plotting as part of an IPython notebook to demonstrate this functionality. That way if others wanted to take a quick look at these methods, they would have the code right on hand.

As for calling emperor from python, that could work but we would need to somehow open a browser window or a renderer of some sort that supports WebGL.

On Feb 13, 2014, at 6:01 PM, Jorge Cañardo Alastuey <notifications@github.com> wrote:

> In bipy/maths/stats/ordination/base.py:
> 
> > +                                    ('eigvals', 'objects', 'descriptors',
> > +                                     'biplot', 'site_constraints'))):
> > +    __slots__ = ()
> > +
> > +    def __new__(cls, eigvals, objects, descriptors=None, biplot=None,
> > +                site_constraints=None):
> > +        return super(OrdinationResults2, cls).__new__(cls, eigvals, objects,
> > +                                                      descriptors, biplot,
> > +                                                      site_constraints)
> > +
> > +
> > +class Ordination(object):
> > +    short_method_name = 'Overwrite in subclass!'
> > +    long_method_name = 'Overwrite in subclass!'
> > +
> > +    def biplot(self, scaling=2, choices=[0, 1]):
> I think that not having a hard dependency on plotting libraries is a good thing. That can be solved by removing them from install_requires and lazy importing when used. However, allowing plotting directly from bipy adds a lot of value to bipy, at least for these methods. If the decision is to only return numbers and let the user plot them however they want, I'll remove the biplot method (~50 lines of code). In cogent there's some code to do this same kind of plots, also with matplotlib, but I found it difficult to integrate and very verbose so ended up rewriting it and this was the result.
> 
> BTW, can emperor be called from python? I think it'd be super cool if something like emperor_plot(array_of_coordinates, pandas_dataframe_of_metadata_a_la_mapping_file) worked! 
> 
> Re: the coordinate class, I would wait a bit more. The biplot method knows how to plot everything just from the OrdinationResults tuple, so it should be possible to do it without another class.
> 
> Thanks for all the comments!
> 
> —
> Reply to this email directly or view it on GitHub.
>