Tagged: matplotlib

Matplotlib TkAgg

Now that Matplotlib 1.4 has been released, BEFORE upgrading matplotlib with sudo pip3 install –upgrade matplotlib consider first installing sudo apt-get install tk-dev libpng-dev libffi-dev dvipng texlive-latex-base You may want to type sudo pip3 install cairocffi

Matplotlib 3D plotting: how to import

For 3D plotting to work in Matplotlib, near the beginning of the first .py file you use to start your program, you must have imports in this order: import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt If you try importing Axes3D in a later function that actually does the 3D plotting, […]

Autoscaling imagesc() plot and imshow() plots

Octave 3.8 has default axis scaling that scales x and y axes proportionally to the axes values. So if one axis values span a much wider range than the other axis, the smaller span axis gets very thin. You can simply insert the line axis(‘normal’) after imagesc() In Matplotlib 1.3, the same issue occurs, which […]

Matplotlib in Cygwin 64-bit for Python 3 and Python 2.7

It is pretty simple to install matplotlib for Python 3 and Python 2.7 in Cygwin. prereqs: pkg-config ghostscript libfreetype-devel libpng-devel python-gtk2.0 libgtk2.0-devel gcc-g++ git Procedure: git clone git://github.com/matplotlib/matplotlib.git cd matplotlib python setup.py install or for python 3, do: python3 setup.py install result: $ python Python 2.7.5 (default, Oct 2 2013, 22:34:09) [GCC 4.8.1] on cygwin […]

Spyder with Ipython: Make matplotlib plots appear in own window

The default for Spyder 2.2 and 2.3 with Ipython is to have new matplotlib figures appear “inline” in the Ipython console. I want separate windows to pop up for figures as with the standard python console. To do this: In Spyder, click Tools, Preferences, Ipython Console, Graphics and under Graphics Backend select “automatic” instead of […]

Matplotlib Python3: fixing pyplot.imshow()

I have noticed on my Ubuntu 14.04 PCs and have seen other OSs having issues with python3 and matplotlib.pyplot.imshow(). Errors like: backend_gtk3cairo.RendererGTK3Cairo … NotImplementedError: Surface.create_for_data: Not Implemented yet. and getting blank images. I fixed the problem by switching the matplotlib backend as follows: 1) placing a file named “matplotlibrc” in the directory of my Python […]