From baf03e7e915c4863582fe6291b0879d1120065e0 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Thu, 2 Apr 2020 16:47:49 +0200 Subject: [PATCH] feat: control which axes are turned on/off --- ipyvolume/pylab.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ipyvolume/pylab.py b/ipyvolume/pylab.py index b41422db..b02ddce4 100644 --- a/ipyvolume/pylab.py +++ b/ipyvolume/pylab.py @@ -1263,14 +1263,21 @@ def translate(mplstyle): fig.style = totalstyle @staticmethod - def axes_off(): - """Do not draw the axes.""" - style.use({'axes': {'visible': False}}) + def _axes(which=None, **values): + if which: + style.use({'axes': {name: values for name in which}}) + else: + style.use({'axes': values}) + + @staticmethod + def axes_off(which=None): + """Do not draw the axes, optionally give axis names, e.g. 'xy'.""" + style._axes(which, visible=False) @staticmethod - def axes_on(): - """Draw the axes.""" - style.use({'axes': {'visible': True}}) + def axes_on(which=None): + """Draw the axes, optionally give axis names, e.g. 'xy'.""" + style._axes(which, visible=True) @staticmethod def box_off():