You may need to give boolean arg in your calls, e.g. use `ax.yaxis.grid(True)`

instead of `ax.yaxis.grid()`

. Additionally, since you are using both of them you can combine into `ax.grid`

, which works on both, rather than doing it once for each dimension.

```
ax = plt.gca()
ax.grid(True)
```

That should sort you out.

### Related Contents:

- How to plot in multiple subplots
- Adding value labels on a matplotlib bar chart
- Annotate bars with values on Pandas bar plots
- Scatter plots in Pandas/Pyplot: How to plot by category [duplicate]
- Stacked Bar Chart with Centered Labels
- How can I plot separate Pandas DataFrames as subplots?
- Improve subplot size/spacing with many subplots in matplotlib
- How to plot multiple Seaborn Jointplot in Subplot
- FutureWarning: elementwise comparison failed; returning scalar, but in the future will perform elementwise comparison
- How to plot and annotate a grouped bar chart
- Changing the formatting of a datetime axis in matplotlib
- Python matplotlib multiple bars
- How to add hovering annotations to a plot
- Plot different DataFrames in the same figure
- Plotting grouped data in same plot using Pandas
- Plot Pandas DataFrame as Bar and Line on the same one chart
- how to get ticks every hour?
- Reset color cycle in Matplotlib
- How to plot multi-color line if x-axis is date time index of pandas
- How to plot and annotate grouped bars in seaborn / matplotlib
- Horizontal stacked bar plot and add labels to each section
- How to display custom values on a bar plot
- How to invert the x or y axis
- Add x and y labels to a pandas plot
- How can I make a barplot and a lineplot in the same seaborn plot with different Y axes nicely?
- How to plot different groups of data from a dataframe into a single figure
- Saving plots (AxesSubPlot) generated from python pandas with matplotlib’s savefig
- How to change the datetime tick label frequency for matplotlib plots
- Matplotlib DateFormatter for axis label not working
- How to save the Pandas dataframe/series data as a figure?
- How do I make the width of the title box span the entire plot?
- Seaborn: countplot() with frequencies
- Problem in combining bar plot and line plot (python)
- Matplotlib showing x-tick labels overlapping
- Plot a bar plot from a Pandas DataFrame
- ValueError: view limit minimum -35738.3640567 is less than 1 and is an invalid Matplotlib date value
- Problem in combining bar plot and line plot
- How to show a bar and line graph on the same plot
- Add image annotations to bar plots
- Legend only shows one label when plotting with pandas
- Plot the x-axis as a date
- Change main plot legend label text
- Python pandas / matplotlib annotating labels above bar chart columns [duplicate]
- How to plot multiple dataframes to the same plot axes
- datetime x-axis matplotlib labels causing uncontrolled overlap
- Large Dataset Polynomial Fitting Using Numpy
- matplotlib savefig() size control
- pandas scatter plotting datetime
- Bar-Plot with two bars and two y-axis
- How to create a scatter plot by category [duplicate]