- #1
quasarLie
- 51
- 0
Hello,
I want to have multiple plot in the same figure for i=2, this is my code
Mod note: Edited the code below to prevent some array indexes from being interpreted incorrectly as BBCode italics tags.
Thanks
I want to have multiple plot in the same figure for i=2, this is my code
Mod note: Edited the code below to prevent some array indexes from being interpreted incorrectly as BBCode italics tags.
Python:
import numpy as np
import matplotlib.pyplot as plt
from math import *
from scipy.integrate import quad
import euler as md
print('Data File Name ?')
file_name = raw_input()
#print(file_name)
#file_name='spectral.dat'
print('Index')
i = int(raw_input())
print('Time Step')
N_time = int(raw_input())
print('Graph Title ?')
title = raw_input()
data=md.extraction_spectra(file_name)
data_name=['Wavelenth ', , 'Masse', 'Energy', 'Time (Myr)', 'Normalized mass (Msun)' ]if i==2:
plt.plot(data[0],data[ i][N_time])
plt.xscale('log')
plt.yscale('log')
plt.title(graph_title)
plt.xlabel(data_name[0])
plt.ylabel(data_name[ i])
plt.show()
if i==3:
plt.plot(data[1],data[ i][N_time])
plt.xscale('log')
#plt.yscale('log')
plt.title(graph_title)
plt.xlabel(data_name[1])
plt.ylabel(data_name[ i])
plt.show()
Last edited by a moderator: