|
8 | 8 | # format_version: '1.3' |
9 | 9 | # jupytext_version: 1.18.1 |
10 | 10 | # kernelspec: |
11 | | -# display_name: spaceplot |
| 11 | +# display_name: mpl-spaceplot |
12 | 12 | # language: python |
13 | 13 | # name: python3 |
14 | 14 | # --- |
15 | 15 |
|
16 | 16 | # %% |
17 | 17 | import numpy as np |
18 | | - |
19 | 18 | import spaceplot as sp |
20 | 19 |
|
21 | 20 | sp.display('dark', retina=True, transparent=False) |
|
27 | 26 |
|
28 | 27 | # %% |
29 | 28 | 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 |
55 | 30 |
|
56 | 31 | # %% |
57 | 32 | axs = sp.montage_plot(1, panel_size=(6.5, 4.5)) |
58 | 33 | axs.scatter(datax, datay) |
59 | 34 |
|
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 | + |
61 | 49 |
|
62 | 50 |
|
63 | 51 | # %% |
64 | 52 | axs = sp.montage_plot(1, panel_size=(4.5, 3.5)) |
65 | 53 | axs.scatter(datax, datay) |
66 | 54 |
|
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') |
69 | 57 |
|
70 | 58 |
|
71 | 59 | # %% |
|
80 | 68 |
|
81 | 69 | import numpy as np |
82 | 70 |
|
83 | | - |
84 | 71 | def calculate_figure_size(design, ref_panel_idx, ref_panel_size, w_ratios, h_ratios): |
85 | 72 | """ |
86 | 73 | Calculate the figure size needed for a given subplot design. |
|
0 commit comments