Skip to content

Commit cedc3f3

Browse files
author
minjk-bl
committed
Edit vp_seaborn_show_values function code to check isnan for x, y coordinates of value position
1 parent bb93591 commit cedc3f3

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

python/userCommand.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,16 @@ def _single(ax):
119119
for p in ax.patches:
120120
_x = p.get_x() + p.get_width() / 2
121121
_y = p.get_y() + p.get_height() + (p.get_height()*space)
122-
value = pstr.format(p.get_height())
123-
ax.text(_x, _y, value, ha='center')
122+
if not _vp_np.isnan(_x) and not _vp_np.isnan(_y):
123+
value = pstr.format(p.get_height())
124+
ax.text(_x, _y, value, ha='center')
124125
elif orient == 'h':
125126
for p in ax.patches:
126127
_x = p.get_x() + p.get_width() + (space - 0.01)
127128
_y = p.get_y() + p.get_height() / 2
128-
value = pstr.format(p.get_width())
129-
ax.text(_x, _y, value, ha='left')
129+
if not _vp_np.isnan(_x) and not _vp_np.isnan(_y):
130+
value = pstr.format(p.get_width())
131+
ax.text(_x, _y, value, ha='left')
130132

131133
if isinstance(axs, _vp_np.ndarray):
132134
for idx, ax in _vp_np.ndenumerate(axs):

python/visualizationCommand.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ def _single(ax):
2424
for p in ax.patches:
2525
_x = p.get_x() + p.get_width() / 2
2626
_y = p.get_y() + p.get_height() + (p.get_height()*space)
27-
value = pstr.format(p.get_height())
28-
ax.text(_x, _y, value, ha='center')
27+
if not _vp_np.isnan(_x) and not _vp_np.isnan(_y):
28+
value = pstr.format(p.get_height())
29+
ax.text(_x, _y, value, ha='center')
2930
elif orient == 'h':
3031
for p in ax.patches:
3132
_x = p.get_x() + p.get_width() + (space - 0.01)
3233
_y = p.get_y() + p.get_height() / 2
33-
value = pstr.format(p.get_width())
34-
ax.text(_x, _y, value, ha='left')
34+
if not _vp_np.isnan(_x) and not _vp_np.isnan(_y):
35+
value = pstr.format(p.get_width())
36+
ax.text(_x, _y, value, ha='left')
3537

3638
if isinstance(axs, _vp_np.ndarray):
3739
for idx, ax in _vp_np.ndenumerate(axs):

0 commit comments

Comments
 (0)