File tree 1 file changed +3
-11
lines changed 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -222,16 +222,13 @@ def _get_rc_timezone():
222
222
223
223
# default epoch: passed to np.datetime64...
224
224
_epoch = None
225
- _epoch_used = False
226
225
227
226
228
227
def _reset_epoch_test_example ():
229
- """Reset the Matplotlib date epoch to its rcParams value ."""
228
+ """Reset the Matplotlib date epoch so it can be set again ."""
230
229
global _epoch
231
- global _epoch_used
232
230
233
- _epoch_used = False
234
- _epoch = matplotlib .rcParams ['date.epoch' ]
231
+ _epoch = None
235
232
236
233
237
234
def set_epoch (epoch ):
@@ -260,8 +257,7 @@ def set_epoch(epoch):
260
257
261
258
"""
262
259
global _epoch
263
- global _epoch_used
264
- if _epoch_used :
260
+ if _epoch is not None :
265
261
raise RuntimeError ('set_epoch must be called before dates plotted.' )
266
262
_epoch = epoch
267
263
@@ -276,13 +272,9 @@ def get_epoch():
276
272
String for the epoch (parsable by `numpy.datetime64`)
277
273
"""
278
274
global _epoch
279
- global _epoch_used
280
275
281
276
if _epoch is None :
282
277
_epoch = matplotlib .rcParams ['date.epoch' ]
283
- # if get_epoch is called, then set_epoch can no longer be called.
284
- # _epoch_used is the latch for checking this.
285
- _epoch_used = True
286
278
return _epoch
287
279
288
280
You can’t perform that action at this time.
0 commit comments