Tutorial by Examples

A simple scatter plot import matplotlib.pyplot as plt # Data x = [43,76,34,63,56,82,87,55,64,87,95,23,14,65,67,25,23,85] y = [34,45,34,23,43,76,26,18,24,74,23,56,23,23,34,56,32,23] fig, ax = plt.subplots(1, figsize=(10, 6)) fig.suptitle('Example Of Scatterplot') # Create the Scatter P...
Shaded region below a line import matplotlib.pyplot as plt # Data x = [0,1,2,3,4,5,6,7,8,9] y1 = [10,20,40,55,58,55,50,40,20,10] # Shade the area between y1 and line y=0 plt.fill_between(x, y1, 0, facecolor="orange", # The fill color color='...
Simple line plot import matplotlib.pyplot as plt # Data x = [14,23,23,25,34,43,55,56,63,64,65,67,76,82,85,87,87,95] y = [34,45,34,23,43,76,26,18,24,74,23,56,23,23,34,56,32,23] # Create the plot plt.plot(x, y, 'r-') # r- is a style code meaning red solid line # Show the plot plt.show...
Heatmaps are useful for visualizing scalar functions of two variables. They provide a “flat” image of two-dimensional histograms (representing for instance the density of a certain area). The following source code illustrates heatmaps using bivariate normally distributed numbers centered at 0 in bo...

Page 1 of 1