Pandas builtin visualization
Topics of previous tutorials:
- Seaborn
- Plotting
- Categorical plotting
Pandas builtin data visualization.
Without importing matplot or seaborn library, we can plot using pandas builtin functions.
Types of plots that can be plotted by builtin:
- DataFrame_name.plot.area ( )
- DataFrame_name.plot.bar ( )
- DataFrame_name.plot.hist ( )
- DataFrame_name.plot.pie ( )
- DataFrame_name.plot.line ( )
- DataFrame_name.plot.scatter ( )
- DataFrame_name.plot.box ( )
- DataFrame_name.plot.hexbin ( )
- DataFrame_name.plot.kde ( )
- DataFrame_name.plot.density ( )
Now let us work on each of the plots
First we have to import the below libraries to work with inbuilt plot of pandas library.
The data frame we will be working with a random defined data
Area plot:
This plot is the total area enclosed under each column.
This area is in the form of a stack, which means to calculate area of d0 we have to calculate area under plot d0 and remove the area under plot. If we don’t want this way, we have to pass a parameter ‘satcked’ and assign False boolean to it. Here we also can pass a parameter to change the opacity (transparency ) level of the area plot , ‘alpha’ is the parameter which takes values between zero and one.
Here we also can pass some other parameters that were used in matplot library.
Bar plot ( ):
We also can use stacked parameter here.
Histogram plot:
Line plot:
This is a plot that we haven’t seen till now.
This plot appears when no parameter is passed. Let us pass x and y parameter and check the results.
Scatter plot:
Box plot :
Hexbin plot:
Density:
Pie chart:
Topics of the upcoming tutorials in this section are:
- Plotly and cufflinks
- Geographical plotting