Visualization Examples#

import seaborn as sns
import matplotlib.pyplot as plt

Triangle#

The given code displays a triangle with distinct colors on each side.

plt.plot([1,5],[4,8], marker='o', c='r')
plt.plot([1,5],[4,4], marker='o',c='orange')
plt.plot([5,5],[4,8], c='b');
_images/ebb1aed80552bfeab8548f77ba1f629e9c15952a542c71f22826739c7bda4dbe.png

Line with Markers#

Generate line and scatter plots for a randomly selected set of 100 numbers.

import numpy as np
random_numbers = np.random.randint(0,100,(100,)) # 100 random numbers between 0 and 100

plt.figure(figsize=(20,5))
plt.plot(random_numbers)
plt.scatter(range(100), random_numbers, c='r');
_images/2a230c4ee8b34afdb358ad091de9363b0fc2ba82f6f0826694774f85294a452f.png