Skip to content

Commit cd72f05

Browse files
committed
Make ConciseDateFormatter.format_ticks obey tz
* Also fix conciseDateFormatter.format_data_short
1 parent 6cd7419 commit cd72f05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/dates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ def __call__(self, x, pos=None):
752752
return formatter(x, pos=pos)
753753

754754
def format_ticks(self, values):
755-
tickdatetime = [num2date(value) for value in values]
755+
tickdatetime = [num2date(value, tz=self._tz) for value in values]
756756
tickdate = np.array([tdt.timetuple()[:6] for tdt in tickdatetime])
757757

758758
# basic algorithm:
@@ -818,7 +818,7 @@ def get_offset(self):
818818
return self.offset_string
819819

820820
def format_data_short(self, value):
821-
return num2date(value).strftime('%Y-%m-%d %H:%M:%S')
821+
return num2date(value, tz=self._tz).strftime('%Y-%m-%d %H:%M:%S')
822822

823823

824824
class AutoDateFormatter(ticker.Formatter):

0 commit comments

Comments
 (0)