plot graph 색깔입히기!!
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
########## color
background = '#272822'
fontcolor = '#737373' #'w'
#actorcolor = ['#4BB2F2', '#F2766B']
actorcolor = ['#66d9ef', '#f92772']
########## figure
fig = plt.figure(figsize=(10, 5))
fig.suptitle('Realtime Performance Graph', fontsize=17, fontweight='bold', color='w')
fig.set_facecolor(background)
gs = gridspec.GridSpec(1, 2, width_ratios=[2, 3])
plt.rcParams['text.color'] ="w"
########## first graph
#data
height = [3, 12]
bars = ('A', 'B')
y_pos = np.arange(len(bars))
ax1 = fig.add_subplot(gs[0])
ax1.title.set_text('First Plot')
ax1.set_facecolor("None")
ax1.set_xlabel("FPS", color='w')
ax1.set_ylabel("Second", color='w')
ax1.tick_params(color='w', labelcolor='w')
ax1.set_xticklabels(['A', 'B'], color='w')
ax1.set_xticks(y_pos)
for spine in ax1.spines:
ax1.spines[spine].set_color('w')
ax1.bar(y_pos, height, 0.5, color=actorcolor)
########## second graph
# data
x2 = range(60,300)
y2 = [v*v for v in x2]
x3 = range(60,300)
y3 = [v*v for v in y2]
ax2 = fig.add_subplot(gs[1])
ax2.title.set_text('Second Plot')
ax2.set_facecolor("None")
ax2.set_xlabel('time', color='w')
ax2.set_ylabel('Realtime', color='w')
ax2.tick_params(color='w', labelcolor='w')
for spine in ax2.spines:
ax2.spines[spine].set_color('w')
ax2.plot(x2, y2, color=actorcolor[0])
ax2.plot(x3, y3, color=actorcolor[1])
########## show
fig.tight_layout()
plt.subplots_adjust(top=0.85)
plt.show()
'개발' 카테고리의 다른 글
어셈블리어 (0) | 2019.12.17 |
---|---|
AArch64 generic timer (0) | 2019.12.09 |
0713 kernel (1) | 2019.07.13 |
컴파일러 (0) | 2019.01.08 |
[AWS] 스케일업, 스케일다운: 오토스케일링과 클라우드와치 (0) | 2018.10.13 |