2016-08-01 2 views
2

시각화 점수 산법에 대한 산점도와 상자 그림을 결합하려고합니다. 내 데이터는 다음과 같이 구성되어 있습니다동일한 oX 위치의 다른 상자 그림

  • OX -
  • 2 알고리즘 다른 시뮬레이션 각 기간에 대한 점수에 대한 정보 - 기간 (등 1 년, 2 년,)
  • 오우에 대한 정보 (점으로 꾸몄다) 단일 값

와 (상자 그림으로 그려) 결과

  • 이 추론은 내가 쉽게 시간의 각 기간에 대한 방법의 효율성을 비교하기 위해 노력하고있어.

    작은 샘플 데이터 :

    1 year    2 years   
    A1 A2 H1 H2 A1 A2 H1 H2 
    124 168 155 167 130 130 150 164 
    102 155   100 172  
    103 153   117 145  
    102 132   145 143  
    145 170   133 179  
    136 125   115 153  
    116 150   136 131  
    146 192   106 148  
    124 122   127 158  
    128 123   149 200  
    141 158   137 156  
    

    나는이처럼 보이는 뭔가를 얻으려고 : 지금까지 enter image description here

    을 나는 각 알고리즘에 대한 관찰을 가지고 내 데이터를 삭제 한을 (RS, EA) 및 각 기간 (52, 104, 156 등)에 대해 개별적으로 like so하지만 동일한 X tick에 대해 2 개의 다른 상자 그림을 그리는 동안주기별로 그룹화하는 방법을 알 수는 없습니다. 일단 boxplot 데이터 프레임과 플롯을 정리하면, 나는 산산조각을 위에 그릴 수 있다고 가정합니다.

  • 답변

    0

    은 도움이 경우,이 한편을 해결하기 위해 관리되는 다른 사람 아웃 :이의

    ax1 = sns.boxplot(data = meta, x = 'Time', y = 'PRS', color = '#880BDD', linewidth=0.8) 
    ax1 = sns.boxplot(data = meta, x = 'Time', y = 'EA', color = '#0BC9DD', linewidth=0.8) 
    ax1 = sns.boxplot(data = meta, x = 'Time', y = 'ERS', color = '#9BD19D', linewidth=0.8) 
    ax1 = sns.pointplot(data = simple, x = 'Time', y = 'Greedy Average', color='#FFC48C', markers ='s', join=False) 
    ax1 = sns.pointplot(data = simple, x = 'Time', y = 'Greedy Total', color='#FF9F80', markers='o', join=False) 
    ax1 = sns.pointplot(data = simple, x = 'Time', y = 'Greedy Weeks', color='#F56991', markers='*', join=False) 
    ax1.set(xlabel = "Planning Horizon (weeks)") 
    ax1.set(ylabel = "Hypervolume") 
    EA = mpatches.Patch(color='#0BC9DD', label = 'EA') 
    PRS = mpatches.Patch(color='#880BDD', label = 'PRS') 
    ERS = mpatches.Patch(color='#9BD19D', label = 'ERS') 
    GA = mlines.Line2D([], [], color='#FFC48C', marker = 's', label = 'Greedy Average') 
    GT = mlines.Line2D([], [],color='#FF9F80', label = 'Greedy Total', marker = 'o') 
    GW = mlines.Line2D([], [],color='#F56991', label = 'Greedy Weeks', marker = '*') 
    plt.legend(handles = [EA, ERS, PRS, GA, GT, GW], loc = 'bottom left', title = "Algorithm") 
    ax1.set_title("Algorithm Comparison") 
    

    결과 :

    enter image description here