Skip to content

Commit

Permalink
More matrix visualization API tweaking.
Browse files Browse the repository at this point in the history
  • Loading branch information
tshead2 committed Sep 2, 2015
1 parent 86f6390 commit a7349cb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
32 changes: 16 additions & 16 deletions design/matrix-labelling.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions toyplot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ def matrix(
rlabel=None,
blabel=None,
step=1,
tshow=True,
lshow=True,
rshow=False,
bshow=False,
tshow=None,
lshow=None,
rshow=None,
bshow=None,
tlocator=None,
llocator=None,
rlocator=None,
Expand Down
16 changes: 12 additions & 4 deletions toyplot/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,10 @@ def matrix(
rlabel=None,
blabel=None,
step=1,
tshow=True,
lshow=True,
rshow=False,
bshow=False,
tshow=None,
lshow=None,
rshow=None,
bshow=None,
tlocator=None,
llocator=None,
rlocator=None,
Expand Down Expand Up @@ -470,27 +470,35 @@ def matrix(
cell = table.bottom.row(1).merge()
cell.data = blabel

if tshow is None:
tshow = True
if tshow:
if tlocator is None:
tlocator = toyplot.locator.Integer(step=step)
for j, label, title in zip(*tlocator.ticks(0, matrix.shape[1] - 1)):
table.top.cell(1, j).data = label
#table.top.cell(1, j).title = title

if lshow is None:
lshow = True
if lshow:
if llocator is None:
llocator = toyplot.locator.Integer(step=step)
for i, label, title in zip(*llocator.ticks(0, matrix.shape[0] - 1)):
table.left.cell(i, 1).data = label
#table.left.cell(i, 1).title = title

if rshow is None and rlocator is not None:
rshow = True
if rshow:
if rlocator is None:
rlocator = toyplot.locator.Integer(step=step)
for i, label, title in zip(*rlocator.ticks(0, matrix.shape[0] - 1)):
table.right.cell(i, 0).data = label
#table.right.cell(i, 0).title = title

if bshow is None and blocator is not None:
bshow = True
if bshow:
if blocator is None:
blocator = toyplot.locator.Integer(step=step)
Expand Down

0 comments on commit a7349cb

Please sign in to comment.