You can use axhspan
and/or axvspan
like this:
import matplotlib.pyplot as plt
plt.figure()
plt.xlim(0, 5)
plt.ylim(0, 5)
for i in range(0, 5):
plt.axhspan(i, i+.2, facecolor="0.2", alpha=0.5)
plt.axvspan(i, i+.5, facecolor="b", alpha=0.5)
plt.show()
More Related Contents:
- matplotlib: can I create AxesSubplot objects, then add them to a Figure instance?
- Setting different color for each series in scatter plot on matplotlib
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- Reverse Y-Axis in PyPlot
- How to manually create a legend
- Matplotlib: save plot to numpy array
- How to plot multiple functions on the same figure, in Matplotlib?
- find length of sequences of identical values in a numpy array (run length encoding)
- Plotting grouped data in same plot using Pandas
- Interactive pixel information of an image in Python?
- How to highlight specific x-value ranges
- Matplotlib semi-log plot: minor tick marks are gone when range is large
- How to increase/reduce the fontsize of x and y tick labels
- How to convert a .wav file to a spectrogram in python3
- Retrieve XY data from matplotlib figure [duplicate]
- Python Matplotlib Boxplot Color
- gnuplot linecolor variable in matplotlib?
- How to change legend fontsize with matplotlib.pyplot
- How to force the Y axis to only use integers
- matplotlib y-axis label on right side
- Is it possible to change line color in a plot if exceeds a specific range?
- How can I make the xtick labels of a plot be simple drawings using matplotlib?
- How to get a list of all the fonts currently available for Matplotlib?
- matplotlib 2d line line,=plot comma meaning
- How to annotate the values of X and Y while hovering mouse over the bar graph
- How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?
- How to install NumPy for python 3.3.5 on Mac OSX 10.9
- 3D Scatter Plot with Images as Annotations
- Hide ticks but show tick labels
- Setting Different error bar colors in bar plot in matplotlib