- 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
How to make the marker face color transparent without making the line transparent in Matplotlib?
To make the marker face color transparent without making the line transparent in matplotlib, we can take the following steps −
Create x_data and y_data(sin(x_data)), using numpy.
Plot curve using x_data and y_data, with marker style and marker size. By changing the alpha, we can make it transparent to opaque.
To get the essence of transparency (keeping alhpa value lesser), we can make grid lines, to see through.
To display the figure, use the show() method.
Example
import numpy as np from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True x_data = np.linspace(1, 10, 100) y_data = np.sin(x_data) plt.plot(x_data, y_data, c='green', marker='o', alpha=.3, ms=10, lw=1) plt.grid() plt.show()
Output
- Related Articles
- How to make axes transparent in Matplotlib?
- Transparent error bars without affecting the markers in Matplotlib
- Turn transparent pixels to a specified color and make opaque pixels transparent with CSS
- How to make Matplotlib scatterplots transparent as a group?
- Make any particular color transparent with CSS Filters
- Plotting a transparent histogram with non-transparent edge in Matplotlib
- How to make a Tkinter canvas rectangle transparent?
- How to make surfaceview transparent in an Android App?
- How to make a background 20% transparent on Android
- How to make a background 25% transparent on Android?
- How to make a background 25% transparent on iOS
- How to make the controlling corners of an Ellipse transparent using FabricJS?
- How to make the controlling corners of a Circle transparent using FabricJS?
- How to make the controlling corners of a Triangle transparent using FabricJS?
- How to make the controlling corners of a Rectangle transparent using FabricJS?

Advertisements