<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>scienceoss.com &#187; axes</title>
	<atom:link href="http://scienceoss.com/tags/axes/feed/" rel="self" type="application/rss+xml" />
	<link>http://scienceoss.com</link>
	<description>useful tidbits for using open source software in science</description>
	<lastBuildDate>Wed, 26 May 2010 03:34:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Interactive subplots: make all x-axes move together</title>
		<link>http://scienceoss.com/interactive-subplots-make-all-x-axes-move-together/</link>
		<comments>http://scienceoss.com/interactive-subplots-make-all-x-axes-move-together/#comments</comments>
		<pubDate>Sat, 03 May 2008 18:27:25 +0000</pubDate>
		<dc:creator>ryan</dc:creator>
				<category><![CDATA[matplotlib]]></category>
		<category><![CDATA[plotting]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[axes]]></category>
		<category><![CDATA[intertactive plotting]]></category>
		<category><![CDATA[subplot]]></category>

		<guid isPermaLink="false">http://scienceoss.com/?p=123</guid>
		<description><![CDATA[It&#8217;s very easy to make subplots that share an x-axis, so that when you pan and zoom on one axis, the others automatically pan and zoom as well. The key to this functionality is the sharex keyword argument, which is used when creating an axis. Here&#8217;s some example code and a video of the resulting [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s very easy to make subplots that share an x-axis, so that when you pan and zoom on one axis, the others automatically pan and zoom as well.  The key to this functionality is the <span class="c">sharex</span> keyword argument, which is used when creating an axis.  Here&#8217;s some example code and a video of the resulting interaction.<span id="more-123"></span></p>
<pre class="brush: python; title: ; notranslate">
from pylab import figure, show

# Create some data: one x, three different y
x = arange(0.0, 20.0, 0.01)
y1 = sin(2*pi*x)
y2 = exp(-x)
y3 = y1*y2

# Create a figure and add three subplots.
fig = figure()
ax1 = fig.add_subplot(311)
ax2 = fig.add_subplot(312, sharex=ax1)  # share ax1's xaxis
ax3 = fig.add_subplot(313, sharex=ax1)  # share ax1's xaxis

# Plot
ax1.plot(x,y1)
ax2.plot(x,y2)
ax3.plot(x,y3)

# Show the figure.
show()
</pre>
<p>Here&#8217;s a video of what the interaction is like with this figure (matplotlib automatically adds the pan, zoom, home, etc buttons to all figures):</p>
<p><embed src="http://www.jeroenwijering.com/embed/player.swf" width="320" height="250" allowscriptaccess="always" allowfullscreen="true" flashvars="height=250&#038;width=320&#038;file=http://scienceoss.com/wp-content/uploads/2008/04/out.flv&#038;searchbar=false"/></p>
<p>Notice that the y-axis remained independent in each of the three subplots.  As you&#8217;d expect, the <span class="c">add_subplot()</span> method accepts a <span class="c">sharey</span> keyword argument as well.  You can even pass both <span class="c">sharex</span> and <span class="c">sharey</span> . . . this is most useful when two subplots show data with the same units.</p>
]]></content:encoded>
			<wfw:commentRss>http://scienceoss.com/interactive-subplots-make-all-x-axes-move-together/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

