Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It looks like you're dealing with the <code>matplotlib.pyplot</code> interface, which means that you'll be able to bypass most of the dealing with artists, axes, and the like. You can control the values and labels of the tick marks by using the <a href="http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.xticks" rel="noreferrer"><code>matplotlib.pyplot.xticks</code></a> command, as follows:</p> <pre><code>tick_locs = [list of locations where you want your tick marks placed] tick_lbls = [list of corresponding labels for each of the tick marks] plt.xticks(tick_locs, tick_lbls) </code></pre> <p>For your particular example, you'll have to compute what the tick marks are relative to the units (i.e. pixels) of your original plot (since you're using <code>imshow</code>) - you said you know how to do this, though.</p> <p>I haven't dealt with images much, but you may be able to use a different plotting method (e.g. <code>pcolor</code>) that allows you to supply <code>x</code> and <code>y</code> information. That may give you a few more options for specifying the units of your image.</p> <p>For tutorials, you would do well to look through the <a href="http://matplotlib.sourceforge.net/gallery.html" rel="noreferrer">matplotlib gallery</a> - find something you like, and read the code that produced it. One of the guys in our office recently bought a book on <a href="http://www.apress.com/book/view/9781430218432" rel="noreferrer">Python visualization</a> - that may be worthwhile looking at.</p> <p>The way that I generally think of all the various pieces is as follows:</p> <ul> <li>A <code>Figure</code> is a container for all the <code>Axes</code></li> <li>An <code>Axes</code> is the space where what you draw (i.e. your plot) actually shows up</li> <li>An <code>Axis</code> is the actual <code>x</code> and <code>y</code> axes</li> <li>Artists? That's too deep in the interface for me: I've never had to worry about those yet, even though I rarely use the <code>pyplot</code> module in production plots.</li> </ul>
 

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