Skip to content

Commit fdab5be

Browse files
committed
fix for plots cut out of figure
1 parent 0e53367 commit fdab5be

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

examples/numpy_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@profile
66
def create_data():
77
ret = []
8-
for n in xrange(70):
8+
for n in range(70):
99
ret.append(np.random.randn(1, 70, 71, 72))
1010
return ret
1111

memory_profiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# .. we'll use this to pass it to the child script ..
44
_CLEAN_GLOBALS = globals().copy()
55

6-
__version__ = '0.36'
6+
__version__ = '0.37'
77

88
_CMD_USAGE = "python -m memory_profiler script_file.py"
99

mprof

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ def plot_action():
451451
print("No files found from given input.")
452452
sys.exit(-1)
453453

454-
pl.figure(figsize=(14, 6), dpi=90)
454+
fig = pl.figure(figsize=(14, 6), dpi=90)
455+
ax = fig.add_axes([0.1, 0.1, 0.6, 0.75])
455456
if len(filenames) > 1 or options.no_timestamps:
456457
timestamps = False
457458
else:
@@ -467,10 +468,9 @@ def plot_action():
467468
if options.title is not None:
468469
pl.title(options.title)
469470

470-
ax = pl.gca()
471471
# place legend within the plot, make partially transparent in
472472
# case it obscures part of the lineplot
473-
leg = ax.legend(loc='best', fancybox=True)
473+
leg = ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))
474474
leg.get_frame().set_alpha(0.5)
475475
pl.grid()
476476
if options.output:

0 commit comments

Comments
 (0)