|
From: Daniel M. <dan...@go...> - 2013-06-13 11:48:23
|
Hi,
I need a twinx() plot with horizontal and vertical grid lines for the
second axis, just like the usual grid for the first axis. I don't need or
want to specify the ticks manually, though!
My example code just produces horizontal lines:
import pylab
datax = pylab.arange(50)
data1 = pylab.sin(datax)*1.5
data2 = datax**2
pylab.close('all')
fig = pylab.figure()
ax1 = fig.add_subplot(111)
ax2 = ax1.twinx()
ax1.plot(datax, data1, 'x')
ax2.plot(datax, data2, '--')
#ax1.grid()
ax2.grid()
fig.show()
Thanks in advance!
|