Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change the default order of colors. Update processing of spines argum…

…ent to accept more types of values.
  • Loading branch information...
commit adf04f3bc0cf49689b7316ca9c52ac56907686e1 1 parent a6884e5
@lmjohns3 authored
Showing with 5 additions and 7 deletions.
  1. +5 −7 lmj/plot.py
View
12 lmj/plot.py
@@ -24,8 +24,8 @@
'#9467bd',
'#ff7f0e',
'#d62728',
- '#8c564b',
'#e377c2',
+ '#8c564b',
'#7f7f7f',
'#bcbd22',
'#17becf',
@@ -81,17 +81,15 @@ def make_axis(subplot=111,
subplot = (subplot, )
ax = plt.subplot(*subplot, **kwargs)
- offsets = dict(bottom=6, left=6)
+ offsets = dict(bottom=6, left=6) if spines else {}
if isinstance(spines, dict):
offsets = spines
- elif isinstance(spines, (int, float, long)):
+ if isinstance(spines, (int, float, long)):
offsets = {s: spines for s in 'top right bottom left'.split()}
- elif isinstance(spines, str):
+ if isinstance(spines, str):
offsets = {s: 6 for s in spines.split()}
- elif isinstance(spines, (list, tuple, set)):
+ if isinstance(spines, (list, tuple, set)):
offsets = {k: 6 for k in spines}
- elif not spines:
- offsets = {}
for name, spine in ax.spines.iteritems():
offset = offsets.get(name)
if offset is not None:
Please sign in to comment.
Something went wrong with that request. Please try again.