Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
29 views
Matplotlib
Uploaded by
Luân Nguyễn Thành
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Matplotlib For Later
Download
Save
Save Matplotlib For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
29 views
Matplotlib
Uploaded by
Luân Nguyễn Thành
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Matplotlib For Later
Carousel Previous
Carousel Next
Save
Save Matplotlib For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 8
Search
Fullscreen
Data Visualization with Matplotlib 1 Line Plot - Bar Chart - Scatter Diagram - Histogram 1.1 Create the x variable with 200 elements from -10 to 10. Create the y variable which has the sine (np.sin()) of x. Requirements: * Plot the curve [16]: from matplotlib import pyplot as plt import numpy as np x = mp.linspace(~10 y > mp.sin(x) plt.plot(x.y) plt.show() 0,200) 100 075 050 0.25 0.00 -0.25 0.50 -0.75 -1.00 -100 -75 -50 -25 00 25 50 75 100 « plot the elements of x (above exercise): ith an x ith a green 0ra (2a): 75 -50 -25 00 25 50 75 100 10.0 100 075 050 025 0.00 0.25 0.50 075 -1.00 100 075 75 50 -25 00 25 50 75 100 -10.0 '* Plot only the elements: = from the index 50 to 80 — from the index 51 to 56 (22):1.00 075 050 025 0.00 0.25 0.50 075 1.000 0.995 0990 0.985 0.980 0975 0970 485 -480 475 -470 465 4.60 -455 -4.50 1.2 Given the dataset weight-height.csv. Generate plots described as follows: © use dil].values to get a numpy array out of the data-frame columns * plot the height vs weight (23):250 200 150 100 55. oO 6 70 B 0 © plot the male with blue and female with red in the same plot (2a): [27 250 200 180 100 1.3. Given a esv file ‘company-sales.csv’. Generate line plots describe as follows: © Read the Total profit of all months and show it using a line plot © The Total profit data is provided for each month. Generated line plot must incnde the following properties:— X label name = Month Number — ¥ label name = Total profit, (37): [27 Cc fit per ith sooo00 ‘ompany profit per mont 400000 300000 200000 100000 12 3 4 5 6 7 8 9 DU DB Month number '* Get Total profit of all months and show line plot with the following Style properties: — Line Style dotted and Line-color should be red Show legend at the lower right location. ~ X label name — Month Number ~ ¥ label name = Sold units number — Add a circle marker. ¢ Line marker color as read # Line width should be 3 (29): (77(at): 500000 400000 300000 Profit in dollar 200000 100000 Company Sales data of last year “®- Profit data of last year 12 3 4 5 6 7 8 3 DU DB Month Number ‘* Read all product sales data and show it using a multiline plot 18000 15000 12000 10000 8000 6000 Sales units in number 4000 2000 1000 Sales data “—® Face cream Sales Data “-® Face Wash Sales Data —® bothPaste Sales Data —@ ‘bothPaste Sales Data © bothPaste Sales Data —® ‘othPaste Sales Data BOSSE ees 12 3 4 5 6 7 8 3 DU DR Month Number ‘© Read face cream and facewash product sales data and show it using the bar chart 6(33): (38): import pandas as pd import matplotlib.pyplot as plt af = pd.read_csv("conpany-sales.csv") nonthList = df [‘month_nunber'] values faceCrenSalesData ~ df ['facecrean'] values facelWashSalesData = df ['facewash'].values pit.bar([a-0.25 for a in monthList], faceCrenSalesData, width~ 0.25, label =, »'Face Cream sales data’, align-'edge') plt.bar({a+0.25 for a in monthList], faceWashSalesData, widt! 'Face Wash sales data’, align-'edge') plt.xlabel('Month Number") pit ylabel('Sales units in number') plt.legend(loc-' upper left") plt.title(" Sales data’) pit.xticks(monthList) plt.grid(True, linewidth- 1, linestyle-"--") plt.title('Facewash and facecream sales data') pltshow() 0.25, label Facewash and facecream sales data lm Face Cream sales data | 3500 J gum Face Wash sales data | 3000 2500 2000 1500 Sales units in number 1000 500 123 4 5 6 7 8 3 DU DR Month Number ‘* Read the total profit of each month and show it using the histogram to see most: common profit ranges 7Actual Profit in dollar Profit data rs w N lm Profit data ol 150000 175000 200000 225000250000 300000 350000 profit range in dollar ‘* Read Bathing soap facewash of all months and display it using the Subplot (36): | 77 Sales units in number 12500 10000 7500 2000 1500 Sales data of a Bathingsoap Sales data of a facewash w 4 5 6 7 8 3 DU DB
You might also like
Case Study
PDF
50% (2)
Case Study
8 pages
Assignment: Master in Business Administration
PDF
No ratings yet
Assignment: Master in Business Administration
18 pages
Assignment 3
PDF
No ratings yet
Assignment 3
10 pages
Python Data Visualization Worksheet: Properties
PDF
No ratings yet
Python Data Visualization Worksheet: Properties
2 pages
Assignment 4 On Visualization On Graph With Solution
PDF
No ratings yet
Assignment 4 On Visualization On Graph With Solution
14 pages
Visualisation All
PDF
0% (1)
Visualisation All
70 pages
Unit 1 Pandas - Charts
PDF
No ratings yet
Unit 1 Pandas - Charts
18 pages
Python Pyplot Assignment No 4
PDF
No ratings yet
Python Pyplot Assignment No 4
5 pages
Data Visualisation using Python Matplotlib codes for class 12th ip
PDF
No ratings yet
Data Visualisation using Python Matplotlib codes for class 12th ip
13 pages
Unit 4 python
PDF
No ratings yet
Unit 4 python
12 pages
12-data visualization-1
PDF
No ratings yet
12-data visualization-1
26 pages
program16.0
PDF
No ratings yet
program16.0
6 pages
Unit Iv Notes Class 12
PDF
No ratings yet
Unit Iv Notes Class 12
22 pages
Data Collection and Data Cleaning: Next Connect To The Drive
PDF
No ratings yet
Data Collection and Data Cleaning: Next Connect To The Drive
16 pages
Data Science With Python - Lesson 10 - Data Visualization in Python With Matplotlib - Raw
PDF
No ratings yet
Data Science With Python - Lesson 10 - Data Visualization in Python With Matplotlib - Raw
71 pages
Cap 793
PDF
No ratings yet
Cap 793
17 pages
Data Science Unit 2-11-08 2023
PDF
No ratings yet
Data Science Unit 2-11-08 2023
78 pages
DS3.1
PDF
No ratings yet
DS3.1
8 pages
2303A54054 - Lab Assignment 1 - Colab
PDF
No ratings yet
2303A54054 - Lab Assignment 1 - Colab
6 pages
Data Visualization
PDF
No ratings yet
Data Visualization
28 pages
DVPD Final Lab Word PDF
PDF
No ratings yet
DVPD Final Lab Word PDF
93 pages
Ex1_Plotting and Visualization using Numpy and Pandas
PDF
No ratings yet
Ex1_Plotting and Visualization using Numpy and Pandas
14 pages
Data Visualizations in Python With Matplotlib: Sidita Duli, PHD
PDF
No ratings yet
Data Visualizations in Python With Matplotlib: Sidita Duli, PHD
6 pages
BIDA practical print
PDF
No ratings yet
BIDA practical print
56 pages
UNIT - 1 EDA Continuation
PDF
No ratings yet
UNIT - 1 EDA Continuation
113 pages
a9bf73_Introduction to Matplotlib
PDF
No ratings yet
a9bf73_Introduction to Matplotlib
18 pages
End semester Answer key format-fods
PDF
No ratings yet
End semester Answer key format-fods
8 pages
Practical Graph
PDF
No ratings yet
Practical Graph
8 pages
Data Visualization Using Matplotlib
PDF
No ratings yet
Data Visualization Using Matplotlib
30 pages
Data Visulization
PDF
No ratings yet
Data Visulization
2 pages
Class 1 Data Visualization in Python using matplotlib
PDF
No ratings yet
Class 1 Data Visualization in Python using matplotlib
13 pages
Data Visualization
PDF
No ratings yet
Data Visualization
48 pages
Data Visual Iz
PDF
No ratings yet
Data Visual Iz
54 pages
L5 6 DataViz
PDF
No ratings yet
L5 6 DataViz
79 pages
Ch 4 Plotting Data Using Mathplotlib 2024-25
PDF
No ratings yet
Ch 4 Plotting Data Using Mathplotlib 2024-25
29 pages
Notebook Visualizing Data Book
PDF
No ratings yet
Notebook Visualizing Data Book
19 pages
Data Visualization With Python
PDF
No ratings yet
Data Visualization With Python
34 pages
XII-DataVisualization
PDF
No ratings yet
XII-DataVisualization
34 pages
Data Visualization - Matplotlib PDF
PDF
100% (1)
Data Visualization - Matplotlib PDF
15 pages
Mat Plot Lib
PDF
No ratings yet
Mat Plot Lib
22 pages
XII-IP - Data Visualisation
PDF
No ratings yet
XII-IP - Data Visualisation
65 pages
Retail Analysis Walmart
PDF
No ratings yet
Retail Analysis Walmart
18 pages
Unit 4 Data Visualization using Matplotlib - Copy
PDF
No ratings yet
Unit 4 Data Visualization using Matplotlib - Copy
42 pages
CS1010S Lecture 11 - Visualising Data
PDF
No ratings yet
CS1010S Lecture 11 - Visualising Data
68 pages
Pyplot
PDF
No ratings yet
Pyplot
14 pages
Notes9_Class_10_Data Visualization using MatPlotlib Notes
PDF
No ratings yet
Notes9_Class_10_Data Visualization using MatPlotlib Notes
5 pages
Data Visulation
PDF
No ratings yet
Data Visulation
8 pages
Python Exp 11
PDF
No ratings yet
Python Exp 11
5 pages
Unit 6 Data Visualization-1
PDF
No ratings yet
Unit 6 Data Visualization-1
30 pages
Python Dataviz
PDF
No ratings yet
Python Dataviz
16 pages
prac2
PDF
No ratings yet
prac2
11 pages
Ds 1
PDF
No ratings yet
Ds 1
37 pages
RM-Subplots, Scatter Plots and Reading Image – Tutorial
PDF
No ratings yet
RM-Subplots, Scatter Plots and Reading Image – Tutorial
14 pages
DOC-20250118-WA0002.
PDF
No ratings yet
DOC-20250118-WA0002.
4 pages
Data Visualization With Python Libraries
PDF
No ratings yet
Data Visualization With Python Libraries
13 pages
Python Pandas and Matplotlib 7
PDF
100% (3)
Python Pandas and Matplotlib 7
72 pages
lec20
PDF
No ratings yet
lec20
24 pages
Be A 65 Ads Exp 2
PDF
No ratings yet
Be A 65 Ads Exp 2
10 pages