From: Paul H. <pmh...@gm...> - 2014-02-05 07:26:34
|
I noticed that when you offset the spines of an Axes object, the labels, ticks, and ticklabels/formatting get mostly cleared. Is this intentional and is there a way to prevent (or undo) it? It's probably easiest to just look at a notebook: http://nbviewer.ipython.org/gist/phobson/8818648 That notebook contains a proposed solution from Stack Overflow. Unfortunately, minor ticks and labels are missed (and I can't understand why as the values are contained in the properties dictionary of the spines). Background: I'm trying to add an offset kwarg to the despine function in seaborn (https://github.com/mwaskom/seaborn/pull/92). Point of mentioning that is that to make this work, we need to be able to offset the spines *after* plotting and formatting ticks. Alternatively, if there was a way to specify a default offset in rcParams before a figure and axes were even created, that might work too. ------ Related to that, when I use the SO solution, about 50% of the time the axes labels are rendered as the label objects, not text. Whatever triggers that doesn't seem to be deterministic. Resetting the notebook will fix it or break it -- there's no telling how it's going to go. Here's the exact same notebook as above, with the mangled figure at the bottom. http://nbviewer.ipython.org/gist/phobson/8818680 Cheers, -Paul |