Skip to content

Commit a5f0006

Browse files
committed
updated notebook
1 parent f0fa7ca commit a5f0006

File tree

1 file changed

+18
-31
lines changed

1 file changed

+18
-31
lines changed

notebooks/sp_layout.py

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
# format_version: '1.3'
99
# jupytext_version: 1.18.1
1010
# kernelspec:
11-
# display_name: spaceplot
11+
# display_name: mpl-spaceplot
1212
# language: python
1313
# name: python3
1414
# ---
1515

1616
# %%
1717
import numpy as np
18-
1918
import spaceplot as sp
2019

2120
sp.display('dark', retina=True, transparent=False)
@@ -27,45 +26,34 @@
2726

2827
# %%
2928
import layout_v2 as l2
30-
31-
import spaceplot.appearance.layout as ly
32-
from spaceplot.appearance import tools as aptls
33-
34-
# %%
35-
kwargs = {
36-
'y_ticks': True,
37-
'tick_color': 'test value', #
38-
'grid_label': 'test value',
39-
'title': 'hello',
40-
# 'x_grid_color': 'blue',
41-
'minor': True,
42-
'grid_color': 'red',
43-
'y_tick_size': 12,
44-
'x_grid': True,
45-
'y_margins': 0.2,
46-
'label': 'X Axis',
47-
}
48-
49-
axis_params, static_params = l2.merge_axis_kwargs(kwargs)
50-
51-
x_label_params, x_tick_params, x_params = l2.compile_axis_settings(axis_params, axis='x')
52-
y_label_settings, y_tick_params, y_params = l2.compile_axis_settings(axis_params, axis='y')
53-
54-
x_params
29+
from matplotlib.ticker import AutoMinorLocator, NullLocator
5530

5631
# %%
5732
axs = sp.montage_plot(1, panel_size=(6.5, 4.5))
5833
axs.scatter(datax, datay)
5934

60-
l2.layout(axs, grid='minor')
35+
# axs.xaxis.set_minor_locator(AutoMinorLocator())
36+
l2.layout(
37+
axs,
38+
title='Scatter',
39+
# ticks='all',
40+
grid='major',
41+
minor='2',
42+
x_label_color='crimson',
43+
x_label='X-axis',
44+
y_label='Y-axis',
45+
# grid_zorder=10
46+
)
47+
48+
6149

6250

6351
# %%
6452
axs = sp.montage_plot(1, panel_size=(4.5, 3.5))
6553
axs.scatter(datax, datay)
6654

67-
l2.set_tick_grid_visibility(axs, axis='x', ticks='1', minor=True, grid='major')
68-
l2.set_tick_grid_visibility(axs, axis='y', ticks='1', minor=True, grid='major')
55+
l2.tick_grid_visibility(axs, axis='x', ticks='1', minor=True, grid='major')
56+
l2.tick_grid_visibility(axs, axis='y', ticks='1', minor=True, grid='major')
6957

7058

7159
# %%
@@ -80,7 +68,6 @@
8068

8169
import numpy as np
8270

83-
8471
def calculate_figure_size(design, ref_panel_idx, ref_panel_size, w_ratios, h_ratios):
8572
"""
8673
Calculate the figure size needed for a given subplot design.

0 commit comments

Comments
 (0)