Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168756
Image: ubuntu2004
#Grafico1 from pylab import * x=[1, 2, 3, 4, 5] y=x plot(x,y) xlabel('eixo x') ylabel('eixo y') suptitle('Grafico da Gaby') savefig('Graf1.png')
#Gráfico 2 clf() mu, sigma = 100,0.02 x = mu + sigma * randn(8000) # O histograma de dados hist(x, 50, normed=1, facecolor='b', alpha=50) xlabel('Capacidade de amar') ylabel('homens') title('AMOR') savefig('Graf2.png')
#Grafico3 clf() theta = arange(0,2*pi,0.001) r = sin(2*theta) r2=cos(2*theta) polar(theta, r,'b',theta, r2,'g') title('FLORES') savefig('Graf3.png')
#Gráfico 4 clf() Candidatos = 'FHC', 'Lula', 'Dilma' Votos = [40,35,25] explode=(0.05, 0.03, 0.03) pie(Votos, explode=explode, labels=Candidatos, autopct='%1.1f%%', shadow=False) title('Campanha para presidente', bbox={'facecolor':'1', 'pad':10}) savefig('Graf4.png')
#Gráfico 5 theta = arange(0,5*pi,0.001) y1 = sin(theta) y2=cos(theta) figure(1) title('FREQUENCIA') subplot(211) title('FREQUENCIA') plot(theta,y1,'k',theta,y2,'c') ylabel('seno e cosseno') subplot(212) plot(theta,y2,'b') xlabel('theta') ylabel('cosseno') savefig('Graf5.png')
#Grafico 6 clf() t = arange(0, 20, 0.01) s = cos(pi*t) fill(t,s, 'c') title('Pintando o Grafico') savefig('Graf6.png')
#Grafico 7 clf() plot([1,2,3,4,5,6],[7,8,9,10,11,12],'mv') title("pontos") savefig('Graf7.png')
#Grafico 8 clf() plot([1,2,3],[1,3,7],'m',[3,6],[7,8],'g') title('linhas') savefig('Graf8.png')
#Grafico 9 clf() d = arange(0.0, 10, 0.1) s = sin(pi*d) plot(d,s,'y') annotate('Pto O', xy=(3.5, -1),arrowprops=dict(facecolor='blue')) title('Marcando posicoes') savefig('Graf9.png')
#Gráfico 10 clf() x = arange(0,5*pi,0.001) y1 = exp(x) y2=exp(-x) figure(1) subplot(211) title('Exponencial') plot(x,y1,'k',x,y2,'c') ylabel('exp(x)') subplot(212) plot(x,y2,'b') xlabel('x') ylabel('exp(-x)') savefig('Graf10.png')