Skip to content

Commit 2933c97

Browse files
Merge pull request #127 from notZaki/fig_markersize
Refactor figures in notebooks
2 parents dbc5ca3 + dfe0a09 commit 2933c97

File tree

7 files changed

+316
-1862
lines changed

7 files changed

+316
-1862
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ notebooks/_build
155155

156156
# test results (these are commited to separate repository)
157157
/results
158+
test/results
158159

159160
# Pycharm
160161
.idea

notebooks/2CUM.ipynb

Lines changed: 50 additions & 461 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

notebooks/2CXM.ipynb

Lines changed: 82 additions & 533 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

notebooks/ExtendedToftsModel.ipynb

Lines changed: 69 additions & 337 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

notebooks/PatlakModel.ipynb

Lines changed: 42 additions & 272 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

notebooks/ToftsModel.ipynb

Lines changed: 54 additions & 257 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

notebooks/plotting_results_nb.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
# import statements
1212
import numpy
1313
from matplotlib import pyplot as plt
14+
from matplotlib.ticker import AutoMinorLocator
1415
import seaborn as sns
1516

1617

17-
1818
def plot_bland_altman(ax, data, tolerances, tag, log_plot=False, xlim=None, ylim=None, label_xaxis=None, label_yaxis=None,
1919
fig_title=None):
2020
"""
@@ -96,4 +96,20 @@ def bland_altman_statistics(data, par, grouptag):
9696
resultsBA['LoA lower'] = resultsBA['bias'] - 1.96 * resultsBA['stdev']
9797
resultsBA['LoA upper'] = resultsBA['bias'] + 1.96 * resultsBA['stdev']
9898

99-
return resultsBA
99+
return resultsBA
100+
101+
def make_catplot(x, y, data, ylabel, **plotopts):
102+
g = sns.catplot(x=x, y=y, data=data, **plotopts)
103+
g.set_titles(col_template = "{col_name}")
104+
g.set(xlabel=None)
105+
g.set_ylabels(ylabel, clear_inner=False);
106+
g.set_xticklabels(rotation=45, fontsize=16, ha='right', rotation_mode='anchor')
107+
g._legend.set_title('ContributionID')
108+
# Add vertical add midpoints between each major tick
109+
for ax in g.axes.flatten():
110+
ax.xaxis.set_minor_locator(AutoMinorLocator(2))
111+
ax.grid(which="minor", axis='x', linestyle=":")
112+
# Hide the minor ticks (distracting) by making it white
113+
ax.tick_params(axis='x', which='minor', colors='white')
114+
plt.show() # Could also do `return g` for more flexibility
115+

0 commit comments

Comments
 (0)