Ch 4 Plotting with Pyplot II - Histograms, Frequency Distribution, Boxplots
The document explains how to plot histograms using the Pyplot library in Python, specifically utilizing the hist() function with various parameters. It distinguishes between histograms and bar charts, describes different types of histogram plots, and defines frequency polygons and boxplots. Additionally, it provides the syntax for creating boxplots with the boxplot() function.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views1 page
Ch 4 Plotting with Pyplot II - Histograms, Frequency Distribution, Boxplots
The document explains how to plot histograms using the Pyplot library in Python, specifically utilizing the hist() function with various parameters. It distinguishes between histograms and bar charts, describes different types of histogram plots, and defines frequency polygons and boxplots. Additionally, it provides the syntax for creating boxplots with the boxplot() function.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
CHECK POINT ANSWERS
CH – 4 PLOTTING WITH PYPLOT II – HISTOGRAMS, FREQUENCY DISTRIBUTION, BOXPLOTS
1. Using which function of Pyplot can you plot histograms? To plot a histogram using Pyplot the hist() function is used. Syntax: plt.hist(x, bins = , cumulative = , histtype = , align = , orientation= ) Where, a. x: An array or sequence of arrays to be plotted on histogram. b. bins: An integer is passed to divide the entire range of values into a series of intervals. c. cumulative: It is given as True or False, If True, for a bin, the value is computed as bin + all bins of the smaller values. d. histtype: It specifies the type of histogram to draw, few of the available types are – bar, barstacked, step and stepfilled. e. orientation: It is used to specify the bar-type of the histogram as horizontal or vertical. 2. Are bar charts and histograms the same? No, histogram is similar to a vertical bar graph having rectangular bars. But a histogram shows no gaps between the bars unlike a bar graph. In a bar graph data is in categories and in a histogram the result set is a continuous data series. 3. Name various types of histogram plots that you can create using pyplot. The various types of histogram plots are: a. bar: It is the traditional bar-type histogram where bars are arranged side by side. b. barstacked: It is a bar-type histogram where multiple data are stacked on top of each other. c. step: It generates a lineplot that is by default unfilled. d. stepfilled: It generates a lineplot that is by default filled. 4. What is a frequency polygon? A frequency polygon is a type of frequency distribution graph. In a frequency polygon, the number of observations is marked with a single point at the midpoint of an interval. Note: There is no Pyplot function for frequency polygon. 5. What is the use of boxplot? The boxplot is used to show the range and the middle half of the ranked data. 6. Using which function of pyplot, can you create boxplots? To create boxplots using Pyplot, the boxplot() function is used. Syntax: plt.boxplot(x, notch = , vert = , meanline = , showmeans = , showbox = )