If you have two variables and want to spot the correlation between those, a scatter plot may be the solution to spot patterns.
This type of plot is also very usable as a start for more advanced visualization of multidimensional data (for example, to plot a scatter plot matrix).
Scatter plots display values for two sets of data. The data visualization is done as a collection of points not connected by lines. Each of them has its coordinates determined by the value of the variables. One variable is controlled (independent variable), while the other variable is measured (dependent variable) and is often plotted on the y axis.
Here's a code sample that plots two plots: one with uncorrelated data and the other with strong positive correlation:
import matplotlib.pyplot as plt import numpy as np # generate x values x = np.random.randn(1000) # random measurements, no correlation y1 = np.random.randn(len(x)) # strong correlation...