How come import matplotlib.pyplot as plt is not working. This is the code for python import matplotlib.pyplot as plt import numpy as np import random import seaborn as sns

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

How come import matplotlib.pyplot as plt is not working. This is the code for python

import matplotlib.pyplot as plt
import numpy as np
import random
import seaborn as sns
rolls = [random.randrange(1, 7) for i in range(600)]
values, frequencies = np.unique(rolls, return_counts=True)
title = f'Rolling a Six-Sided Die {len(rolls):,} Times'
sns.set_style('whitegrid')
axes = sns.barplot(x=values, y=frequencies, palette='bright')
axes.set_title(title)

import matplotlib.pyplot as plt
import numpy as np
import random
import seaborn as sns
rolls = [random.randrange (1, 7) for i in range (600)]
volues, frequencies = np. unique (rolls, return_counts=True)
title= f'Rolling a Six-Sided Die (len (rolls):,} Times'
sns.set_style('whitegrid')
axes = sns.barplot(x=values, y=frequencies, palette='bright')
axes.set_title(title)
Transcribed Image Text:import matplotlib.pyplot as plt import numpy as np import random import seaborn as sns rolls = [random.randrange (1, 7) for i in range (600)] volues, frequencies = np. unique (rolls, return_counts=True) title= f'Rolling a Six-Sided Die (len (rolls):,} Times' sns.set_style('whitegrid') axes = sns.barplot(x=values, y=frequencies, palette='bright') axes.set_title(title)
Expert Solution
Step 1

I am providing you with the running code and output below.

 

The problem which I think is not in your code it's in the platform or IDE in which you are running the code as below you can see I have pasted the same code that you have written and it is working fine for me. So, I suggest if you are working on Data Visualization then instead of using any other IDE you can use anaconda. 

 

I am also running it on anaconda only and haven't faced any problems.

Links to download Anaconda:

https://www.anaconda.com/products/distribution

 

The process of downloading, installing, and running anaconda is very simple , and below are the steps

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY