このコードで私はこの種の画像をプロットしようとしています:this image is made by powerpoint] 1しかし、私はそれを得ることができません、私はこれを得ています:。いずれもPythonの矢印接続スタイルで助けてくれますか?私がお聞きしたい最も重要なことは、どのように私は特定の方向に矢印を回し、私は、注釈パラメータは、開始時にテキストをとり、画像1天体物理学モデルの矢印接続スタイルの問題
from __future__ import division
import numpy as np
import fileinput
import os
import shutil
import time
import matplotlib.pyplot as plt
from matplotlib import cm
start_time = time.time()
colors = ['red','blue','sienna','black', 'orange','olive' , 'green', 'brown',\
'coral', 'aqua', 'y', 'purple', 'orchid', 'c', 'peru', 'darkcyan',\
'm', 'darkgoldenrod', 'lime', 'teal', 'indianred', 'lawngreen', 'tan', 'navy', 'pink' ]
#~ electron_density= [1]
hden = [2]
D = [ '15.0','15.50', '16.0', '16.50', '17.0', '17.10', '17.20', '17.30', '17.40', '17.50',\
'17.60', '17.70', '17.80', '17.90', '18.0', '18.10', '18.20', '18.30', '18.40', '18.50', \
'19.0', '19.50', '20.0', '20.50', '21.0'] #NHI
ionz = ['-3.4768207','-3.1768207', '-2.9768207', '-2.7768207', '-2.4768207', '-2.1768207', '-1.9768207', '-1.7768207', '-1.4768207'] #ionization parameter U
#~ ionz = ['-1.4768207']
#~ N = ["z001", "z002", "z003", "z004", "z006", "z008", "z010", "z020"]
#~ N = ["z001", "z002", "z003", "z004", "z006", "z008"]
#~ N = ["z001", "z002", "z003", "z004"]
#~ N = ["z001", "z002"]
N = ["z001"]
#~ age = ["6.0", "6.3", "6.5", "6.7", "6.9", "7.0", "7.3", "7.5", "7.7", "7.9", "8.0", "8.3", "8.5", "8.7", "8.9" ]
#~ age = ["7.0", "7.3", "7.5", "7.7", "7.9", "8.0", "8.3", "8.5", "8.7", "8.9" ]
age = ["6.0"]
#~
colors = ['red','blue','sienna', 'orange', 'yellow' ,'lime', 'brown',\
'coral', 'aqua', 'y', 'purple', 'black','orchid', 'olive' ,'c', 'peru', 'darkcyan',\
'm', 'darkgoldenrod', 'pink', 'teal', 'indianred', 'lawngreen', 'tan', 'navy', 'green' ]
grey = np.linspace(0,1,25)
ratio = [ 'He2Hb_ratio','He2Hb_4686_ratio', 'C4C3_ratio', 'Si4Hb_ratio']
#~ fesc = [99, 99, 98, 95, 86, 83, 80, 75, 70, 63, 56, 48, 40, 31, 24, 18, 13, 9, 7, 4.0, 0.3, 0.0, 0.0, 0.0, 0.0]
fesc = [99, 99, 98, 95, 86, 83, 80, 75, 70, 63, 56, 48, 40, 31, 24, 18, 13, 9, 7, 4.0, 0.3, 0.0, 0.0, 0.0, 0.0]
r1 = 3
r2 = 1
#~ ~~~~~~~~~~~~~~~~~~~~~~~~~~Ionization parameter~~~~~~~~~~~~~~~~~~~~~~~
for a in np.arange(len(age)):
\t for n in np.arange(len(N)) :
\t \t link = '/home/evol/gsharma/cloudy_work/for_report/final_fig_codes/data/hden_'+str(hden[0])+'/line_ratios/age_'+age[a]+'_'+N[n]+'' #func of NHI_U
\t \t xx = np.transpose(np.loadtxt(''+link+'/'+ratio[r1]+'.txt'))
\t \t yy = np.transpose(np.loadtxt(''+link+'/'+ratio[r2]+'.txt'))
\t \t for m in np.arange(len(ionz)):
\t \t \t for f in np.arange(len(fesc)):
\t \t \t \t if fesc[f]>=1:
\t \t \t \t \t plt.plot(yy[m,f], xx[m,f], 'o-', color= ''+str(grey[f])+'')
\t \t \t \t if fesc[f]<1:
\t \t \t \t \t plt.plot(yy[m,f], xx[m,f], 'o-', color= ''+colors[m]+'')
plt.annotate("increasing U",
xy=(-3.6,-1.1), xycoords='data',
xytext=(-3.7, -2.9), textcoords='data',
arrowprops=dict(arrowstyle="->",
connectionstyle="arc"),
)
\t
plt.xlabel('log([SiIV]_1393/H_beta)')
plt.ylabel('log([HeII]_4686/H_beta)')
plt.title('SiIV/Hbeta Vs HeII/Hbeta line ratios \n fesc_U::\ hden_'+str(hden[0])+', fix age , fix Z ')
plt.grid(True)
plt.show()
ありがとう、@ tautastic、その作業:) –