1 / 8

MATPLOTLIB PART 3

Matplotlib offers the facility to plot the graphs. Here is a glance over different special plots that can be plotted using Matplotlib.<br>To learn more visit:https://bit.ly/DatascienceCourse<br><br>

Download Presentation

MATPLOTLIB PART 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MATPLOTLIB ( PART 3 )

  2. Special plots in Matplotlib

  3. Scatter Plot • Eg: n = 256X = np.random.normal(0,1,n) Y = np.random.normal(0,1,n) plt.scatter(X,Y) • O/P:

  4. Usually we do not use matplotlib for the special plots as it has some limitations.Hence we go for a higher version of tool that is Seaborn. • Still we can plot various plots at basic level in matplotlib as well.Some of the plots that can be plotted are: • Scatter plot • Histogram • Box-plot • Bar plot

  5. Eg 2: • arr1 = np.arange(1,10,0.5)arr2 = np.log(arr1)plt.scatter(arr1,arr2) • O/P:

  6. Histogram • arr1 = np.arange(1,10,0.5)arr2 = np.log(arr1) plt.hist(arr1, arr2) • O/P:

  7. Box-Plot • bplt = plt.boxplot(arr1, vert = True,patch_artist = True)patch, color = list(zip(bplt['boxes'],['pink']))[0]patch.set_facecolor(color) • O/P:

  8. Pie Chart • Z = np.random.uniform(0, 1, 20)plt.pie(Z) • O/P: • These are some of ways of plotting different graphs in Matplotlib . Due to the facilities of Seaborn over Matplotlib, seaborn id always preferred.

More Related