Skip to content

Commit 415a514

Browse files
committed
try images directory
1 parent 547eb02 commit 415a514

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lib/matplotlib/dates.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ def __call__(self, x, pos=None):
759759
def format_ticks(self, values):
760760
tickdatetime = [num2date(value, tz=self._tz) for value in values]
761761
tickdate = np.array([tdt.timetuple()[:6] for tdt in tickdatetime])
762-
762+
print('tickdate', tickdate)
763763
# basic algorithm:
764764
# 1) only display a part of the date if it changes over the ticks.
765765
# 2) don't display the smaller part of the date if:
@@ -784,12 +784,14 @@ def format_ticks(self, values):
784784
# now loop through and decide the actual ticklabels
785785
zerovals = [0, 1, 1, 0, 0, 0, 0]
786786
labels = [''] * len(tickdate)
787+
print('level:', level, zerovals[level])
787788
for nn in range(len(tickdate)):
788789
if level < 5:
789790
if tickdate[nn][level] == zerovals[level]:
790791
fmt = zerofmts[level]
791792
else:
792793
fmt = fmts[level]
794+
print('fmt', fmt)
793795
else:
794796
# special handling for seconds + microseconds
795797
if (tickdatetime[nn].second == tickdatetime[nn].microsecond

tutorials/intermediate/constrainedlayout_guide.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import matplotlib.colors as mcolors
5454
import matplotlib.gridspec as gridspec
5555
import numpy as np
56+
import os
5657

5758

5859
plt.rcParams['savefig.facecolor'] = "0.8"
@@ -229,14 +230,14 @@ def example_plot(ax, fontsize=12, hide_labels=False):
229230
leg.set_in_layout(True)
230231
# we don't want the layout to change at this point.
231232
fig.set_constrained_layout(False)
232-
233-
fig.savefig('../../_static/constrained_layout/CL01.png',
233+
print(os.getcwd())
234+
fig.savefig('../../doc/_images/CL01tight.png',
234235
bbox_inches='tight', dpi=100)
235236

236237
#############################################
237238
# The saved file looks like:
238239
#
239-
# .. image:: /_static/constrained_layout/CL01.png
240+
# .. image:: /_images/constrained_layout/CL01.png
240241
# :align: center
241242
#
242243
# A better way to get around this awkwardness is to simply
@@ -247,13 +248,13 @@ def example_plot(ax, fontsize=12, hide_labels=False):
247248
labels = [l.get_label() for l in lines]
248249
leg = fig.legend(lines, labels, loc='center left',
249250
bbox_to_anchor=(0.8, 0.5), bbox_transform=axs[1].transAxes)
250-
fig.savefig('../../_static/constrained_layout/CL02.png',
251+
fig.savefig('../../doc/_images/constrained_layout/CL02.png',
251252
bbox_inches='tight', dpi=100)
252253

253254
#############################################
254255
# The saved file looks like:
255256
#
256-
# .. image:: /_static/constrained_layout/CL02.png
257+
# .. image:: /_images/constrained_layout/CL02.png
257258
# :align: center
258259
#
259260

0 commit comments

Comments
 (0)