By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,611 Members | 1,633 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,611 IT Pros & Developers. It's quick & easy.

MatPlotLib.MatLab troubles (how to install/run matplotlib.PyLab?)

P: n/a
On my home laptop computer, I'm trying to install the appropriate
modules so that Python version 2.3.3 and IDLE version 1.0.2 (with an
"import matplotlib.matlab" statement) can produce nice MatLab-like
plots.

I have a matplotlib.matlab-capable Python set-up running OK on my
office desktop, which I obtained after downloading and installing a few
more modules (numarray and numeric, I think).

Now I get the following message about matplotlib.matlab being
deprecated:

-------------

matplotlib.matlab deprecated, please import matplotlib.pylab or simply
pylab instead. See http://matplotlib.sf.net/matplotlib_to_pylab.py
for a script which explains this change and will automatically convert
your python scripts that use matplotlib.matlab. This change was made
because we were concerned about trademark infringement on The
Mathwork's trademark of matlab.

---------------

Unfortunately, the above URL does not exist.

Thanks for suggestions, any help you can offer.

Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
>>>>> "Colombes" == Colombes <Dr********@yahoo.com> writes:

Colombes> matplotlib.matlab deprecated, please import
Colombes> matplotlib.pylab or simply pylab instead. See
Colombes> http://matplotlib.sf.net/matplotlib_to_pylab.py for a
Colombes> script which explains this change and will automatically
Colombes> convert your python scripts that use matplotlib.matlab.
Colombes> This change was made because we were concerned about
Colombes> trademark infringement on The Mathwork's trademark of
Colombes> matlab.

Colombes> Unfortunately, the above URL does not exist.

Oops -- that should be
http://matplotlib.sourceforge.net/matlab_to_pylab.py

In a nutshell, wherever you previously imported matplotlib.matlab you
can import matplotlib.pylab or equivalently, simply pylab

OLD:
from matplotlib.matlab import plot

NEW:
from pylab import plot

The script linked above will recursively search and replace these
strings for you in your scripts directory.

JDH
Jul 18 '05 #2

P: n/a

John Hunter wrote:
>> "Colombes" == Colombes <Dr********@yahoo.com> writes:

Colombes> matplotlib.matlab deprecated, please import
Colombes> matplotlib.pylab or simply pylab instead. See
Colombes> http://matplotlib.sf.net/matplotlib_to_pylab.py for a
Colombes> script which explains this change and will

automatically Colombes> convert your python scripts that use matplotlib.matlab.
Colombes> This change was made because we were concerned about
Colombes> trademark infringement on The Mathwork's trademark of
Colombes> matlab.

Colombes> Unfortunately, the above URL does not exist.

Oops -- that should be
http://matplotlib.sourceforge.net/matlab_to_pylab.py

In a nutshell, wherever you previously imported matplotlib.matlab you
can import matplotlib.pylab or equivalently, simply pylab

OLD:
from matplotlib.matlab import plot

NEW:
from pylab import plot

The script linked above will recursively search and replace these
strings for you in your scripts directory.

JDH

John:

Thanks for the help with the MatLab --> PyLab conversion.

Now I only need to figure out how to install the correct "Numeric"
module(s). I'm making progress, almost have my home laptop fully
capable with the MatLab-like (PyLab) graphs, plots.

Jul 18 '05 #3

P: n/a
>>>>> "Colombes" == Colombes <Dr********@yahoo.com> writes:

Colombes> Now I only need to figure out how to install the
Colombes> correct "Numeric" module(s). I'm making progress,
Colombes> almost have my home laptop fully capable with the
Colombes> MatLab-like (PyLab) graphs, plots.

You can get either Numeric or numarray from
http://sourceforge.net/projects/numpy. matplotlib works transparently
with either (and provides a unified interface to both), but if you
choose numarray you need to change the "numerix" variable to numarray
in your matplotlib configuration file, which is described at
http://matplotlib.sf.net/.matplotlibrc

Good luck!
JDH

Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.