python code to create scatter plot of the data given in the screenshot.  Plot a scatterplot using python of lung cancer deaths against cigarettes sales, using the two letter abbreviation for each US state as the marker.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

python code to create scatter plot of the data given in the screenshot. 

Plot a scatterplot using python of lung cancer deaths against cigarettes sales, using the two letter abbreviation for each US state as the marker. 

CHZSTREAZ29222222≥ ≥ 25XZAHNSENERE
STATE CIG BLAD LUNG KID LEUK
17.05 1.59
6.15
19.80 2.75
6.61
15.98 2.02
6.94
22.07 2.66 7.06
22.83 3.35
7.20
27.27 3.13
7.08
24.55 3.36
6.45
23.57 2.41
6.07
13.58 2.46
6.62
22.80 2.95 7.27
20.30 2.81
7.00
16.59 2.90
7.69
16.84 2.88
7.42
17.71 2.13
6.41
25.45 2.30
20.94 3.22
26.48 2.85
22.04 3.03
22.72 2.97
AL
DC
DE
FL
ID
IL
IN
IO
KS
KY
LA
ME
MD
MA
MI
MN
MS
ΜΟ
MT
NB
NE
NJ
NM
NY
ND 19.96 2.89
PE
OH 26.38 4.47
RI
ОК 23.44 2.93
SD
23.78 4.89
29.18 4.99
SC 18.06 3.25
20.94 3.64
20.08 2.94
22.57 3.21
14.00 3.31
25.89 4.63
21.17 4.04
21.25 5.14
22.86 4.78
28.04 3.20
30.34 3.46
ΤΕ
TX
UT
VT
18.20 2.90
25.82 3.52
WA
18.24 2.99
WI
28.60 4.46
31.10 5.11
40.46 5.6
33.60 4.78
28.27 4.46
20.10 3.08
27.91 4.75
26.18 4.09
22.12 4.23
21.84 2.91
23.44 2.86
WV
21.58 4.65
28.92 4.79
25.91 5.21
26.92 4.69
24.96 5.27
22.06 3.72
16.08 3.06
27.56 4.04
23.75 3.95
23.32 3.72
42.4 6.54
28.64 5.98
21.16 2.90
29.14 5.30
WY
AK
14.20 3.54
15.60 1.77
20.98 2.55
19.50 3.43
16.70 2.92
23.03 2.85
25.95 3.12
14.59 2.52
25.02 3.10
12.12 3.62
21.89 2.95
19.45 2.45
12.11 2.75
23.68 2.84
17.45 2.05
14.11 3.11
6.71
6.24
6.81
6.89
6.91
20.55 2.34
15.53 3.28
15.92 2.66
25.88 4.32
8.28
6.08
6.82
6.90
7.80
6.67
7.12
5.95
7.23
6.99
7.38
7.46
6.83
6.35
5.82
8.15
17.60 2.18
20.74 2.69
12.01 2.20 6.71
21.22 3.17 6.56
20.34 2.78
6.59
7.02
7.48
6.73
7.38
5.78
4.90
Transcribed Image Text:CHZSTREAZ29222222≥ ≥ 25XZAHNSENERE STATE CIG BLAD LUNG KID LEUK 17.05 1.59 6.15 19.80 2.75 6.61 15.98 2.02 6.94 22.07 2.66 7.06 22.83 3.35 7.20 27.27 3.13 7.08 24.55 3.36 6.45 23.57 2.41 6.07 13.58 2.46 6.62 22.80 2.95 7.27 20.30 2.81 7.00 16.59 2.90 7.69 16.84 2.88 7.42 17.71 2.13 6.41 25.45 2.30 20.94 3.22 26.48 2.85 22.04 3.03 22.72 2.97 AL DC DE FL ID IL IN IO KS KY LA ME MD MA MI MN MS ΜΟ MT NB NE NJ NM NY ND 19.96 2.89 PE OH 26.38 4.47 RI ОК 23.44 2.93 SD 23.78 4.89 29.18 4.99 SC 18.06 3.25 20.94 3.64 20.08 2.94 22.57 3.21 14.00 3.31 25.89 4.63 21.17 4.04 21.25 5.14 22.86 4.78 28.04 3.20 30.34 3.46 ΤΕ TX UT VT 18.20 2.90 25.82 3.52 WA 18.24 2.99 WI 28.60 4.46 31.10 5.11 40.46 5.6 33.60 4.78 28.27 4.46 20.10 3.08 27.91 4.75 26.18 4.09 22.12 4.23 21.84 2.91 23.44 2.86 WV 21.58 4.65 28.92 4.79 25.91 5.21 26.92 4.69 24.96 5.27 22.06 3.72 16.08 3.06 27.56 4.04 23.75 3.95 23.32 3.72 42.4 6.54 28.64 5.98 21.16 2.90 29.14 5.30 WY AK 14.20 3.54 15.60 1.77 20.98 2.55 19.50 3.43 16.70 2.92 23.03 2.85 25.95 3.12 14.59 2.52 25.02 3.10 12.12 3.62 21.89 2.95 19.45 2.45 12.11 2.75 23.68 2.84 17.45 2.05 14.11 3.11 6.71 6.24 6.81 6.89 6.91 20.55 2.34 15.53 3.28 15.92 2.66 25.88 4.32 8.28 6.08 6.82 6.90 7.80 6.67 7.12 5.95 7.23 6.99 7.38 7.46 6.83 6.35 5.82 8.15 17.60 2.18 20.74 2.69 12.01 2.20 6.71 21.22 3.17 6.56 20.34 2.78 6.59 7.02 7.48 6.73 7.38 5.78 4.90
Expert Solution
Step 1: Introduction

Creating a scatter plot to visualize the relationship between cigarette sales and lung cancer deaths across different U.S. states can be a useful way to identify trends or patterns in the data. This kind of visualization can serve various purposes: from healthcare policy planning to public awareness programs. Python's matplotlib library provides the necessary tools to create such a scatter plot easily.

Algorithm


  1. Data Preparation: Load the data, which is represented as a list of dictionaries. Each dictionary contains information about a U.S. state, such as its abbreviation, cigarette sales, and lung cancer deaths.

  2. Data Extraction: Separate the data into distinct lists for state abbreviations, cigarette sales, and lung cancer deaths.

  3. Plot Initialization: Initialize a new scatter plot using matplotlib.

  4. Data Plotting: Plot the extracted cigarette sales and lung cancer deaths data points on the scatter plot.

  5. Annotation: Annotate each data point with the corresponding state's two-letter abbreviation.

  6. Axis Labeling and Titling: Label the x-axis and y-axis and provide a title for the scatter plot.

  7. Display Plot: Finally, display the plot for visual analysis.

The list of first 10 rows data has been given in the code. To produce the full chart, you just need to add other row's data

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education