Skip to content
Sign upLog in
← Back to Community

unable to plot the graph

Profile icon
Karthik27

i am unable to plot the graph

using matplotlib.pyplo to plot but the graph is not display when i run the code, let me know if i need to install any packages

Below is my code

import numpy
from scipy import stats
import math
import matplotlib.pyplot as plt

speed = [99,86,87,88,111,86,103,87,94,78,77,85,86]

speed1 = [86,87,88,86,87,85,86]

speed2 = [32,111,138,28,59,77,97]

ages = [5,31,43,48,50,41,7,11,15,39,80,82,32,2,8,6,25,36,27,61,31]

rdm =numpy.random.uniform(0.0,2.0,10)
print(rdm)
rdm1=numpy.random.normal(10,1.0,10)
print(rdm1)
print(numpy.mean(rdm1))

'''mean=numpy.mean(speed)
print(mean)

median=numpy.median(speed)
print(median)

mode=stats.mode(speed)
print(mode)

LSD = numpy.std(speed1)
print(LSD)

HSD =numpy.std(speed2)
print(HSD)

var = numpy.var(speed2)
print(var)
print(math.sqrt(var))

per=numpy.percentile(ages,75)
print(per)'''

plt.hist(rdm,10)
plt.show()

Voters
Profile icon
AngusChung
Profile icon
Karthik27
Comments
hotnewtop
Profile icon
HackermonDev

You have to use a python with turtle repl. https://repl.it/languages/python_turtle

Profile icon
Karthik27

But there i am not able to import numpy [email protected]

Profile icon
HackermonDev

@Karthik27
just realized that. I don't know then.

Profile icon
Karthik27

thanks you

@PDanielY

Profile icon
Vandesm14

@Karthik27
If
@PDanielY
answered your question, be sure to mark his comment as the answer!