nomo.py


1
from pynomo.nomographer import *
2
3
scale1 = {
4
  'u_min':             6,
5
  'u_max':             54,
6
  'function_x':        lambda u: 0,
7
  'function_y':        lambda u: (u - 6) / (54 - 6),
8
  'title':             r'$\rm m^3/h$',
9
  'title_x_shift':     -1.2,
10
  'title_y_shift':     0.5,
11
  'tick_levels':       3,
12
  'tick_text_levels':  1,
13
  'tick_side':         'left',
14
  'text_format':       '%.0f'
15
}
16
17
scale2 = {
18
  'u_min':             100,
19
  'u_max':             900,
20
  'function_x':        lambda u: 0,
21
  'function_y':        lambda u: (u - 100) / (900 - 100),
22
  'title':             r'$\rm l/min$',
23
  'title_x_shift':     1.2,
24
  'title_y_shift':     0.5,
25
  'tick_levels':       3,
26
  'tick_text_levels':  1,
27
  'tick_side':         'right',
28
  'text_format':       '%.0f'
29
}
30
31
scale3 = {
32
  'u_min':             5 / 3,
33
  'u_max':             15,
34
  'function_x':        lambda u: 1,
35
  'function_y':        lambda u: (u - 5 / 3) / (15 - 5 / 3),
36
  'title':             r'$\rm l/s$',
37
  'title_x_shift':     1.2,
38
  'title_y_shift':     0.5,
39
  'tick_levels':       3,
40
  'tick_text_levels':  1,
41
  'tick_side':         'right',
42
  'text_format':       '%.0f'
43
}
44
45
block1 = {
46
  'block_type':        'type_8',
47
  'f_params':          scale1
48
}
49
50
block2 = {
51
  'block_type':        'type_8',
52
  'f_params':          scale2
53
}
54
55
block3 = {
56
  'block_type':        'type_8',
57
  'f_params':          scale3
58
}
59
60
main_params={
61
  'filename':          'nomo.pdf',
62
  'title_x':           1,
63
  'title_y':           11.5,
64
  'title_box_width':   10,
65
  'title_str':         r'Volumenstrom',
66
  'paper_height':      10.0,
67
  'paper_width':       2,
68
  'block_params':      [block1, block2, block3],
69
  'transformations':   [('scale paper',)],
70
}
71
72
Nomographer(main_params)