Pardon my poor python skills, I am rather new to the language!
None the less, I am confused by the results I am getting from twinx()
currently. I am not sure why when I twin the x axis, the ticks on the right hand side y axis seem to double.
import matplotlib.pyplot as plt
x = linspace(0,2*pi,100)
y = sin(x) + 100*rand(len(x))
z = cos(x) + 100*rand(len(x))
data = []
data.append(y)
data.append(z)
fig = plt.figure(1)
for kk in range(len(data)):
ax1 = fig.add_subplot(111)
ax1.plot(x.T, data[kk], 'b.-')
plt.show()
The first plot displays (to my mind) the correct behavior
fig2 = plt.figure(2)
for kk in range(len(data)):
ax3 = fig2.add_subplot(111)
ax4 = ax3.twinx()
ax4.plot(x.T, data[kk], 'b.-')
plt.show()
While the second plot (where all I have done is flip the axis) seems to have poor y tick behavior wherein the two 'curves' each get their own tick marks.
Any thoughts as to why this might be occurring would be greatly appreciated!