Skip to content

Commit

Permalink
Increase font size of sphere but not mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy committed Aug 14, 2022
1 parent fa16ca5 commit 7eb119a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
8 changes: 6 additions & 2 deletions pys2sleplet/plotting/create_plot_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
create_layout,
create_tick_mark,
)
from pys2sleplet.utils.vars import MESH_UNSEEN
from pys2sleplet.utils.vars import MESH_CBAR_FONT_SIZE, MESH_CBAR_LEN, MESH_UNSEEN

_file_location = Path(__file__).resolve()
_fig_path = _file_location.parents[1] / "figures"
Expand Down Expand Up @@ -68,7 +68,11 @@ def execute(self) -> None:
cmid=0.5 if self.normalise else 0,
cmin=0 if self.normalise else -tick_mark,
colorbar=create_colour_bar(
tick_mark, self.normalise, bar_pos=self.mesh.colourbar_pos
tick_mark,
self.normalise,
bar_len=MESH_CBAR_LEN,
bar_pos=self.mesh.colourbar_pos,
font_size=MESH_CBAR_FONT_SIZE,
),
colorscale=convert_colourscale(self.colour),
lighting=Lighting(ambient=1),
Expand Down
11 changes: 8 additions & 3 deletions pys2sleplet/utils/plotly_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,21 @@ def create_tick_mark(


def create_colour_bar(
tick_mark: float, normalise: bool, *, bar_pos: float = 0.97
tick_mark: float,
normalise: bool,
*,
bar_len: float = 0.94,
bar_pos: float = 0.97,
font_size: int = 38,
) -> dict:
"""
default plotly colour bar
"""
return dict(
x=bar_pos,
len=0.94,
len=bar_len,
nticks=2 if normalise else None,
tickfont=dict(color="#666666", size=38),
tickfont=dict(color="#666666", size=font_size),
tickformat=None if normalise else "+.1e",
tick0=None if normalise else -tick_mark,
dtick=None if normalise else tick_mark,
Expand Down
2 changes: 2 additions & 0 deletions pys2sleplet/utils/vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
GAUSSIAN_KERNEL_THETA_DEFAULT: float = 1
L_MAX_DEFAULT: int = -1
L_MIN_DEFAULT: int = 0
MESH_CBAR_FONT_SIZE: int = 32
MESH_CBAR_LEN: float = 0.95
MESH_UNSEEN: float = -1e5 # kaleido bug
PHI_0: float = np.pi
PHI_MIN_DEFAULT: float = 0.0
Expand Down

0 comments on commit 7eb119a

Please sign in to comment.