File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 3
3
"""
4
4
import numpy as np
5
5
import matplotlib .pyplot as plt
6
+ from matplotlib .ticker import NullFormatter
6
7
8
+ np .random .seed (1 )
7
9
# make up some data in the interval ]0, 1[
8
10
y = np .random .normal (loc = 0.5 , scale = 0.4 , size = 1000 )
9
11
y = y [(y > 0 ) & (y < 1 )]
10
12
y .sort ()
11
13
x = np .arange (len (y ))
12
14
13
15
# plot with various axes scales
14
- fig , axs = plt .subplots (2 , 2 )
16
+ fig , axs = plt .subplots (2 , 2 , sharex = True )
17
+ fig .subplots_adjust (left = 0.08 , right = 0.98 , wspace = 0.3 )
15
18
16
19
# linear
17
20
ax = axs [0 , 0 ]
30
33
31
34
32
35
# symmetric log
33
- ax = axs [1 , 0 ]
36
+ ax = axs [1 , 1 ]
34
37
ax .plot (x , y - y .mean ())
35
- ax .set_yscale ('symlog' , linthreshy = 0.05 )
38
+ ax .set_yscale ('symlog' , linthreshy = 0.02 )
36
39
ax .set_title ('symlog' )
37
40
ax .grid (True )
38
41
39
42
# logit
40
- ax = axs [1 , 1 ]
43
+ ax = axs [1 , 0 ]
41
44
ax .plot (x , y )
42
45
ax .set_yscale ('logit' )
43
46
ax .set_title ('logit' )
44
47
ax .grid (True )
48
+ ax .yaxis .set_minor_formatter (NullFormatter ())
45
49
46
50
47
51
plt .show ()
You can’t perform that action at this time.
0 commit comments