Importing packages

Reading Datasets

Seaborn Library

There is a package seaborn library available. Using which we can generate detailed chart representation.

Here we have also used legend to display legend and positioned it top right.

Zoom Axes

You will now create the same figure as in the previous exercise using plt.plot(), this time setting the axis extents using plt.xlim() and plt.ylim(). These commands allow you to either zoom or expand the plot or to set the axis ranges to include important values (such as the origin).

NOTE: After creating the plot, we will use plt.savefig() to export the image produced to a file.

Using axes() function

Used to define the axes where we need to plot our graphs. Axes will define the axes for each and every individual plot to be drawn.

axes comamnd accept array of four arguments which are:

axes([x_low, y_low, width, height])

x_low: is the starting point of x-axis
y_low: Is starting point of y-axis
width: Is the total size of x axis
height: Is total size of y axis

Using subplots() function

Using subplots like this is a better alternative to using plt.axes(). We can manually add more than one plot in the same figure.

Subplot accepts three arguments, subplot(n_rows, n_columns, n_subplot)

Subplot ordering is row wise top left corner.

Bivariate Plots

Let's check whether there is any significance or trend in sex_ratio and total effective literacy rate.

Plotting second order regression plots

As shown above, we have created rectangular bins for 2D array. In similar way, we can also generate haxagonal bins as well.

Mesh grid

Strip plot

Swarn Plot

Swarm plots are generally easier to understand than strip plots because they spread out the points to avoid overlap.

Violin Plot

violin plots are a nice way of visualizing the relationship between a continuous variable and a categorical variable

Joint Plot

Pair Plot

It uses only integer columns only. Remaining columns are ignored.

Heat maps

Box Plot

Univariate Plots