File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 22#
33from __future__ import print_function
44
5+ from matplotlib .dates import num2date
56import datetime
67import six
78
@@ -302,15 +303,22 @@ def _table(obj, data):
302303 xdata = [date .strftime ("%Y-%m-%d %H:%M" ) for date in xdata ]
303304 xformat = "{}"
304305 col_sep = ","
305- content .append ("table [col sep=comma] {%\n " )
306+ content .append ("table [header=false, col sep=comma] {%\n " )
306307 data ["current axes" ].axis_options .append ("date coordinates in=x" )
307- # Remove xmin/xmax until <https://github.com/matplotlib/matplotlib/issues/13727>
308- # is resolved .
308+ # Replace float xmin/xmax by datetime
309+ # <https://github.com/matplotlib/matplotlib/issues/13727> .
309310 data ["current axes" ].axis_options = [
310311 option
311312 for option in data ["current axes" ].axis_options
312313 if not option .startswith ("xmin" )
313314 ]
315+ xmin , xmax = data ["current mpl axes obj" ].get_xlim ()
316+ data ["current axes" ].axis_options .append (
317+ "xmin={}, xmax={}" .format (
318+ num2date (xmin ).strftime ("%Y-%m-%d %H:%M" ),
319+ num2date (xmax ).strftime ("%Y-%m-%d %H:%M" ),
320+ )
321+ )
314322 else :
315323 xformat = ff
316324 col_sep = " "
Original file line number Diff line number Diff line change @@ -337,6 +337,7 @@ def _recurse(data, obj):
337337 if data ["extra axis options [base]" ]:
338338 ax .axis_options .extend (data ["extra axis options [base]" ])
339339
340+ data ["current mpl axes obj" ] = child
340341 data ["current axes" ] = ax
341342
342343 # Run through the child objects, gather the content.
Original file line number Diff line number Diff line change 77tick align=outside,
88tick pos=left,
99x grid style={white!69.01960784313725!black},
10+ xmin=2016-10-10 17:59, xmax=2016-10-10 18:15,
1011y grid style={white!69.01960784313725!black},
1112ymin=49.999, ymax=50.021
1213]
You can’t perform that action at this time.
0 commit comments