Matplotlib contour distortion with large x-values
<p>Can anyone offer any information why this contour-graph gets distorted when the x-values are large? At least in my mind the figure should stay exactly the same, but perhaps I'm misunderstanding something.</p>

<p>The figure when using shift = 0 (or up to shift = 100000):</p>

<p><a href="https://i.stack.imgur.com/GI84I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GI84I.png" alt="enter image description here"></a></p>

<p>The figure when using shift = 1000000:</p>

<p><a href="https://i.stack.imgur.com/ET286.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ET286.png" alt="enter image description here"></a></p>

<p>The code:</p>

<pre><code>import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as ml

shift = 0 # works
# shift = 1000000 # distorts the graph because of ?

x = np.array([7, 3, 3, 2, 6, 7, 2, 7, 2, 7]) + shift
y = np.array([1, 8, 1, 5, 6, 5, 8, 4, 1, 8])
z = np.array([0.5485118, 0.53838622, 0.93582844, 0.13831005, 0.45559201,
              0.4032324, 0.73419538, 0.03208198, 0.55323105, 0.95654892])

xi = np.linspace(min(x), max(x), 200)
yi = np.linspace(min(y), max(y), 200)
zi = ml.griddata(x, y, z, xi, yi, interp='linear')

plt.contour(xi, yi, zi, 15, linewidths=0.5, colors='k')
plt.pcolormesh(xi, yi, zi, cmap=plt.get_cmap('rainbow'))

plt.colorbar()
plt.scatter(x, y, marker='o', c='b', s=5, zorder=10)
plt.show()
</code></pre>

<p>I'm using matplotlib==1.4.3, numpy==1.9.2, python==2.7.11</p>

<p>In case you're wondering, this code is just a demonstration of the problem. I noticed this odd behaviour when trying to plot a contour with x-axis consisting of timedeltas (in seconds) to Unix UTC epoch, and I'm now trying to figure out the right way to deal with it.</p>

<p>Thanks!</p>