Skip to content

Commit

Permalink
Merge pull request #64 from NeuroML/feat/matrix-handler-tick-sizes
Browse files Browse the repository at this point in the history
feat(matrix-handler): tweak tick size relative to defaults
  • Loading branch information
pgleeson committed Nov 17, 2023
2 parents 59309c2 + 3c67140 commit 0d7c4a2
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions neuromllite/MatrixHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,33 @@ def finalise_document(self):
ax.set_yticklabels(entries)
ax.set_xticklabels(entries)
ax.set_ylabel("presynaptic")
tick_size = (
10

# change in relation to default so that users can override
default_tick_size_x = matplotlib.rcParams["xtick.labelsize"]
tick_size_x = (
default_tick_size_x
if weight_array.shape[0] < 20
else (8 if weight_array.shape[0] < 40 else 6)
else (
(default_tick_size_x - 2)
if weight_array.shape[0] < 40
else (default_tick_size_x - 4)
)
)
ax.tick_params(axis="y", labelsize=tick_size)
ax.tick_params(axis="x", labelsize=tick_size_x)

default_tick_size_y = matplotlib.rcParams["ytick.labelsize"]
tick_size_y = (
default_tick_size_y
if weight_array.shape[0] < 20
else (
(default_tick_size_y - 2)
if weight_array.shape[0] < 40
else (default_tick_size_y - 4)
)
)
ax.tick_params(axis="y", labelsize=tick_size_y)

ax.set_xlabel("postsynaptic")
ax.tick_params(axis="x", labelsize=tick_size)
fig.autofmt_xdate()

for i in range(len(entries)):
Expand Down

0 comments on commit 0d7c4a2

Please sign in to comment.