Ir para conteúdo
Fórum Script Brasil

victoraguiar

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Tudo que victoraguiar postou

  1. Fala galera, tudo bom? Tou tentando plotar um diagrama T-S aqui porém, ocorre um erro: ValueError: zero-size array to reduction operation minimum which has no identity. Alguém sabe como proceder? Valeu. Código: import numpy as np import matplotlib.pyplot as plt import seawater as gsw y, x = np.loadtxt(r'.txt',dtype='float',delimiter=None, unpack=True) y1, x1 = np.loadtxt(r'.txt',dtype='float',delimiter=None, unpack=True) sal = x temp = x1 y = y1 smin = sal.min() - (0.01 * sal.min()) smax = sal.max() + (0.01 * sal.max()) tmin = temp.min() - (0.1 * temp.max()) tmax = temp.max() + (0.1 * temp.max()) xdim = round((smax-smin)/0.1+1,0) ydim = round((tmax-tmin)+1,0) dens = np.zeros((ydim,xdim)) ti = np.linspace(1,ydim-1,ydim)+tmin si = np.linspace(1,xdim-1,xdim)*0.1+smin fig1 = plt.figure() ax1 = fig1.add_subplot(111) CS = plt.contour(si, ti, dens, linestyles='dashed', colors='k') plt.clabel(CS, fontsize=12, inline=1, fmt='%1.0f') # Label every second level ax1.plot(sal,temp,'or',markersize=9) ax1.set_xlabel('Salinity') ax1.set_ylabel('Temperature (C)') plt.show()
×
×
  • Criar Novo...