From 1342a9438d5b9a353cee3c1b9a1635937412ab82 Mon Sep 17 00:00:00 2001 From: marco cammarata Date: Fri, 13 May 2016 00:11:11 +0200 Subject: [PATCH] removed an unnecessary plt.gca() call on import (was slow) --- mcutils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mcutils.py b/mcutils.py index 8ceaf4f..8fdbcdf 100644 --- a/mcutils.py +++ b/mcutils.py @@ -38,13 +38,15 @@ def colormap( list_of_colors ): cmap = LinearSegmentedColormap.from_list('cmap',c,256) return cmap -def simpleaxis(ax=plt.gca()): +def simpleaxis(ax=None): + is ax is None: ax = plt.gca() ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) ax.get_xaxis().tick_bottom() ax.get_yaxis().tick_left() -def noaxis(ax=plt.gca()): +def noaxis(ax=None): + is ax is None: ax = plt.gca() ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) ax.spines['left'].set_visible(False)