- 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
How to increase the thickness of error line in a Matplotlib bar chart?
To increase the thickness of error line in a Matplotlib bar chart, we can use err_kw=dict() with their properties.
Steps
- Set the figure size and adjust the padding between and around the subplots.
- Make a dictionary of bar details.
- Create a figure and a set of subplots.
- Use bar() method to make a bar plot with yerr and err_kw
- To display the figure, use show() method.
Example
import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True bar_details = { "labels": ['G1', 'G2', 'G3', 'G4', 'G5'], "men_means": [20, 35, 30, 35, 27], "men_std": [2, 3, 4, 1, 2], "width": 0.35 } fig, ax = plt.subplots() ax.bar(bar_details["labels"], bar_details["men_means"], bar_details["width"], yerr=bar_details["men_std"], label='Men', error_kw=dict(lw=5, capsize=5, capthick=3)) plt.show()
Output
- Related Articles
- How to increase the line thickness of a Seaborn Line?
- How to create a Matplotlib bar chart with a threshold line?
- How to align the bar and line in Matplotlib two Y-axes chart?
- How to determine the order of bars in a matplotlib bar chart?
- How to display percentage above a bar chart in Matplotlib?
- How to Create a Diverging Stacked Bar Chart in Matplotlib?
- How to create a line chart using Matplotlib?
- How to plot a Bar Chart with multiple labels in Matplotlib?
- How to change Bar Chart values to percentages in Matplotlib?
- How to plot a bar chart for a list in Python matplotlib?
- Horizontal stacked bar chart in Matplotlib
- How to display stacked bar chart using matplotlib in Python?
- How to remove gaps between bars in Matplotlib bar chart?
- How do I get all the bars in a Matplotlib bar chart?
- How to sort bars in increasing order in a bar chart in matplotlib?

Advertisements