- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Plotting a transparent histogram with non-transparent edge in Matplotlib
To plot a transparent histogram with non-transparent edge, we can take the following steps−
- Create a set of random data points (y).
- Initialize the number of bins to be drawn.
- To plot the histogram, we can use hist() method with edge color and facecolor tuples
- To display the figure, use show() method.
Example
import numpy as np from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True y = np.random.rand(100) nbins = 5 plt.hist(y, bins=nbins, edgecolor=(1, 0, 0, 1), lw=5, facecolor=(.09, .12, .65, .87), rwidth=0.8) plt.show()
Output
- Related Articles
- How to create a transparent histogram using ggplot2 in R?
- How to make axes transparent in Matplotlib?
- How to make the marker face color transparent without making the line transparent in Matplotlib?
- Plotting a histogram from pre-counted data in Matplotlib
- How to make Matplotlib scatterplots transparent as a group?
- Create a transparent box with CSS
- Create a transparent image with CSS
- Turn transparent pixels to a specified color and make opaque pixels transparent with CSS
- Transparent error bars without affecting the markers in Matplotlib
- What is Transparent ?
- Configure tkinter/ttk widgets with transparent backgrounds
- Creating a Transparent window in Python Tkinter
- Transparent Translucent and Opaque
- Is water a transparent material? Explain.
- Make any particular color transparent with CSS Filters

Advertisements