Skip to content

Commit fb6d0a8

Browse files
committed
legend str and single time val
1 parent 16f541f commit fb6d0a8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

hapiplot/plot/timeseries.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ def timeseries(t, y, **kwargs):
151151
legendlabels[i] = '{0:s}: No data in interval'.format(legendlabels[i])
152152
else:
153153
if opts['nodata'] == True:
154-
legendlabels[0] = '{0:%s}: No data in interval'.format(legendlabels[0])
154+
legendlabels[0] = '{0:s}: No data in interval'.format(legendlabels[0])
155155
else:
156-
legendlabels[0] = '{0:%s}: All {1:d} values are NaN'.format(legendlabels[0], y.shape[0])
156+
legendlabels[0] = '{0:s}: All {1:d} values are NaN'.format(legendlabels[0], y.shape[0])
157157
else:
158158
if len(y.shape) > 1:
159159
for i in range(0, y.shape[1]):
@@ -171,7 +171,8 @@ def timeseries(t, y, **kwargs):
171171
ax.set_yticklabels([])
172172
ax.set_yticks([])
173173

174-
if len(y) == 1:
174+
if len(y.shape) == 1 and y.size == 1:
175+
# Single time value. Set one tick having that value.
175176
ax.set_yticks(y)
176177

177178
if np.any(all_nan):

0 commit comments

Comments
 (0)