Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>like user1127062 suggests, it might be that your code is just fine.</p> <p>If you don't need the plot to be interactive, save it as an svg</p> <p>If you run:</p> <pre><code>data = numpy.random.randn(10000) pylab.hist(data,300) pylab.savefig(fileName+'.svg',format='svg') </code></pre> <p>you'll see the pixel aliasing (in the bar widths) in the figure window, but it's gone in the svg file.</p> <p>The "cairo" backend seems to do the best job of saving png files, if svg's aren't compatible with what you're doing. They look as good as a screenshot of the svg. </p> <p>You can switch the backend by running.</p> <pre><code>import matplotlib # you have to change the backend before importing pylab matplotlib.use('cairo') import pylab </code></pre> <p>raw "cairo" doesn't support <code>show()</code>, so you can't use it in interactive mode, or to show a plot directly from a program. </p> <p>The "GTKCairo" backend has the best of both worlds but isn't enabled in the default installation (at least not in the one I got with <code>sudo apt-get install matplotlib</code>)</p> <p>If you're using Ubuntu I think all you need to do to get it working is to install gtk, and recompile matplotlib:</p> <pre><code>sudo apt-get install git-core python-gtk2-dev git clone git://github.com/matplotlib/matplotlib.git cd matplotlib sudo python setup.py install </code></pre> <p>You can check which backend is active with:</p> <pre><code>matplotlib.get_backend() </code></pre> <p>You can automatically load your favorite backend by hunting down your <code>matplotlibrc</code> file, I found mine in:</p> <pre><code>/usr/local/lib/python2.7/dist-packages/matplotlib/mpl-data/matplotlibrc </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload