Is it possible to configure Python interpreter to use matplotlib and/or scipy without prepending the class names
Question: I a using a a python package (SloppyCell) that relies heavily on the use of
python plotting tools within scipy and matplotlib. In this software they have
used, on several occasions functions from these modules but have not specified
the class from which they came. For example, they have used:

    
    
    plot(traj.timepoints, result, 'k--', linewidth=3,zorder = 10)
    

which gives me a NameError.

I was under the impression this function would be part of matplotlib.pyplot,
however they have not even imported matplotlib, only scipy, which suggests
this 'plot' function is part of scipy. I have attempted to modify their module
slightly by importing matplotlib.pyplot and running the code as:

    
    
    matplotlib.pyplot.plot(traj.timepoints, result, 'k--', linewidth=3,zorder = 10)
    

But I get the exact same 'NameError: global name 'plot' is not defined'. This
is even more unusual (to me) because when I use this function outside of
SloppyCell this works fine.

The software obviously works for other people because they have published
papers that use this code. Therefore intuition suggests that there is a way to
get the python interpreter to recognize this (and other functions like it)
without prepending the name of the class from which it came. Does anybody know
if this is possible? Alternatively can anybody think if there are other
problems that I am missing?

Thanks in advance.


Answer: In a plain Python 2.7, I can do:

    
    
    >>> from matplotlib import pyplot
    >>> pyplot.plot
    <function plot at 0xb4fe35a4>
    

In `ipython --pylab` I can do

    
    
    plot??
    pyplot.plot??
    

meaning `pyplot` has been imported both by name and by `*`. It does the same
with `numpy` (`np` and `*`).

`import numpy as np` gives access to all of `numpy` submodules. But with
`scipy`, you have import them selectively (e.g. `from scipy import sparse`).
I'm not as familiar with `matplotlib`, but it looks like it follows the
`scipy` model.

