Skip to content

Commit

Permalink
Merge pull request #21 from Arcadia-Science/das/example_testing
Browse files Browse the repository at this point in the history
Adding a handful of example plotting notebooks
  • Loading branch information
mezarque authored Jun 14, 2024
2 parents 1dcdb36 + f7fc041 commit a3e6462
Show file tree
Hide file tree
Showing 18 changed files with 791 additions and 47 deletions.
18 changes: 15 additions & 3 deletions arcadia_pycolor/mpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from arcadia_pycolor.palette import Palette
from arcadia_pycolor.style_defaults import (
ARCADIA_RC_PARAMS,
CATEGORICAL_AXIS_TICKLENGTH,
CATEGORICAL_AXIS_TICKPADDING,
DEFAULT_FONT,
FIGURE_PADDING,
FIGURE_SIZES,
Expand All @@ -22,7 +24,7 @@

LEGEND_PARAMS = dict(
alignment="left",
title_fontproperties={"weight": "semibold", "size": "26"},
title_fontproperties={"weight": "semibold", "size": ARCADIA_RC_PARAMS["legend.title_fontsize"]},
)

SAVEFIG_KWARGS_WEB = dict(dpi=72, bbox_inches="tight", pad_inches=0.41)
Expand Down Expand Up @@ -118,14 +120,24 @@ def set_xaxis_categorical(axis=None):
"Set the style of the x-axis to a categorical axis, removing ticks and adjusting padding."
ax = _find_axis(axis)

ax.tick_params(axis="x", which="both", pad=15, size=0)
ax.tick_params(
axis="x",
which="both",
pad=CATEGORICAL_AXIS_TICKPADDING,
size=CATEGORICAL_AXIS_TICKLENGTH,
)


def set_yaxis_categorical(axis=None):
"Set the style of the x-axis to a categorical axis, removing ticks and adjusting padding."
ax = _find_axis(axis)

ax.tick_params(axis="y", which="both", pad=15, size=0)
ax.tick_params(
axis="y",
which="both",
pad=CATEGORICAL_AXIS_TICKPADDING,
size=CATEGORICAL_AXIS_TICKLENGTH,
)


def set_axes_categorical(axis=None):
Expand Down
39 changes: 22 additions & 17 deletions arcadia_pycolor/style_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,22 @@
MONOSPACE_FONT = "Suisse Int'l Mono"


# Specifications for categorical axes.
CATEGORICAL_AXIS_TICKLENGTH = 0
CATEGORICAL_AXIS_TICKPADDING = 7


### rcParams ###
ARCADIA_RC_PARAMS = {
# Fonts
"font.family": "sans-serif",
"font.size": 24,
"font.size": 15,
"font.serif": "Suisse Works",
"font.sans-serif": "Suisse Int'l",
"font.monospace": "Suisse Int'l Mono",
"font.weight": "regular",
# Figure
"figure.titlesize": 26,
"figure.titlesize": 16.5,
"figure.titleweight": "medium",
"figure.facecolor": colors.parchment,
"figure.edgecolor": "none",
Expand All @@ -60,12 +65,12 @@
"axes.grid.axis": "both",
"axes.grid.which": "major",
"axes.prop_cycle": plt.cycler(color=palettes.accent_all_ordered.colors),
"axes.titlesize": 24,
"axes.titlesize": 16.5,
"axes.titleweight": "medium",
"axes.labelsize": 24,
"axes.labelsize": 15,
"axes.labelweight": "medium",
"axes.labelcolor": colors.black,
"axes.labelpad": 15,
"axes.labelpad": 7,
"axes.spines.left": True,
"axes.spines.bottom": True,
"axes.spines.right": False,
Expand All @@ -77,27 +82,27 @@
"polaraxes.grid": True,
"axes3d.grid": True,
# Ticks
"xtick.major.size": 15,
"xtick.minor.size": 7.5,
"xtick.major.size": 4.5,
"xtick.minor.size": 2.5,
"xtick.major.width": 1,
"xtick.minor.width": 1,
"xtick.major.pad": 8,
"xtick.minor.pad": 8,
"xtick.major.pad": 4,
"xtick.minor.pad": 4,
"xtick.color": colors.black,
"xtick.labelsize": 24,
"ytick.major.size": 15,
"ytick.minor.size": 7.5,
"xtick.labelsize": 15,
"ytick.major.size": 4.5,
"ytick.minor.size": 2.5,
"ytick.major.width": 1,
"ytick.minor.width": 1,
"ytick.major.pad": 8,
"ytick.minor.pad": 8,
"ytick.major.pad": 4,
"ytick.minor.pad": 4,
"ytick.color": colors.black,
"ytick.labelsize": 24,
"ytick.labelsize": 15,
# Legend
"legend.loc": "best",
"legend.frameon": False,
"legend.title_fontsize": 26,
"legend.fontsize": 24,
"legend.title_fontsize": 16.5,
"legend.fontsize": 15,
"legend.framealpha": 0,
"legend.borderpad": 0,
"legend.borderaxespad": 0,
Expand Down
Binary file modified examples/heatmap_setup.pdf
Binary file not shown.
Binary file modified examples/heatmap_style_axis.pdf
Binary file not shown.
Binary file modified examples/scatter_full_small.pdf
Binary file not shown.
Binary file modified examples/scatter_full_wide.pdf
Binary file not shown.
Binary file modified examples/scatter_half_small.pdf
Binary file not shown.
Binary file modified examples/scatter_setup.pdf
Binary file not shown.
Binary file modified examples/scatter_style_axis.pdf
Binary file not shown.
Binary file modified examples/scatter_threeq_small.pdf
Binary file not shown.
Binary file modified examples/scatter_threeq_wide.pdf
Binary file not shown.
Binary file modified examples/violin_setup.pdf
Binary file not shown.
Binary file modified examples/violin_style_axis.pdf
Binary file not shown.
386 changes: 386 additions & 0 deletions plot_testing/bar.ipynb

Large diffs are not rendered by default.

108 changes: 108 additions & 0 deletions plot_testing/heatmap.ipynb

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions plot_testing/stacked_bar.ipynb

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions plot_testing/stacked_line.ipynb

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions usage_example.ipynb

Large diffs are not rendered by default.

0 comments on commit a3e6462

Please sign in to comment.