Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off grid in a loglog graph with multiple axes

Tags:

matplotlib

I want to draw a graph with two y scales and a loglog graph in it. I followed the example given here:

Now, I want to turn off the grid, because it looks quite ugly if I print it on a small paper. However, the grid just does not vanish! If I do this using a non-logarithmic scale, everything is OK, but this somehow doesn't work.

Here's the code:

import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(111)
t = np.arange(0.01, 10.0, 0.01)
s1 = np.exp(t)
ax1.loglog(t, s1)
plt.hold(False)
plt.draw()
plt.show()
like image 809
Thomas Avatar asked Dec 26 '22 07:12

Thomas


1 Answers

You could use the grid functionax1.grid(b=False)

like image 68
Robbert Avatar answered Dec 29 '22 04:12

Robbert