<reponame>Hoseung/pyRamAn<filename>scripts/simulation/Progressbar.py
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 12:30:14 2015

@author: hoseung
"""
import numpy as np

M_frac = [0.0190095168
,0.0073920634
,0.0257823544
,0.0043527887
,0.026893331
,0.0068899623
,0.0092256156
,0.0182159136
,0.0082356121
,0.0270207381
,0.0292612557
,0.0103692281
,0.0635676811
,0.0209481735
,0.0198399943
,0.1537769305
,0.0153776931
,0.0229200595
,0.0170261023
,0.0770982674
,0.1035549556
,0.0301558182
,0.00791812
,0.0149458821
,0.02813163
,0.0195273679
,0.0823561215
,0.0248087028
,0.007669799
,0.0186778175
,0.004489478
,0.0045107125
,0.0140674256
,0.0048015195
,0.004425766
,0.0060769132
,0.0053760468
,0.0042977909
,0.0049316732
,0.0048325618
,0.0043990808
,0.0044502726
,0.0065637644
,0.0058274987]


prog=[100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,99.72899729
,96.256684492
,96
,90.9090909091
,88
,85.5614973262
,75.935828877
,67.9144385027
,65.7754010695
,55.614973262
,47.0588235294
,41.7112299465
,29.4117647059
,5.3475935829
,0.5347593583
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
]
#%%
import matplotlib.pyplot as plt
import matplotlib.patches as patches
fig = plt.figure()
ax = fig.add_subplot(111)


x0 = 0
for m, p in zip(M_frac, prog):
    x1 = x0 + m
    ax.add_patch(
    patches.Rectangle(
            (x0, 0.1),   # (x,y)
            x1-x0,          # width
            0.1,      # height
            alpha=0.2
        )    
    )
    ax.add_patch(
    patches.Rectangle(
            (x0, 0.1),   # (x,y)
            (x1-x0)*(p/100),          # width
            0.1,          # height
            alpha=1.0
        )    
    )
    x0 = x1
    
plt.show()
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 12:30:14 2015

@author: hoseung
"""
import numpy as np

M_frac = [0.0190095168
,0.0073920634
,0.0257823544
,0.0043527887
,0.026893331
,0.0068899623
,0.0092256156
,0.0182159136
,0.0082356121
,0.0270207381
,0.0292612557
,0.0103692281
,0.0635676811
,0.0209481735
,0.0198399943
,0.1537769305
,0.0153776931
,0.0229200595
,0.0170261023
,0.0770982674
,0.1035549556
,0.0301558182
,0.00791812
,0.0149458821
,0.02813163
,0.0195273679
,0.0823561215
,0.0248087028
,0.007669799
,0.0186778175
,0.004489478
,0.0045107125
,0.0140674256
,0.0048015195
,0.004425766
,0.0060769132
,0.0053760468
,0.0042977909
,0.0049316732
,0.0048325618
,0.0043990808
,0.0044502726
,0.0065637644
,0.0058274987]


prog=[100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,100
,99.72899729
,96.256684492
,96
,90.9090909091
,88
,85.5614973262
,75.935828877
,67.9144385027
,65.7754010695
,55.614973262
,47.0588235294
,41.7112299465
,29.4117647059
,5.3475935829
,0.5347593583
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
,0
]
#%%
import matplotlib.pyplot as plt
import matplotlib.patches as patches
fig = plt.figure()
ax = fig.add_subplot(111)


x0 = 0
for m, p in zip(M_frac, prog):
    x1 = x0 + m
    ax.add_patch(
    patches.Rectangle(
            (x0, 0.1),   # (x,y)
            x1-x0,          # width
            0.1,      # height
            alpha=0.2
        )    
    )
    ax.add_patch(
    patches.Rectangle(
            (x0, 0.1),   # (x,y)
            (x1-x0)*(p/100),          # width
            0.1,          # height
            alpha=1.0
        )    
    )
    x0 = x1
    
plt.show()
# -*- coding: utf-8 -*- Created on Mon Jun 29 12:30:14 2015  @author: hoseung #%% # (x,y) # width # height # (x,y) # width # height