import pylab as pl # or, alternatively, import matplotlib.pyplot as plt
import numpy as np

# Suppose we have a series of points that we would like to plot:
x, y = np.random.rand(50, 1), np.random.rand(50, 1)
xy = np.concatenate([x, y], axis=-1) # concatenate the arrays on the last axis, output shape == (50, 2)
print(f"xy.shape: {xy.shape}")

# Scatter plot
pl.scatter(x, y)
pl.show()

# Line graph
pl.plot(x, y)
pl.show()

# Customizing the colors
pl.plot(x, y, 'g') # Green lines
pl.plot(x, y, 'ro') # Red dots
pl.show()

# You can stack plots
pl.scatter(x, y)
pl.scatter(y, x)
pl.plot(x, y, 'g')
pl.plot(y, x, 'y')
pl.show()
