Skip to content

Commit

Permalink
feat: update font size
Browse files Browse the repository at this point in the history
  • Loading branch information
Lan Le committed Apr 24, 2024
1 parent db34088 commit 382be56
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions chem_spectra/lib/composer/ni.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def __fakto(self):

def tf_img(self):
plt.rcParams['figure.figsize'] = [16, 9]
plt.rcParams['figure.dpi'] = 200
plt.rcParams['font.size'] = 14

# PLOT data
Expand Down Expand Up @@ -438,7 +439,7 @@ def tf_img(self):
plt.plot([xL, xL], [mpy_h + h * 0.01, mpy_h - h * 0.01], color='#DA70D6') # noqa: E501
plt.plot([xU, xU], [mpy_h + h * 0.01, mpy_h - h * 0.01], color='#DA70D6') # noqa: E501
# plt.text((xL + xU) / 2, mpy_h - h * 0.08, '({})'.format(typ), color='#DA70D6', size=10, rotation=90.) # noqa: E501
plt.text((xL + xU) / 2, mpy_h - h * 0.01, '{:0.3f}\n({})'.format(calc_mpy_center(mpy['peaks'], refShift, mpy['mpyType']), typ), color='#DA70D6', size=10, rotation=90., ha='right', va='top', rotation_mode='anchor') # noqa: E501
plt.text((xL + xU) / 2, mpy_h - h * 0.01, '{:0.3f}\n({})'.format(calc_mpy_center(mpy['peaks'], refShift, mpy['mpyType']), typ), color='#DA70D6', size=6, rotation=90., ha='right', va='top', rotation_mode='anchor') # noqa: E501
for p in peaks:
x = p['x']
plt.plot([x - refShift, x - refShift], [mpy_h, mpy_h + h * 0.05], color='#DA70D6') # noqa: E501
Expand Down Expand Up @@ -506,7 +507,7 @@ def __draw_integrals(self, plt, refShift, refArea, y_max, h, itg_value_position_
plt.plot([xL, xU], [itg_value_position_x, itg_value_position_x], color='#228B22')
plt.plot([xL, xL], [itg_value_position_x + h * 0.01, itg_value_position_x - h * 0.01], color='#228B22') # noqa: E501
plt.plot([xU, xU], [itg_value_position_x + h * 0.01, itg_value_position_x - h * 0.01], color='#228B22') # noqa: E501
plt.text((xL + xU) / 2, itg_value_position_x - h * 0.01, '{:0.2f}'.format(area), color='#228B22', ha='right', rotation_mode='anchor', size=10, rotation=90.) # noqa: E501
plt.text((xL + xU) / 2, itg_value_position_x - h * 0.01, '{:0.2f}'.format(area), color='#228B22', ha='right', rotation_mode='anchor', size=6, rotation=90.) # noqa: E501
cys = (ks[iL:iU] - ref) * 1.5 + (y_max + h * 0.15)
plt.plot(cxs, cys, color='#228B22')
try:
Expand Down Expand Up @@ -568,8 +569,8 @@ def __draw_peaks(self, plt, x_peaks, y_peaks, h, w):
elif j < middle_idx:
x_text = w * 0.01 * (j-middle_idx)

ax.add_patch(FancyArrowPatch((x_pos, max_current_group), (x_pos, max_current_group + h * 0.05), linewidth=0.2))
ax.add_patch(FancyArrowPatch((x_pos, max_current_group + h * 0.05), (gap_value + x_text, max_current_group + h * 0.11), linewidth=0.2))
ax.add_patch(FancyArrowPatch((x_pos, max_current_group), (x_pos, max_current_group + h * 0.05), linewidth=0.1))
ax.add_patch(FancyArrowPatch((x_pos, max_current_group + h * 0.05), (gap_value + x_text, max_current_group + h * 0.11), linewidth=0.1))

x_boundary_min = min(gap_value + x_text, x_boundary_min)
x_boundary_max = max(gap_value + x_text, x_boundary_max)
Expand All @@ -578,7 +579,7 @@ def __draw_peaks(self, plt, x_peaks, y_peaks, h, w):
xy=(gap_value + x_text, max_current_group + h * 0.11), xycoords='data',
xytext=(0, 12), textcoords='offset points',
arrowprops=dict(arrowstyle="-", linewidth=0.2),
rotation=90, size=10)
rotation=90, size=6)
else:
x_pos = mygroup_x[0]
y_pos = mygroup_y[0] + h * 0.08
Expand All @@ -588,7 +589,7 @@ def __draw_peaks(self, plt, x_peaks, y_peaks, h, w):
xy=(x_pos, y_pos), xycoords='data',
xytext=(0, 20), textcoords='offset points',
arrowprops=dict(arrowstyle="-", linewidth=0.2),
rotation=90, size=10)
rotation=90, size=6)

x_boundary_min = x_boundary_min - w * 0.01
x_boundary_max = x_boundary_max + w * 0.02
Expand Down

0 comments on commit 382be56

Please sign in to comment.