Python graph plot script | |||
작성일 | 2022-12-19 | 조회수 | 96 |
---|---|---|---|
첨부파일 | |||
import pandas as pd import matplotlib.pyplot as plt import numpy as np import matplotlib.gridspec as gridspec
data0 = pd.read_csv('/data/siwon/mmdetection/paper/csv_SSD.csv') data1 = pd.read_csv('/data/siwon/mmdetection/paper/csv_TF.csv') data2 = pd.read_csv('/data/siwon/mmdetection/paper/csv_r50.csv') data3 = pd.read_csv('/data/siwon/mmdetection/paper/csv_r101.csv') data4 = pd.read_csv('/data/siwon/mmdetection/paper/csv_x101.csv')
# csv_SSD total_human00 = data0.loc[:, 'real_tl'] total_ai00 = data0.loc[:, 'TL']
total_human01 = data0.loc[:, 'real_fl'] total_ai01 = data0.loc[:, 'FL']
# csv_TF total_human10 = data1.loc[:, 'real_tl'] total_ai10 = data1.loc[:, 'TL']
total_human11 = data1.loc[:, 'real_fl'] total_ai11 = data1.loc[:, 'FL']
# csv_r50 total_human20 = data2.loc[:, 'real_tl'] total_ai20 = data2.loc[:, 'TL']
total_human21 = data2.loc[:, 'real_fl'] total_ai21 = data2.loc[:, 'FL']
# csv_r101 total_human30 = data3.loc[:, 'real_tl'] total_ai30 = data3.loc[:, 'TL']
total_human31 = data3.loc[:, 'real_fl'] total_ai31 = data3.loc[:, 'FL']
# csv_x101 total_human40 = data4.loc[:, 'real_tl'] total_ai40 = data4.loc[:, 'TL']
total_human41 = data4.loc[:, 'real_fl'] total_ai41 = data4.loc[:, 'FL']
# SUBPLOT plt.rc('ytick', labelsize=15) plt.rc('xtick', labelsize=15)
fig, axs = plt.subplots(5, 1, sharex='col', sharey='row', figsize=(7,14)) xticks = [i for i in range(55,80,5)] fig.subplots_adjust(hspace=0.0) fig.suptitle('Fork Length(FL)', fontsize=30)
axs[0].scatter(total_human01,total_ai01,label='SSD (Mobilenet v2 FPN-lite)') axs[0].plot([55,75], [55,75], color='dodgerblue', linestyle='--') axs[0].legend(fontsize=13) axs[1].scatter(total_human11,total_ai11,label='Mask R-CNN (Inception ResNet v2)') axs[1].plot([55,75], [55,75], color='dodgerblue', linestyle='--') axs[1].legend(fontsize=13) axs[2].scatter(total_human21,total_ai21,label='Mask R-CNN (ResNet50)') axs[2].plot([55,75], [55,75], color='dodgerblue', linestyle='--') axs[2].legend(fontsize=13) axs[2].set_ylabel('Inferred value', fontsize=20) axs[3].scatter(total_human31,total_ai31,label='Mask R-CNN (ResNet101)') axs[3].plot([55,75], [55,75], color='dodgerblue', linestyle='--') axs[3].legend(fontsize=13) axs[4].scatter(total_human41,total_ai41,label='Mask R-CNN (ResNext101)') axs[4].plot([55,75], [55,75], color='dodgerblue', linestyle='--') axs[4].legend(fontsize=13) #plt.setp(axs, ylim=axs[0].get_ylim()) axs[4].set_xticks(xticks) axs[4].set_xlabel('Actual value', fontsize=20) # Hide x labels and tick labels for all but bottom plot. for ax in axs.flat: ax.label_outer() plt.savefig('ForkLength3.png', dpi=1000) |
다음 | Python graph plot |
---|---|
이전 | condor.sh |