## Archivo de datos "state33" obtenido de: ftp://ftp.ncdc.noaa.gov/pub/data/ushcn/daily/READMEimportar gzip importar numpy como np importar matplotlib.pyplot como pltfid = gzip . abierto ( "state33.gz" )mes1 = 3 mes2 = 7M1 , M2 = [], [] para la línea en fid : stid = int ( línea [ 0 : 7 ]) if línea [ 7 : 11 ] == "TMAX" : mes = int ( línea [ 17 : 19 ]) nday = int ( línea [ 20 : 22 ]) if mo no en [ mes1 , mes2 ]: continuar V , ii = [], 26 para k en gama ( nday ): V . adjuntar( float ( línea [ ii : ii + 2 ])) ii + = 8 si mo == mes1 : M1 . extender ( V ) si mo == mes2 : M2 . extender ( V )M1 = np . matriz ( np . sort ( M1 )) M2 = np . matriz ( np . sort ( M2 ))M1 = M1 [ M1 ! = 99 ] M2 = M2 [ M2 ! = 99 ]M1 = ( M1 - M1 . Media ()) / M1 . std () M2 = ( M2 - M2 . media ()) / M2 . std ()Q1 = [ M1 [ int ( q * len ( M1 ))] para q en np . arange ( 1 , 1000 , dtype = np . float64 ) / 1000 ] Q2 = [ M2 [ int ( q * len ( M2 ))] para q en np . arange ( 1 , 1000 ,dtype = np . float64 ) / 1000 ]P1 = [ M1 [ int ( q * len ( M1 ))] para q en np . arange ( 1 , 10 , dtype = np . float64 ) / 10 ] P2 = [ M2 [ int ( q * len ( M2 ))] para q en np . arange ( 1 , 10 ,dtype = np . float64 ) / 10 ]plt . clf () plt . figura ( tamaño de la figura = ( 4 , 3.5 )) plt . ejes ([ 0.15 , 0.15 , 0.8 , 0.8 ]) plt . cuadrícula ( Verdadero ) plt . plot ( Q1 , Q2 , '-' , color = "gris" , lw = 3 ) plt . mantener ( Verdadero) plt . plot ([ - 3 , 3 ], [ - 3 , 3 ], '-' , color = 'negro' ) plt . plot ( P1 , P2 , 'o' , mec = 'negro' , mfc = 'rojo' ) plt . xlim ( - 2 , 3 ) plt . ylim ( - 2 , 3) plt . xlabel ( "marzo" , tamaño = 14 ) plt . ylabel ( "julio" , tamaño = 14 ) plt . savefig ( "ohio_temps_qq.pdf" ) plt . savefig ( "ohio_temps_qq.svg" )