codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
class Graficos(object): def __init__(self): self.rango = X self.funcion = Y self.titulo = t if m == 'f1': X = np.linspace(-100,100,1000) Y = (3*X)/(np.sqrt(X**2)) t = '(3*X)/(np.sqrt(X**2)' if m == 'f2': X = np.linspace(-100,100,1000) Y = (X+5) t = 'X+5' if m == 'f3': X = np.linspace(1,10,50) Y = (np.log (X))/X t = 'lnx/x' if m == 'f4': X = np.linspace(-100,100,1000) Y = (X*2)*(np.exp(x**2)) t = '2x *e(x**2)' def histograma (self): plt.figure ('histograma') plt.title (self.titulo) plt.hist(self.funcion,10000, self.rango) plt.show () if __name__=='__main__': m=raw_input('Introduce la funciĆ³n que quieres mostrar: ') g=Graficos() g.histograma()
Private
[
?
]
Run code
Submit