International Journal On Advanced Computer Theory And Engineering (IJACTE)
_______________________________________________________________________________________________
_______________________________________________________________________________________________
ISSN (Print): 2319-2526, Volume -6, Issue -4, 2017 9
A Journey of Graphical Representation based on Python
1Mohit Agarwal, 2Sabyasachi Prusty, 3Nilesh Kumar Janghel
1,2,3Dayananda Sagar College of Arts, Science and Commerce, Bangalore, India.
Abstract—The choice of programming language based on research work and goal of data investigation. At present the most popular programming tool is Python. In this research paper, we are trying to focus Graphical Representation: Bar and pie chart with python in-build functions.
Keywords—python, Bar, Pie, Matplotlib.
I. INTRODUCTION
Matplotlib is a crafty learn about for the Python programming language and its numerical mathematics additionally NumPy. It provides an object-oriented API for embedding plots into applications interest general- purpose GUI toolkits associated with Tkinter, wxPython, Qt, or GTK. Encircling is besides a conforming "pylab" interface based on a affirm tackle (like OpenGL), premeditated to just verge on wind of MATLAB, nevertheless its narrative is fragmented.
SciPy makes financial statement of matplotlib.
Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and intuitive situations crosswise over stages. Matplotlib can be utilized as a part of Python contents, the Python and IPython shell, the jupyter scratch pad, web application servers, and four graphical UI toolboxs. Matplotlib tries to make tough things possible. With the help of matplotlib user can create plots, histograms, power spectra, bar charts, errorcharts, scatterplots, etc., in a little lines of code.
II. MATPLOTLIB ARCHITECTURE
The matplotlib architecture revolves around the actions that are necessary for the users to create, render, and update the Figure objects. Figures can be displayed and cooperated with via common user interface happening such as the keyboard and mouse inputs. This layer of interaction with common user interface is called the backend layer. A Figure needs to be composed of multiple objects that should be individually modifiable, but it should be implemented in such a way that it has a positive and predictable impact on the other aspects of the Figure. This logical layer is responsible for the abstraction of each visual component that one can see in a Figure. Due to its highly visual nature, this layer was
identified as the more general concept of creating visual art and is thus referred to as the artist layer. Lastly, the Figure needs to support programmatic interaction and provide the users with the ability to manipulate Figures with a syntax that is as clean and intuitive as possible.
This is called as scripting layer. The following figure shows the relation between the three layers of matplotlib architecture (backend, artist, and scripting):
Figure 1: Basic architecture
The backend layer rests at rock bottom of the matplotlib architecture and it is only aware of concerning its own interfaces. The subsequent layers at the top of the stack know only about themselves and the layers below. Thus, complexities are properly isolated to the higher levels. In describing this, we are taking some liberties with the simplification that we've generated, which is a small sacrifice that was made to help clarify the roles of the layers. We will cover each layer of this stack in detail in the following sections. We will provide examples, references to code, and diagrams. Part of this will include revealing the complexity behind the initial sketch that you just saw. As we explore the depths of matplotlib in the following sections, it might be helpful to keep a mental placeholder for the layers as they relate to data and the Figure object for a given plot in the following way:
• The user creates either the data that he/she wants to plot or the functions that generate this data
• This data is either created or loaded in the scripting layer
• The data is transformed into various objects in the artist layer; it is adjusted as scripted
International Journal On Advanced Computer Theory And Engineering (IJACTE)
_______________________________________________________________________________________________
_______________________________________________________________________________________________
ISSN (Print): 2319-2526, Volume -6, Issue -4, 2017 10
• These objects are then rendered by the backend, which ultimately provides the configured toolkit with the raw data necessary to place an image on the toolkit's canva.
III. BAR GRAPH
import matplotlib.pyplot as plt plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt
a=input("enter the marks of indian language") b=input("enter the marks of general english") c=input("enter the marks of oop using c++")
d=input("enter the marks of financial accounting management")
e=input("enter the marks of operating system")
distros = ('bca301', 'bca302', 'bca303', 'bca304','bca305') hits_per_day = [a,b,c,d,e]
y_pos = np.arange(len(distros))
plt.bar(y_pos, hits_per_day , align='center', alpha=0.5 ) plt.xticks(y_pos, distros)
plt.ylabel('marks')
plt.title('bar chart of student marks') plt.show().
Figure 2: Sample code of Bar chart
Figure 2: Out put of Bar chart
IV. ADVANTAGE OF BAR GRAPH
1. Easy representation of data.
2. Represents frequency.
3. Versatile and widely used.
4. Trends easier to highlight.
V. PIE CHART
import matplotlib.pyplot as plt
a=input("Enter the marks of Indian language") b=input("Enter the marks of General english") c=input("Enter the marks of OOP using C++")
d=input("Enter the marks of Financial Accounting Management")
e=input("Enter the marks of Operating system") labels=['BCA301','BCA302','BCA303',
'BCA304','BCA305']
sizes = [a,b,c,d,e]
colors = ['green','lightgreen','gold','lightskyblue','red']
plt.pie(sizes, labels=labels, colors=colors , autopct='%1.1f%%',shadow=False, startangle=90 ) plt.axis ('equal')
plt.title('Pie chart of student marks') plt.show()
International Journal On Advanced Computer Theory And Engineering (IJACTE)
_______________________________________________________________________________________________
_______________________________________________________________________________________________
ISSN (Print): 2319-2526, Volume -6, Issue -4, 2017 11
Figure 3: Sample code of Pie chart
Figure 4: Out put of Pie Chart
VI. ADVANTAGE OF PIE CHART
1. It display relative proportions of multiple classes of data.
2. The size of the circle can be made proportional to the total quantity it represents.
3. It can be easily understood due to widespread use in business and the media.
4. It can be visually simpler than other types of graphs
REFERENCES
[1] D. Kirasić, D. Basch, "Ontology-based design pattern recognition", Knowledge-Based Intelligent Information and Engineering Systems, Springer, pp. 384-393, 2008.
[2] D.H. Vu, Specifying object-oriented design patterns using owl, 2010.
[3] N. Marz, J. Warren, Big Data: Principles and Best Practices of Scalable Realtime Data Systems, Greenwich, CT, USA:Manning Publications Co., 2015.
[4] S. Perera, S. Suhothayan, Tutorial: Solution patterns for realtime streaming analytics, pp. 247- 255, 2015.
[5] M. Durut, Distributed clustering algorithms over a cloud computing platform, 2012.
[6] I. Aranda, G. Venolia, "The secret life of bugs:
Going past the errors and omissions in software repositories", Procedings of 2009 IEEE 31st International Conference on Software Engineering, pp. 298-308, 2009.
[7] Mousumi Paul , Debabrata Samanta, and Goutam Sanyal,” Dynamic job Scheduling in Cloud Computing based on horizontal load balancing”, International Journal of Computer Technology and Applications (IJCTA) , Vol. 2 (5), pp. 1552- 1556, 2011, ISSN: 2229-6093.
[8] Syed K Ahmed Khadri, D Samanta, Mousumi Paul,” Message communication using Phase Shifting Method (PSM)”, International Journal of Advanced Research in Computer Science (IJARCS), Volume 4, Number 11, pp.9-11 ,November-December 2013.
[9] Syed K Ahmed Khadri, D Samanta, and Mousumi Paul, "Approach of Message Communication Using Fibonacci Series: In Cryptology," Lecture Notes on Information Theory, Vol. 2, No. 2, pp. 168-171, June 2014.
doi: 10.12720/lnit.2.2.168-171
[10] Syed K Ahmed Khadri, D Samanta, Mousumi Paul,” Novel Approach for Message Security”, International Journal of Information Science and Intelligent System (IJISIS), pp. 47-52,Volume 3, Number 1, 2014.
[11] Syed K Ahmed Khadri, D Samanta, Mousumi Paul,” Message Encryption Using Text Inversion plus N Count: In Cryptology”, International Journal of Information Science and Intelligent System (IJISIS), pp. 71-74, Volume 3, Number 2, 2014.
[12] Syed K Ahmed Khadri, D Samanta, Mousumi Paul,” Secure Approach for Message Communication”, International Journal of Advanced Research in Computer and Communication Engineering (IJARCCE), pp.
3481-3484, Vol. 2, Issue 9, September 2013.
[13] P.J. Guo, T. Zimmermann, N. Nagappan, B.
Murphy, "Characterizing and predicting which bugs get fixed: an empirical study of Microsoft Windows", Proceedings of the 32nd International Conference on Software Engineering, pp. 495- 504, 2010.
[14] R. Robbes, M. Lungu, D. Röthlisberger, "How do developers react to API deprecation? The case of a Smalltalk ecosystem", Proceedings of the ACM
International Journal On Advanced Computer Theory And Engineering (IJACTE)
_______________________________________________________________________________________________
_______________________________________________________________________________________________
ISSN (Print): 2319-2526, Volume -6, Issue -4, 2017 12
SIGSOFT 20th International Symposium on the Foundations of Software Engineering, pp. 56: 1- 56:11, 2012.
[15] A. Hora, R. Robbes, N. Anquetil, A. Etien, S.
Ducasse, M.T. Valente, "How do developers
react to API evolution? The Pharo ecosystem case", Procedings of 2015 IEEE International Conference on Software Maintenance and Evolution, pp. 251-260, 2015.