{"id":37451,"date":"2022-02-19T18:11:36","date_gmt":"2022-02-19T12:41:36","guid":{"rendered":"https:\/\/mcq-questions.com\/?p=37451"},"modified":"2022-02-21T15:46:02","modified_gmt":"2022-02-21T10:16:02","slug":"class-12-informatics-practices-notes-plotting-data-using-matplotlib","status":"publish","type":"post","link":"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/","title":{"rendered":"Class 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib"},"content":{"rendered":"

Informatics Practices Class 12 Notes \u2013 Plotting Data Using Matplotlib<\/h2>\n

\u2192 Data Visualisation: It refers to the graphicalor visual representation of information and data using visual elements like charts, graphs and maps, etc. The purpose of plotting data is to visualize variation or show relationships between variables.<\/p>\n

\u2192 Pyplot of Matplotlib Library: The matplotlib is a Python library that provides many interfaces and functionality for 2D – graphics similar to MATLAB’s in various forms. It provides both a very quick way to visualize data from Python and publication – quality figures in many formats.<\/p>\n

\u2192 Pyplot: It is a collection of methods within matplotlib which allows. user to construct 2D plots easily and interactively.
\n\"MCQ<\/p>\n

\u2192 Installing and Importing Matplotlib: It can be installed using the following pip command from the command prompt:
\npip install matplotlib<\/p>\n

\u2192 For plotting using Matplotlib, we need to import its pyplot module using the following command:
\nimport matplotlib.pyplot as pit<\/p>\n

\u2192 Plot ( ): The pyplot module of matplotlib contains a collection of functions that can be used to work on a plot. The plot() function of the pyplot module is used to create a figure.<\/p>\n

\u2192 Figure: A figure is the overall window where the outputs of pyplot functions are plotted. A figure contains a Notes plotting area, legend, axis labels, ticks, title, etc.<\/p>\n

\u2192 Chart Types: We can create different types of graphs and charts using Pyplot. Some commonly used charts types are:<\/p>\n

\u2192 Line Chart: A line chart or line graph is a type of chart which displays information as a series of data points called ‘markers\u2019 connected by straight line segments. With pyplot, a line chart is created using plot() function.<\/p>\n

\u2192 Bar Chart: A bar chart or bar graph is a chart or graph that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent. The bars can be plotted vertically or horizontally. With pyplot, a bar chart is created using bar( ) and barh( ) functions.<\/p>\n

\u2192 Scatter Plot: The scatter plot is similar to a line chart, the major difference is that while line graph connects the data points with a line, scatter chart simply plots the data points to show the trend in the data. With pyplot, a scatter chart is created using scatter( ) function.<\/p>\n

\u2192 Pie Chart: A pie chart (or a circle chart) is a circular statistical graphic, which is divided into slices to illustrate numerical proportion. With pyplot, a pie chart is created using pie( ) function. But pie chart can plot only one data sequence unlike other chart types.<\/p>\n

\u2192 Histogram Plot: A histogram is a type of graph that provides a visual interpretation of numerical data by indicating the number
\nof data points that lie within a range of values. With pyplot, a histogram is created using hist( ) function.<\/p>\n

\"MCQ<\/p>\n

\u2192 Boxplot Chart: A boxplot is the visual representation of the statistical five number summary of a given data set. With pyplot, a boxplot is created using boxplot ( ) function.’<\/p>\n

\"Class
\n\"Class
\n\"Class
\n\"Class
\n\u2192 List of pyplot functions to plot different charts:<\/p>\n

\"MCQ<\/p>\n\n\n\n\n\n\n\n\n
plot (\\*args[, scalex, scaley, data])<\/td>\nPlot x versus y as lines and\/or markers. Make a bar plot.<\/td>\n<\/tr>\n
bar(x, height!, width, bottom, align, data])<\/td>\nMake a bar plot.<\/td>\n<\/tr>\n
boxplot(x[, notch, sym, vert, whis, …])<\/td>\nMake a box and whisker plot.<\/td>\n<\/tr>\n
hist(x[, bins, range, density, weights, …])<\/td>\nPlot a histogram.<\/td>\n<\/tr>\n
pie(x[, explode, labels, colors, autopct, …])<\/td>\nPlot a pie chart.<\/td>\n<\/tr>\n
scatter(x, y[, s, c, marker, cmap, norm, …])<\/td>\nA scatter plot of x versus y.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u2192 Marker: A marker is any symbol that represents a data value in a line chart or a scatter plot. In other words, the data points being plotted on a graph\/chart are called markers.<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n
marker<\/td>\ndescription<\/td>\nmarker<\/td>\ndescription<\/td>\n<\/tr>\n
‘.’<\/td>\npoint marker<\/td>\n‘H’<\/td>\nhexagon2 marker<\/td>\n<\/tr>\n
‘,’<\/td>\npixel marker<\/td>\n‘1’<\/td>\nTri _down marker<\/td>\n<\/tr>\n
‘o’<\/td>\ncircle marker<\/td>\n‘2’<\/td>\ntri_up marker<\/td>\n<\/tr>\n
‘+’<\/td>\nplus marker<\/td>\n‘3’<\/td>\ntri_ left marker<\/td>\n<\/tr>\n
‘x’<\/td>\nx marker<\/td>\n‘4’<\/td>\ntri_right marker<\/td>\n<\/tr>\n
‘D’<\/td>\ndiamond marker<\/td>\n‘V’<\/td>\ntriangle_down marke<\/td>\n<\/tr>\n
‘d’<\/td>\nthin_diamond marker<\/td>\n‘A’<\/td>\ntriangle_up marker<\/td>\n<\/tr>\n
‘s’<\/td>\npentagon marker<\/td>\n‘<‘<\/td>\ntriangle- left marker<\/td>\n<\/tr>\n
‘P’<\/td>\nstar marker<\/td>\n‘>’<\/td>\ntriangle_right marker<\/td>\n<\/tr>\n
‘h’<\/td>\nhexagonl marker<\/td>\n\u00a0‘l’ ‘-‘<\/td>\nvline, hline markers<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u2192 Colour: It is also possible to format the plot further by changing the colour of the plotted data. We can either use character codes or the colour names as values to the parameter colour in the plot( ).<\/p>\n\n\n\n\n\n\n\n
character<\/td>\ncolour<\/td>\ncharacter<\/td>\ncolour<\/td>\n<\/tr>\n
‘b’<\/td>\nblue<\/td>\ny<\/td>\nyellow<\/td>\n<\/tr>\n
‘g’<\/td>\ngreen<\/td>\n‘k’<\/td>\nblack<\/td>\n<\/tr>\n
‘r’<\/td>\nred<\/td>\n‘c’<\/td>\ncyan<\/td>\n<\/tr>\n
‘m’<\/td>\nmagenta<\/td>\nW<\/td>\nwhite<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u2192 Linewidth and Linestyle: The linewidth and linestyle property can be used to change the width and the style of the line chart. Linewidth is specified in pixels. The default line width is 1 pixel showing a thin line. Thus, a number greater than 1 will output a thicker line depending on the value provided.<\/p>\n

\"MCQ
\n\"Class<\/p>\n

\u2192 We can also set the linestyle of a line chart using the linestyle parameter. It can take a string such as “solid”, \u201cdotted\u201d, “dashed” or”dashdot”.
\n\"Class<\/p>\n

\u2192 The Pandas Plot Function: The plot() method of Pandas accepts a considerable number of arguments that can be used to plot a variety of graphs. It allows customising different plot types by supplying the kind keyword arguments.
\nSyntax: plt.plot(kind),where kind accepts a string indicating the type of .plot<\/p>\n\n\n\n\n\n\n\n
Kind =<\/td>\nPlot Type<\/td>\nKind =<\/td>\nPlot Type<\/td>\n<\/tr>\n
line<\/td>\nLine plot (default)<\/td>\nbox<\/td>\nBoxplot<\/td>\n<\/tr>\n
bar<\/td>\nVertical bar plot<\/td>\nArea<\/td>\nArea plot<\/td>\n<\/tr>\n
barh<\/td>\nHorizontal bar plot<\/td>\nPie<\/td>\nPie plot<\/td>\n<\/tr>\n
Hist<\/td>\nHistogram<\/td>\nscatter<\/td>\nScatter plot<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

MCQ Questions for Class 12 Informatics Practices with Answers<\/a><\/h4>\n","protected":false},"excerpt":{"rendered":"

Informatics Practices Class 12 Notes \u2013 Plotting Data Using Matplotlib \u2192 Data Visualisation: It refers to the graphicalor visual representation of information and data using visual elements like charts, graphs and maps, etc. The purpose of plotting data is to visualize variation or show relationships between variables. \u2192 Pyplot of Matplotlib Library: The matplotlib is …<\/p>\n

Class 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib<\/span> Read More »<\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","spay_email":""},"categories":[35],"tags":[],"yoast_head":"\nClass 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib - MCQ Questions<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Class 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib - MCQ Questions\" \/>\n<meta property=\"og:description\" content=\"Informatics Practices Class 12 Notes \u2013 Plotting Data Using Matplotlib \u2192 Data Visualisation: It refers to the graphicalor visual representation of information and data using visual elements like charts, graphs and maps, etc. The purpose of plotting data is to visualize variation or show relationships between variables. \u2192 Pyplot of Matplotlib Library: The matplotlib is … Class 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib Read More »\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/\" \/>\n<meta property=\"og:site_name\" content=\"MCQ Questions\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/NCERTSolutionsGuru\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-19T12:41:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-21T10:16:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mcq-questions.com\/wp-content\/uploads\/2022\/01\/MCQ-Questions.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ncertsolguru\" \/>\n<meta name=\"twitter:site\" content=\"@ncertsolguru\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prasanna\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mcq-questions.com\/#website\",\"url\":\"https:\/\/mcq-questions.com\/\",\"name\":\"MCQ Questions\",\"description\":\"MCQ Questions for Class 1 to 12\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mcq-questions.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i0.wp.com\/mcq-questions.com\/wp-content\/uploads\/2022\/01\/MCQ-Questions.png?fit=159%2C13&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/mcq-questions.com\/wp-content\/uploads\/2022\/01\/MCQ-Questions.png?fit=159%2C13&ssl=1\",\"width\":159,\"height\":13,\"caption\":\"MCQ Questions\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#webpage\",\"url\":\"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/\",\"name\":\"Class 12 Informatics Practices Notes \\u2013 Plotting Data Using Matplotlib - MCQ Questions\",\"isPartOf\":{\"@id\":\"https:\/\/mcq-questions.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#primaryimage\"},\"datePublished\":\"2022-02-19T12:41:36+00:00\",\"dateModified\":\"2022-02-21T10:16:02+00:00\",\"author\":{\"@id\":\"https:\/\/mcq-questions.com\/#\/schema\/person\/4ba9570f32f2057e70e670c7885e47f3\"},\"breadcrumb\":{\"@id\":\"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mcq-questions.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Class 12 Informatics Practices Notes \\u2013 Plotting Data Using Matplotlib\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/mcq-questions.com\/#\/schema\/person\/4ba9570f32f2057e70e670c7885e47f3\",\"name\":\"Prasanna\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/mcq-questions.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g\",\"caption\":\"Prasanna\"},\"url\":\"https:\/\/mcq-questions.com\/author\/prasanna\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Class 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib - MCQ Questions","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/","og_locale":"en_US","og_type":"article","og_title":"Class 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib - MCQ Questions","og_description":"Informatics Practices Class 12 Notes \u2013 Plotting Data Using Matplotlib \u2192 Data Visualisation: It refers to the graphicalor visual representation of information and data using visual elements like charts, graphs and maps, etc. The purpose of plotting data is to visualize variation or show relationships between variables. \u2192 Pyplot of Matplotlib Library: The matplotlib is … Class 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib Read More »","og_url":"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/","og_site_name":"MCQ Questions","article_publisher":"https:\/\/www.facebook.com\/NCERTSolutionsGuru\/","article_published_time":"2022-02-19T12:41:36+00:00","article_modified_time":"2022-02-21T10:16:02+00:00","og_image":[{"url":"https:\/\/mcq-questions.com\/wp-content\/uploads\/2022\/01\/MCQ-Questions.png"}],"twitter_card":"summary_large_image","twitter_creator":"@ncertsolguru","twitter_site":"@ncertsolguru","twitter_misc":{"Written by":"Prasanna","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/mcq-questions.com\/#website","url":"https:\/\/mcq-questions.com\/","name":"MCQ Questions","description":"MCQ Questions for Class 1 to 12","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mcq-questions.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#primaryimage","inLanguage":"en-US","url":"https:\/\/i0.wp.com\/mcq-questions.com\/wp-content\/uploads\/2022\/01\/MCQ-Questions.png?fit=159%2C13&ssl=1","contentUrl":"https:\/\/i0.wp.com\/mcq-questions.com\/wp-content\/uploads\/2022\/01\/MCQ-Questions.png?fit=159%2C13&ssl=1","width":159,"height":13,"caption":"MCQ Questions"},{"@type":"WebPage","@id":"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#webpage","url":"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/","name":"Class 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib - MCQ Questions","isPartOf":{"@id":"https:\/\/mcq-questions.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#primaryimage"},"datePublished":"2022-02-19T12:41:36+00:00","dateModified":"2022-02-21T10:16:02+00:00","author":{"@id":"https:\/\/mcq-questions.com\/#\/schema\/person\/4ba9570f32f2057e70e670c7885e47f3"},"breadcrumb":{"@id":"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/mcq-questions.com\/class-12-informatics-practices-notes-plotting-data-using-matplotlib\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mcq-questions.com\/"},{"@type":"ListItem","position":2,"name":"Class 12 Informatics Practices Notes \u2013 Plotting Data Using Matplotlib"}]},{"@type":"Person","@id":"https:\/\/mcq-questions.com\/#\/schema\/person\/4ba9570f32f2057e70e670c7885e47f3","name":"Prasanna","image":{"@type":"ImageObject","@id":"https:\/\/mcq-questions.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/174540ad43736c7d1a4c4f83c775e74d?s=96&d=mm&r=g","caption":"Prasanna"},"url":"https:\/\/mcq-questions.com\/author\/prasanna\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/posts\/37451"}],"collection":[{"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/comments?post=37451"}],"version-history":[{"count":5,"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/posts\/37451\/revisions"}],"predecessor-version":[{"id":37479,"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/posts\/37451\/revisions\/37479"}],"wp:attachment":[{"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/media?parent=37451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/categories?post=37451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mcq-questions.com\/wp-json\/wp\/v2\/tags?post=37451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}