In Chapter 2, Getting Started with Basic Plots, we have learned how to use predefined markers as supplied by Matplotlib. Here we will learn how to define our own markers and use them to plot a sine curve.
Defining custom markers
Getting ready
Import the required libraries:
import matplotlib.pyplot as plt
import numpy as np
How to do it...
Here is the code that plots the sine curve for each of the markers:
- Define the data for plotting a sine curve:
x = np.arange(1, 2.6, 0.1)
y = np.sin(2 * np.pi * x)
- Define the figure and size:
plt.subplots(figsize=(10,8))
- Define the...