|
21 | 21 |
|
22 | 22 |
|
23 | 23 | # %% |
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) |
25 | 26 |
|
26 | 27 |
|
27 | 28 | # %% |
28 | 29 | axs = sp.montage_plot(1, panel_size=(6.5, 4.5)) |
29 | | -axs.scatter(datax, datay) |
| 30 | +axs.scatter(datax, datay, alpha=0.5) |
30 | 31 |
|
31 | | -# axs.xaxis.set_minor_locator(AutoMinorLocator()) |
32 | | -sp.layout_v2( |
| 32 | +sp.layout( |
33 | 33 | axs, |
34 | 34 | 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, |
37 | 45 | ) |
38 | 46 |
|
39 | 47 |
|
40 | 48 |
|
| 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 | + |
41 | 61 | # %% |
42 | 62 | axs = sp.montage_plot(1, panel_size=(4.5, 3.5)) |
43 | 63 | axs.scatter(datax, datay) |
|
0 commit comments