- 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 set a line color to orange, and specify line markers in Matplotlib?
To set a line color to orange, and specify line markers in matplotlib, we can take the following steps −
Steps
Set the figure size and adjust the padding between and around the subplots.
Create x and y data points using numpy.
Plot the x and y data points with the attributes color='orange' and marker='*'.
To display the figure, use show() method.
Example
import matplotlib.pyplot as plt import numpy as np # Set the figure size plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True # x and y data points x = np.linspace(-5, 5, 100) y = np.sin(x) # Plot the data points with color and marker attributes plt.plot(x, y, color='orange', marker="*") # Display the plot plt.show()
Output
It will produce the following output −
- Related Articles
- How to set same color for markers and lines in a Matplotlib plot loop?
- Using Colormaps to set the color of line in Matplotlib
- How to plot a gradient color line in matplotlib?
- How to vary the line color with data index for line graph in matplotlib?
- How to set the line color in Python Plotly?
- How to set Line Border color and width with Java?
- How to change the color of a line using radiobuttons in Matplotlib?
- How to plot a single line in Matplotlib that continuously changes color?
- How to change the plot line color from blue to black in Matplotlib?
- How to pick a new color for each plotted line within a figure in matplotlib?
- How to set label for an already plotted line in Matplotlib?
- How to change line color in EditText
- How to animate a line plot in Matplotlib?
- How to label a line in Matplotlib (Python)?
- How to avoid line color repetition in matplotlib.pyplot?

Advertisements