Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Jan 16, 2018
1 parent 0f69585 commit 32e841e
Showing 1 changed file with 52 additions and 52 deletions.
104 changes: 52 additions & 52 deletions lantern/plotting/plotutils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .plottypes import lookup
import random
import numpy as np

Expand All @@ -20,57 +19,58 @@ def get_color(i, col, color):
return c


def _conf(type, colors, x, y, i, col):
'''select type and color from their options, allow strings for some'''
if isinstance(type, str):
typ = lookup(type)
if isinstance(colors, list):
color = (colors[i:i+1] or [_r()])[0]
elif isinstance(colors, dict):
color = colors.get(col, _r())
elif isinstance(colors, str) and colors:
color = colors
else:
color = _r()

if isinstance(type, list):
typ = (type[i:i+1] or ['line'])[0]
if isinstance(typ, str):
typ = lookup(typ)
if isinstance(colors, list):
color = (colors[i:i+1] or [_r()])[0]
elif isinstance(colors, dict):
color = colors.get(col, _r())
elif isinstance(colors, str) and colors:
color = colors
else:
color = _r()

elif isinstance(type, dict):
typ = type.get(col, 'line')
if isinstance(type.get(col, 'line'), str):
typ = lookup(typ)

if isinstance(colors, list):
color = (colors[i:i+1] or [_r()])[0]
elif isinstance(colors, dict):
color = colors.get(col, _r())
elif isinstance(colors, str):
color = colors
else:
color = _r()

if y and isinstance(y, dict):
y = y.get(col, 'left')
else:
y = 'left'

if x and isinstance(x, dict):
x = x.get(col, 'left')
else:
x = 'bottom'

return typ, color, x, y
# def _conf(type, colors, x, y, i, col):
# from .plottypes import lookup
# '''select type and color from their options, allow strings for some'''
# if isinstance(type, str):
# typ = lookup(type)
# if isinstance(colors, list):
# color = (colors[i:i+1] or [_r()])[0]
# elif isinstance(colors, dict):
# color = colors.get(col, _r())
# elif isinstance(colors, str) and colors:
# color = colors
# else:
# color = _r()

# if isinstance(type, list):
# typ = (type[i:i+1] or ['line'])[0]
# if isinstance(typ, str):
# typ = lookup(typ)
# if isinstance(colors, list):
# color = (colors[i:i+1] or [_r()])[0]
# elif isinstance(colors, dict):
# color = colors.get(col, _r())
# elif isinstance(colors, str) and colors:
# color = colors
# else:
# color = _r()

# elif isinstance(type, dict):
# typ = type.get(col, 'line')
# if isinstance(type.get(col, 'line'), str):
# typ = lookup(typ)

# if isinstance(colors, list):
# color = (colors[i:i+1] or [_r()])[0]
# elif isinstance(colors, dict):
# color = colors.get(col, _r())
# elif isinstance(colors, str):
# color = colors
# else:
# color = _r()

# if y and isinstance(y, dict):
# y = y.get(col, 'left')
# else:
# y = 'left'

# if x and isinstance(x, dict):
# x = x.get(col, 'left')
# else:
# x = 'bottom'

# return typ, color, x, y


def _parseScatter(kwargs, col):
Expand Down

0 comments on commit 32e841e

Please sign in to comment.