Skip to content

Commit 5f79107

Browse files
committed
updated notebook
1 parent 7278b55 commit 5f79107

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

notebooks/sp_layout.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,43 @@
2121

2222

2323
# %%
24-
datax, datay = np.random.rand(50), np.random.rand(50)
24+
n_points = 150
25+
datax, datay = np.random.rand(n_points), np.random.rand(n_points)
2526

2627

2728
# %%
2829
axs = sp.montage_plot(1, panel_size=(6.5, 4.5))
29-
axs.scatter(datax, datay)
30+
axs.scatter(datax, datay, alpha=0.5)
3031

31-
# axs.xaxis.set_minor_locator(AutoMinorLocator())
32-
sp.layout_v2(
32+
sp.layout(
3333
axs,
3434
title='Scatter Plot',
35-
x_grid='both',
36-
minor=False
35+
abc=True,
36+
# breaks=np.linspace(0, 1, 6),
37+
# tick_labelcolor='crimson',
38+
# x_ticklabels=['Low', 'Medium', 'High'],
39+
lims=(0.01, 2),
40+
scale='log',
41+
# margins=0.9,
42+
grid='both',
43+
# abc_box=False,
44+
aspect=1,
3745
)
3846

3947

4048

49+
# %%
50+
axis = 'x'
51+
axis_obj = getattr(axs, f'{axis}axis')
52+
53+
# mapping for tick visibility in x/y axis
54+
p1 = 'bottom' if axis == 'x' else 'left'
55+
p2 = 'top' if axis == 'x' else 'right'
56+
57+
keys = [p1, f'label{p1}', p2, f'label{p2}']
58+
curr_params = axis_obj.get_tick_params()
59+
curr_params = {k: v for k, v in curr_params.items() if k in keys}
60+
4161
# %%
4262
axs = sp.montage_plot(1, panel_size=(4.5, 3.5))
4363
axs.scatter(datax, datay)

0 commit comments

Comments
 (0)