Skip to content
Snippets Groups Projects
Commit 12d83032 authored by Rafael Andrei Vinasco Soler's avatar Rafael Andrei Vinasco Soler
Browse files

primer ejercicio

parent c83ed64e
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.animation import FuncAnimation
plt.style.use('seaborn-pastel')
```
%% Cell type:code id: tags:
``` python
#tabladwarfs = np.loadtxt("./data/dwarfs.csv", skiprows=1,delimiter=',')## delimiter para decir que la separacion entre columnas es ,
#tablagiants = np.loadtxt("./data/giants.txt", skiprows=1)
#tablams = np.loadtxt("./data/ms.csv", skiprows=1,delimiter=',')
#tablasuperg = np.loadtxt("./data/supergiants.txt", skiprows=1)
## RECORDAR en datos lum,temp,radius
## Mas facil juntar todo con np.vstack()
data1 = np.loadtxt("./data/dwarfs.csv", skiprows=1,delimiter=',')
data2 = np.vstack((data1,np.loadtxt("./data/giants.txt", skiprows=1) ) )
data3 = np.vstack((data2,np.loadtxt("./data/ms.csv", skiprows=1,delimiter=',') ) )
data = np.vstack((data3,np.loadtxt("./data/supergiants.txt", skiprows=1)) )
#print(data)
```
%% Cell type:code id: tags:
``` python
plt.figure(figsize=(8,6))
n = len(lum)
lum = data[:,0]
temp = data[:,1]
radius = data[:,2]
ax = plt.subplot(111)
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
#plt.axes([0.025,0.025,0.95,0.95])
plt.yscale('log')
plt.xlim(temp.max()*1.1,temp.min()*0.7)#, plt.xticks([])
plt.ylim(lum.min()*0.3,lum.max()*7)#, plt.yticks([])
plt.scatter(temp,lum,s=10*radius, c=temp*0.5 , alpha=.5 , edgecolor='black' ,cmap = 'Spectral' )
#plt.scatter(X1,Y1,s=120, c=T2, alpha=.5)
plt.text(6500,5E-4,'DWARFS',c='Black' ,fontsize='large', fontweight=1000 )
plt.text(11000,65000 ,'Blues gigant',c='Black' ,fontsize='large', fontweight=1000 )
plt.text(6000,25000,'Super red giants',c='Black' ,fontsize='large', fontweight=1000 )
plt.text(5900,500,'red giants',c='Black' ,fontsize='large', fontweight=1000 )
plt.text(12000,3,'Main sequence',c='Black' ,fontsize='large', fontweight=1000 )
plt.text(8000,0.1,'Main sequence',c='Black' ,fontsize='large', fontweight=1000 )
plt.show()
```
%% Output
%% Cell type:code id: tags:
``` python
```
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment