<div dir="ltr">This seems to be working ok for me: <a href="https://gist.github.com/faa6b4008a8e3db68f46">https://gist.github.com/faa6b4008a8e3db68f46</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 17, 2015 at 4:22 PM, Smit, Christine E. (GSFC-610.2)[TELOPHASE CORP] <span dir="ltr"><<a href="mailto:christine.e.smit@nasa.gov" target="_blank">christine.e.smit@nasa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px">
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div style="font-family:Calibri,sans-serif">Hi! I am using matplotlib v 1.4.3 with Python 2.7.10 :: Anaconda 2.4.0 (64-bit).</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<div style="font-family:Calibri,sans-serif">What I am doing here is creating a 7x7 pixel image from a 7x7 matrix. I expect to see one pixel per data point, but that's not what I'm seeing. Instead of a diagonal make up of single pixels, I get an odd 2x2 pixel
 blob in the middle of the correct one pixel diagonal.</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<div><font face="Courier">---------------------------------------------------------------------------</font></div>
<div>
<div><font face="Courier">import numpy as np</font></div>
<div><font face="Courier">import matplotlib.pylab as plt</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">if __name__ == "__main__":</font></div>
<div><font face="Courier">    n = 7</font></div>
<div><font face="Courier">    data = np.identity(n, float)</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">    # Create an nxn size figure with no frame</font></div>
<div><font face="Courier">    fig = plt.figure(figsize=(n, n), frameon=False)</font></div>
<div><font face="Courier"><br>
</font></div>
<div><font face="Courier">    # make the axes to the edge of the figure</font></div>
<div><font face="Courier">    ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])</font></div>
<div><font face="Courier">    # turn the axes off</font></div>
<div><font face="Courier">    ax.set_axis_off()</font></div>
<div><font face="Courier">    # add the axes to this figure</font></div>
<div><font face="Courier">    fig.add_axes(ax)</font></div>
<div><font face="Courier">    # show the data. Don't do any interpolation.</font></div>
<div><font face="Courier">    ax.imshow(data, interpolation='nearest', origin='lower',aspect='auto')</font></div>
<div><font face="Courier">    # Save the figure at 1 dot per inch, which should mean 1 data point per</font></div>
<div><font face="Courier">    # pixel</font></div>
<div><font face="Courier">    fig.savefig("image.png", dpi=1)</font></div>
</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<font face="Courier">---------------------------------------------------------------------------<br>
<br>
</font>
<div style="font-family:Calibri,sans-serif">Since I'm not sure that if I can attach the png image I get, here is a ppm version of the image I get (between the ------). Save this image.ppm minus the dashes and you should be able to open it in something like
 gimp.<br>
<br>
<font face="Courier">---------------------------------------------------------------------------<br>
P3<br>
# CREATOR: GIMP PNM Filter Version 1.1<br>
7 7<br>
255<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
127<br>
0<br>
0<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
127<br>
0<br>
0<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
127<br>
0<br>
0<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
127<br>
0<br>
0<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
127<br>
0<br>
0<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
0<br>
0<br>
127<br>
</font><font face="Courier">---------------------------------------------------------------------------<br>
<br>
<font face="Calibri">Thanks.<span class="HOEnZb"><font color="#888888"><br>
Christine</font></span></font><br>
</font></div>
</div>
</div>

<br>_______________________________________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/matplotlib-users</a><br>
<br></blockquote></div><br></div>