Eda Lab-Unit-Ii-4
Eda Lab-Unit-Ii-4
UNIT-II
The first significant step is to initialize the spider plot. This can be done by setting
the figure size and polar projection.
#Initialize the plot with the figure size and polar projection:
plt.figure(figsize = (10,6))
plt.subplot(polar=True)
#Get the grid lines to align with each of the subject names:
(lines,labels) = plt.thetagrids(range(0,360,
int(360/len(subjects))),
(subjects))
#Use the plt.plot method to plot the graph and fill the area under it:
plt.plot(theta, plannedGrade)
plt.fill(theta, plannedGrade, 'b', alpha=0.2)
#Now, we plot the actual grades obtained:
plt.plot(theta, actualGrade)
#We add a legend and a nice comprehensible title to the plot:
plt.legend(labels=('Planned Grades','Actual Grades'),loc=1)
plt.title("Plan vs Actual grades by Subject")
#Finally, we show the plot on the screen:
plt.show()
b)Histogram
Histogram plots are used to depict the distribution of any continuous variable. These
types of plots are very popular in statistical analysis.
c)Lollipop chart
They are nothing but a variation of the bar chart in which the thick bar is replaced
with just a line and a dot-like “o” (o-shaped) at the end. Lollipop Charts are preferred
when there are lots of data to be represented that can form a cluster when represented
in the form of bars.
# Create a dataframe
import pandas as pd
df = pd.DataFrame({'group':list(map(chr, range(65, 85))),
'values':np.random.uniform(size=20) })
CONCLUSIONS: