|
From: Daniele N. <da...@gr...> - 2013-10-28 22:51:58
|
On 28/10/2013 23:30, Oliver wrote:
> Hi Daniele,
>
> not sure, but it seems to work for me. Did you do a plt.draw() or
> plt.show() to reflect the changes?
Hello,
it investigated this a bit further and the problem presents itself only
when I use `mpl_toolkits.axisartist.Axes`. Here is a minimum example
that demonstrates the problem:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import host_subplot
from mpl_toolkits.axisartist import Axes
x = np.linspace(0, 2*np.pi)
y = np.sin(x)
f = plt.figure()
BUG = True
if BUG:
ax1 = host_subplot(111, axes_class=Axes)
else:
ax1 = host_subplot(111, axes_class=Axes)
ax1.plot(x, y)
ax1.set_xlim(0, 2*np.pi)
ax1.set_xticks(np.linspace(0, 2*np.pi, 5))
ax1.set_xticklabels(['%.2f' % x for x in np.linspace(0, 2*np.pi, 5)],
fontsize=8)
plt.draw()
plt.show()
Cheers,
Daniele
|