Python | Comparing Categorical Plotting Methods

Here, we are going to compare categorical plotting methods with the examples in Python.
Submitted by Anuj Singh, on July 24, 2020

In this tutorial, we are going to compare categorical plots with Bar, Scatter, and Line Plot through sub plotting. It will help us to decide which one is better for visualization and further use of similar applications.

Categorical Plotting

Python code for comparing categorical plotting methods

import matplotlib.pyplot as plt

names = ['Ragy', 'Lagoon', 'Gak', 'Yuhi', 'Rajee']
values = [561, 634, 134, 785, 625 ]

plt.figure(figsize=(12, 3))

plt.subplot(131)
plt.plot(names, values, '-o')
plt.suptitle('Categorical Sub-Plotting')
plt.subplot(132)
plt.scatter(names, values, s=values)
plt.subplot(133)
plt.bar(names, values)
plt.show()

Output:

Output is as figure





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.