Plotting
-
Data Visualisation with Seaborn
Seaborn is a fantastic package for data visualisation. Here we’ll look at two uses of it: Use pip install seaborn to install Seaborn. Visualising Correlations with Seaborn We can easily use Seaborn to plot pairs of values from a Pandas data frame. Here we’ll use it to plot pairs of values from the iris flower…
-
The Iris Flower Dataset
Before we can look at my plot types, we need some data to work with. The iris flower dataset has been available since 1936 and is still incredibly useful almost a century later. It consists of measurements on 150 irises. There are three species of iris in the dataset and for each flower four measurements…
-
Scatterplots, Pie Charts, Histograms
It’s possible to create many different types of plot with Matplotlib and Python. Here we’ll look at three common types of plot. Scatterplots Scatterplots are particularly useful when you’re trying to figure out how two sets of values are related. To create a scatterplot, supply an iterator of x- and corresponding y-values to the scatter…
-
Subplots
Matplotlib has a really nice syntax for plotting multiple plots side-by-side or in a grid in the same window. Since this syntax is so elegant, it’s common to use it even when you just want one plot. Then you can use a consistent syntax however many plots you need. Single Plots with the Subplot API…
-
Line Plots
To create a 2D plot consisting of points joined by lines, use the plot function. We can supply x- and y-axis data as the first two arguments of this function. The third argument to plot can be a string that specifies what to display. The size of the markers, if used, is controlled by the…
-
Introducing Matplotlib
You can create charts and graphs in Python using Matplotlib. This can be installed easily using pip: pip install matplotlib A simple line plot can be created with the plot function. This accepts an iterator that supplies values to be plotted. If you don’t supply data for the x-axis, plot will create x-axis data, in…