- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Setting the display range suplot of errorbars in matplotlib
To set the display range subplot or errorbars in matplotlib, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Create x and y data points using numpy.
- Create a figure and a set of subplots.
- Plot y versus x as lines and/or markers with attached errorbars.
- To display the figure, use show() method.
Example
import numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True x = np.arange(0.1, 4, 0.5) y = np.exp(-x) fig, ax = plt.subplots() ax.errorbar(x, y, xerr=0.2, yerr=0.4) plt.show()
Output
- Related Articles
- How to force errorbars to render last with Matplotlib?
- Setting the size of the plotting canvas in Matplotlib
- Setting the aspect ratio of a 3D plot in Matplotlib
- Setting Different Bar color in Matplotlib
- Setting the spacing between grouped bar plots in Matplotlib
- Setting Y-axis in Matplotlib using Pandas
- Setting the limits on a colorbar of a contour plot in Matplotlib
- Setting the same axis limits for all subplots in Matplotlib
- Setting a relative frequency in a Matplotlib histogram
- Setting Transparency Based on Pixel Values in Matplotlib
- Setting active subplot using axes object in Matplotlib
- Setting different error bar colors in barplot in Matplotlib
- How to display Matplotlib Y-axis range using absolute values rather than offset values?
- Setting the Matplotlib title in bold while using "Times New Roman"
- Preserve padding while setting an axis limit in matplotlib

Advertisements