This is a basic scatterplot example made with the plot() function of Matplotlib. These arguments are passed to the function:

  • x : x axis coordinates of the data points
  • y : y axis coordinates of the data points
  • data : an object with labelled data
  • linestyle : style of the lines between each point
  • marker : marker style of the points
# libraries
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
 
# Create a dataset:
df=pd.DataFrame({'x_values': range(1,101), 'y_values': np.random.randn(100)*15+range(1,101) })
 
# plot
plt.plot( 'x_values', 'y_values', data=df, linestyle='none', marker='o')
plt.show()

Contact & Edit


👋 This document is a work by Yan Holtz. You can contribute on github, send me a feedback on twitter or subscribe to the newsletter to know when new examples are published! 🔥

This page is just a jupyter notebook, you can edit it here. Please help me making this website better 🙏!