
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)](https://content.bartleby.com/qna-images/question/05326652-a992-44c1-99fc-81105932e581/f9902c8e-dcc5-4de9-b79d-0c3bd4c0afa2/jy16ytj_thumbnail.png)

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
Step by stepSolved in 3 steps with 1 images

- write a program (its name should be StudentPoll.java) that first reads an integer, N, for the number of responses from students and then creates an array of N elements of type int to store the responses. Use SecureRandom to generate N random integers of values between 3 and 10 inclusive as the response values (i.e., the survey values) for the array. The program should print out the distribution of the survey like the following outputs. public class StudentPoll {public static void main(String[] args) {// student response array (more typically, input at runtime)int[] responses = {1, 2, 5, 4, 3, 5, 2, 1, 3, 3, 1, 4, 3, 3, 3, 2, 3, 3, 2, 14};int[] frequency = new int[6]; // array of frequency counters // for each answer, select responses element and use that value// as frequency index to determine element to increment for (int answer = 0; answer < responses.length; answer++) { try { ++frequency[responses[answer]]; } catch (ArrayIndexOutOfBoundsException e) { System.out.println(e); //…arrow_forwardCan you annotate this code. from random import randint t = ["R", "P", "S"] computer = t[randint(0,2)] player = Falsecom=0pl=0 while player == False:print("Computer's choice is",computer)player = input("Enter R for Rock, P for Paper and S for Scissors: ")if player == computer:print("Its a tie")elif player == "R":if computer == "P":print("OOPS you loose", computer, "covers", player)com+=1else:print(" Hurray! You win!", player, "smashes", computer)pl+=1elif player == "P":if computer == "S":print("OOPS you loose", computer, "cut", player)com+=1else:print(" Hurray! ", player, "covers", computer)pl+=1elif player == "S":if computer == "R":print("OOPS you loose", computer, "smashes", player)com+=1else:print(" Hurray! You win!", player, "cut", computer)pl+=1else:print("Invalid input , Please Enter a valid input")print("player: ",pl)print("computer: ",com)player = Falsecomputer = t[randint(0,2)]arrow_forwardCan you help me fix my code in Java, please? I am stuck to keep going. Thank youarrow_forward
- Write a method that computes how often each letter A-Z or a-z occurs in a string. Don't distinguish between upper- and lowercase letters. Return an array of length 26. The ith element contains the number of times that the letter 'a' + i or 'A' + i occurs in the string. The string may contain other characters that you should simply skip.arrow_forwardThis question is in java The Sorts.java file is the sorting program we looked at . You can use either method listed in the example when coding. You want to add to the grades.java and calculations.java files so you put the list in numerical order. Write methods to find the median and the range. Have a toString method that prints the ordered list, the number of items in the list, the mean, median and range. Ex List: 20 , 30 , 40 , 75 , 93Number of elements: 5Mean: 51.60Median: 40Range: 73 Grades.java is the main file import java.util.Scanner;public class grades { public static void main(String[] args) { int n; calculation c = new calculation(); int array[] = new int[20]; System.out.print("Enter number of grades that are to be entered: "); Scanner scan = new Scanner(System.in); n = scan.nextInt(); System.out.println("Enter the grades: "); for(int i=0; i<n; i++) { array[i] = scan.nextInt(); if(array[i] < 0) {…arrow_forwardGiven a string, write a method that returns the number of occurrences of substrings "baba" or "mama" in the input string recursively. They may overlap. Do not use any loops within your code. Do not use any regular expressions and methods such as matches, split, replaceAll. "Maa mana, Test case 1: countBabaMama ("aba babaa amama ma") 2 Test case 2: countBabaMama ("bababamamama") 4arrow_forward
- I need help finding out what to put in the: encryptedArray[index] = encrypt(messageArray);//pass something to encrypt from the array System.out.print(messageArray);//print encrypted version portion of the coding as well as how to call the "encryptAll" methodarrow_forwardThis Python Code keeps giving me errors. Please help me fix it. import matplotlib.pyplot as pltimport numpy as npimport randomimport seaborn as snsrolls = [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')print(axes.set_title(title))print(axes.set(xlabel='Die Value', ylabel='Frequency'))print(axes.set_ylim(top=max(frequencies) * 1.10))for bar, frequency in zip(axes.patches, frequencies):text_x = bar.get_x() + bar.get_width() / 2.0text_y = bar.get_height()text = f'{frequency:,}\n{frequency / len(rolls):.3%}'axes.text(text_x, text_y, text,fontsize=11, ha='center', va='bottom')plt.cla()%recall 5rolls = [random.randrange(1, 7) for i in range(600)]rolls = [random.randrange(1, 7) for i in range(60000)]%recall 6-13values, frequencies = np.unique(rolls, return_counts=True)title = f'Rolling a Six-Sided…arrow_forwardI need help with this Java problem to output as it's explained in this image below: Ex: If input is 84 72 19 61 19 84 then output is: List after inserting 84: 84 List after inserting 72: 72 84 List after inserting 19: 19 72 84 List after inserting 61: 19 61 72 84 List after removing 19: 61 72 84 List after removing 84: 61 72 LabProgram.java code below (Needs editing) import java.util.Scanner; import java.io.PrintWriter; public class LabProgram { // Prints the SortedNumberList's contents, in order from head to tail public static void printList(SortedNumberList list) { Node node = list.head; while (null != node) { System.out.print(node.getData() + " "); node = node.getNext(); } System.out.println(); } public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String inputLine; // Read the line of input numbers inputLine = scnr.nextLine(); // Split on space character String[] terms = inputLine.split(" "); // Insert each value and show the…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





