Blocks

Every block in pynomo represents some equation. The blocks and their functions are listed in the following table.

Type 1

\(F_1(u_1)+F_2(u_2)+F_3(u_3)=0 \,\)

Three parallel lines

Type 2

\(F_1(u_1)=F_2(u_2) F_3(u_3) \,\)

“N” or “Z”

Type 3

\(F_1(u_1)+F_2(u_2)+\cdots+F_N(u_N)=0\)

N parallel lines

Type 4

\(\frac{F_1(u_1)}{F_2(u_2)}=\frac{F_3(u_3)}{F_4(u_4)}\)

“Proportion”

Type 5

\(F_1(v) = F_2(x,u). \,\)

“Contour”

Type 6

\(u=u \,\)

“Ladder”

Type 7

\(\frac{1}{F_1(u_1)}+\frac{1}{F_2(u_2)}=\frac{1}{F_3(u_3)} \,\)

“Angle”

Type 8

\(y = {F(u)} \,\)

“Single”

Type 9

\(\begin{vmatrix}F_1(u_1[,v_1])& G_1(u_1[,v_1]) & H_1(u_1[,v_1])\\ F_2(u_2[,v_2])& G_2(u_2[,v_2]) & H_2(u_2[,v_2]) \\ F_3(u_3[,v_3])& G_3(u_3[,v_3]) & H_3(u_3[,v_3]) \end{vmatrix} = 0\)

“General”

Type 10

\(F_1(u)+F_2(v)F_3(w)+F_4(w)=0 \,\)

One curved line

Type 1

Type 1 is three parallel lines that have functional relationship:

\[F_1(u_1)+F_2(u_2)+F_3(u_3)=0\]

Note, that this kind of function can be transformed to many forms by using type 8 that is a equation given in determinant form. Use of this nomograph is given by the following simple example.

Simple example

This simple example plots nomograph for equation:

\[u_1 + u_2 + u_3 = 0.\]

Generated nomograph

../_images/ex_type1_nomo_1.png

Source code of simple example of type 1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""
    ex_type1_nomo_1.py

    Simple nomogram of type 1: F1+F2+F3=0
"""
import sys
sys.path.insert(0, "..")
#sys.path[:0] = [".."]
from pynomo.nomographer import *

N_params_1={
        'u_min':0.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_1$',
        'tick_levels':2,
        'tick_text_levels':1,
                }

N_params_2={
        'u_min':0.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_2$',
        'tick_levels':2,
        'tick_text_levels':1,
                }

N_params_3={
        'u_min':0.0,
        'u_max':-10.0,
        'function':lambda u:u,
        'title':r'$u_3$',
        'tick_levels':2,
        'tick_text_levels':1,
                }


block_1_params={
             'block_type':'type_1',
             'width':10.0,
             'height':10.0,
             'f1_params':N_params_1,
             'f2_params':N_params_2,
             'f3_params':N_params_3,
             'isopleth_values':[[6,2,'x']],
             }

main_params={
              'filename':'ex_type1_nomo_1.pdf',
              'paper_height':10.0,
              'paper_width':10.0,
              'block_params':[block_1_params],
              'transformations':[('rotate',0.01),('scale paper',)],
              'title_str':r'$u_1+u_2+u_3=0$',
              'debug':False,
              }
Nomographer(main_params)

Parameters for type 1

Axis parameters

Specific axis parameters for type 1

parameter key

default value

type, explanation

'function'

func(u). Function in equation For example lambda u: u

'u_min'

Float. Minimum value of function variable.

'u_max'

Float. Maximum value of function variable.

See Common axis params for other parameters.

Block parameters

Specific block parameters for type 1

parameter

default value

explanation

'block_type'

'type_1'

String. This is type 1 block

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'f1_params'

Axis params Dict. Axis params for function f1

'f2_params'

Axis params Dict. Axis params for function f2

'f3_params'

Axis params Dict. Axis params for function f3

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'proportion'

1.0

Float. Factor for spacings between lines

'isopleth_values'

[[]]

** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example:[[0.8, 0.1, 'x'], ['x', 0.2, 1.0]]

General parameters

See Main params for top level main parameters.

Type 2

Type 1 is “N” or “Z” nomograph that have functional relationship:

\[F_1(u_1) = F_2(u_2) F_3(u_3)\]

Use of this nomograph is given by the following simple example.

Simple example

This simple example plots nomograph for equation:

\[u_1 = u_2 u_3\]

Generated nomograph

../_images/ex_type2_nomo_1.png

Source code of simple example of type 2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"""
    ex_type2_nomo_1.py

    Simple nomogram of type 2: F1=F2*F3
"""
import sys
sys.path.insert(0, "..")
from pynomo.nomographer import *

N_params_1={
        'u_min':0.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_1$',
        'tick_levels':3,
        'tick_text_levels':1,
                }

N_params_2={
        'u_min':0.5,
        'u_max':6.0,
        'function':lambda u:u,
        'title':r'$u_2$',
        'tick_levels':3,
        'tick_text_levels':2,
        'scale_type':'linear smart',
                }

N_params_3={
        'u_min':0.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_3$',
        'tick_levels':3,
        'tick_text_levels':1,
                }


block_1_params={
             'block_type':'type_2',
             'width':10.0,
             'height':10.0,
             'f1_params':N_params_1,
             'f2_params':N_params_2,
             'f3_params':N_params_3,
             'isopleth_values':[[9,1.5,'x']],
             }

main_params={
              'filename':'ex_type2_nomo_1.pdf',
              'paper_height':10.0,
              'paper_width':10.0,
              'block_params':[block_1_params],
              'transformations':[('rotate',0.01),('scale paper',)],
              'title_str':r'$u_1=u_2\times u_3$'
              }
Nomographer(main_params)

Parameters for type 2

Axis parameters

Specific axis parameters for type 2

parameter key

default value

type, explanation

'function'

func(u). Function in equation For example lambda u: u

'u_min'

Float. Minimum value of function variable.

'u_max'

Float. Maximum value of function variable.

See Common axis params for other parameters.

Block parameters

Specific block parameters for type 2

parameter

default value

explanation

'block_type'

'type_2'

String. This is type 2 block

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'f1_params'

Axis params Dict. Axis params for function f1

'f2_params'

Axis params Dict. Axis params for function f2

'f3_params'

Axis params Dict. Axis params for function f3

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'proportion'

1.0

Float. Factor for spacings between lines

'isopleth_values'

[[]]

** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example:[[0.8, 0.1, 'x'], ['x', 0.2, 1.0]]

General parameters

See Main params for top level main parameters.

Type 3

Type 3 has N parallel lines that have functional relationship:

\[F_1(u_1) + F_2(u_2) + \cdots + F_N(u_N) = 0\]

Use of this nomograph is given by the following simple example.

Simple example

This simple example plots nomograph for equation:

\[u_1 + u_2 + u_3 + u_4 + u_5 + u_6 = 0\]

Generated nomograph

../_images/ex_type3_nomo_1.png

Source code of simple example of type 2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"""
    ex_type3_nomo_1.py

    Simple nomogram of type 3: F1+F2+...+FN=0
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
import sys
sys.path.insert(0, "..")
from pynomo.nomographer import *

N_params_1={
        'u_min':0.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_1$',
        'tick_levels':2,
        'tick_text_levels':1,
                }
N_params_2={
        'u_min':0.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_2$',
        'tick_levels':2,
        'tick_text_levels':1,
                }
N_params_3={
        'u_min':0.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_3$',
        'tick_levels':2,
        'tick_text_levels':1,
                }
N_params_4={
        'u_min':0.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_4$',
        'tick_levels':2,
        'tick_text_levels':1,
                }
N_params_5={
        'u_min':0.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_5$',
        'tick_levels':2,
        'tick_text_levels':1,
                }
N_params_6={
        'u_min':-20.0,
        'u_max':0.0,
        'function':lambda u:u,
        'title':r'$u_6$',
        'tick_levels':2,
        'tick_text_levels':1,
        'tick_side':'right',
                }

block_1_params={
             'block_type':'type_3',
             'width':10.0,
             'height':10.0,
             'f_params':[N_params_1,N_params_2,N_params_3,
                         N_params_4,N_params_5,N_params_6],
             'isopleth_values':[[3,2,1,0,3,'x']],
             }

main_params={
              'filename':'ex_type3_nomo_1.pdf',
              'paper_height':20.0,
              'paper_width':20.0,
              'block_params':[block_1_params],
              'transformations':[('rotate',0.01),('scale paper',)],
              'title_str':r'$u_1+u_2+u_3+u_4+u_5+u_6=0$',
              'title_y':21.0,
              }
Nomographer(main_params)

Parameters for type 3

Axis parameters

Specific axis parameters for type 3

parameter key

default value

type, explanation

'function'

func(u). Function in equation For example lambda u: u

'u_min'

Float. Minimum value of function variable.

'u_max'

Float. Maximum value of function variable.

See Common axis params for other parameters.

Block parameters

Specific block parameters for type 3

parameter

default value

explanation

'block_type'

'type_3'

String. This is type 3 block

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'f_params'

List of Axis params Dict. List of Axis params.

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'reference_padding'

0.2

Float. Additional length to reference axes.

'reference_titles'

[]

Array of Strings. List of reference line titles. For example [‘$R_1$’,’$R_2$’,’$R_3$’]`.

'reference_color'

color.rgb.black

Color. Color of reference lines.

'isopleth_values'

[[]]

** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example:[[0.8,'x',0.7,7.0,9.0],[0.7,0.8,'x',5.0,4.44]]

General parameters

See Main params for top level main parameters.

Type 4

Type 4 is proportion nomograph that have functional relationship:

\[\frac{F_1(u_1)}{F_2(u_2)} = \frac{F_3(u_3)}{F_4(u_4)}\]

Simple example

This simple example plots nomograph for equation:

\[u_1 / u_2 = u_3 / u_4\]

Generated nomograph

../_images/ex_type4_nomo_1.png

Source code of simple example of type 4

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""
    ex_type4_nomo_1.py

    Simple nomogram of type 4: F1/F2=F3/F4
"""
import sys
sys.path.insert(0, "..")
from pynomo.nomographer import *

N_params_1={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_1$',
        'tick_levels':3,
        'tick_text_levels':1,
        'tick_side':'left',
                }
N_params_2={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_2$',
        'tick_levels':3,
        'tick_text_levels':1,
        'tick_side':'right',
                }
N_params_3={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_3$',
        'tick_levels':3,
        'tick_text_levels':1,
        'tick_side':'right',
        'title_draw_center':True,
        'title_opposite_tick':False,
                }
N_params_4={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u_4$',
        'tick_levels':3,
        'tick_text_levels':1,
        'tick_side':'left',
        'title_draw_center':True,
        'title_opposite_tick':False,
                }

block_1_params={
                'block_type':'type_4',
                'f1_params':N_params_1,
                'f2_params':N_params_2,
                'f3_params':N_params_3,
                'f4_params':N_params_4,
                'isopleth_values':[[7,6,2,'x']],
                             }

main_params={
              'filename':'ex_type4_nomo_1.pdf',
              'paper_height':10.0,
              'paper_width':10.0,
              'block_params':[block_1_params],
              'transformations':[('rotate',0.01),('scale paper',)],
              'title_str':r'$u_1/u_2=u_3/u_4$',
              'title_y':8.0,
              }
Nomographer(main_params)

Parameters for type 4

Axis parameters

Specific axis parameters for type 4

parameter key

default value

type, explanation

'function'

func(u). Function in equation For example lambda u: u

'u_min'

Float. Minimum value of function variable.

'u_max'

Float. Maximum value of function variable.

See Common axis params for other parameters.

Block parameters

Specific block parameters for type 4

parameter

default value

explanation

'block_type'

'type_4'

String. This is type 4 block

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'f1_params'

Axis params Dict. Axis params for function f1

'f2_params'

Axis params Dict. Axis params for function f2

'f3_params'

Axis params Dict. Axis params for function f3

'f4_params'

Axis params Dict. Axis params for function f4

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'padding'

0.9

Float. How much axis extend w.r.t. width/height.

'float_axis'

'F1 or F2'

Strings. If given ‘F1 or F2’, then scaling is according to them, otherwise according to F3 and F4.

'reference_color'

color.rgb.black

Color. Color of reference lines.

'isopleth_values'

[[]]

** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example:[[0.8,'x',0.7,0.5],[0.7,0.8,'x',0.3]]

General parameters

See Main params for top level main parameters.

Type 5

Type 5 is graphing block that has functional relationship:

\[F_1(u) = F_2(x,v).\]

This type of block is used commonly in nomographs that have an equation in form

\[f_a(a_1,a_2,a_3,...) = f_b(u,v)\]

and

\[f_b(u,v)\]

cannot be represented as line-nomograph. Typically equation above is written as pair of equations:

\[f_a(a_1,a_2,a_3,...) = x\]

and

\[f_b(u,v) = x.\]

This equation is written in form

\[F_1(u) = F_2(x,v).\]

in order to construct this contour block. In reality block consists of horizontal lines:

\[F_1(u) = y\]

and contour lines

\[F_2(x,v) = y,\]

where x and y are the coordinates of canvas. Coordinate x is reference with name wd in block parameters and it holds

\[x = f_{wd}(wd).\]

Note

Type 5 is a very complex (say stupid) way to make basic graphs. In the future versions of pynomo a more simple way for graphs will be implemented.

Simple example

In the following example

\[F_1(u)=u\]

and

\[F_2(wd,v)=wd+v.\]

Thus the original equation is

\[wd=u-v.\]

Generated nomograph

../_images/ex_type5_nomo_1.png

Source code of simple example of type 5

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""
    ex_type5_nomo_1.py

    Simple nomogram of type 5.
"""
import sys
sys.path.insert(0, "..")
from pynomo.nomographer import *



block_params={
   'block_type':'type_5',
   'u_func':lambda u:u,
   'v_func':lambda x,v:x+v,
   'u_values':[1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0],
   'v_values':[1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0],
   'wd_tick_levels':2,
   'wd_tick_text_levels':1,
   'wd_tick_side':'right',
   'wd_title':'wd = u-v',
   'u_title':'u',
   'v_title':'v',
   'wd_title_opposite_tick':True,
   'wd_title_distance_center':2.5,
   'isopleth_values':[[6.5,7,'x']],
 }


main_params={
              'filename':'ex_type5_nomo_1.pdf',
              'paper_height':10.0,
              'paper_width':10.0,
              'block_params':[block_params],
              'transformations':[('rotate',0.01),('scale paper',)]
              }

Nomographer(main_params)

Parameters for type 5

Axis parameters

No specific axis parameters. Everything is defined in block.

Block parameters

Specific block parameters for type 5

parameter

default value

explanation

'block_type'

'type_5'

String. This is type 5 block.

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'u_func'

func(u). u function. For example lambda u: u

'v_func'

func(u,v). v function. For example lambda x,v: x+v

'wd_func'

func(wd). wd func. For example lambda wd: wd

'wd_func_inv'

func(wd). Inverse of wd-func. For example lambda wd: wd

'u_values'

List of Floats. List of plotted u values. For example [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]`.

'u_tag'

'none'

String. To align blocks w.r.t each other along axes with same tag.

'u_title'

''

String. Axis title.

'u_title_x_shift'

0.0

Float. Title shift in x-direction.

'u_title_y_shift'

0.25

Float. Title shift in y-direction.

'u_scale_type'

'linear'

String. Scale type. Can be 'linear': linear scale. 'log': logarithmic scale. 'smart linear': linear scale with equal spacings. 'smart log': logarithmic scale with equal spacings, can also have negative values. 'manual point': Points and corresponding text positions are given manually in 'manual axis data'. No line is drawn. 'manual line': Ticks and corresponding text positions are given manually in 'manual axis data'.

'u_tick_levels'

4

Integer. How many levels (minor, minor-minor, etc.) of ticks are drawn. Largest effect to ‘linear’ scale.

'u_tick_text_levels'

'3'

Integer. How many levels (minor, minor-minor, etc.) of texts are drawn. Largest effect to ‘linear’ scale.

'u_tick_side'

'right'

String. Tick and text side in final paper. Can be: 'right'``or ``'left'

'u_reference'

False

Boolean. If axis is treated as reference line that is a turning point.

'u_reference_padding'

'0.2'

Float. Fraction of reference line over other lines.

'u_manual_axis_data'

{}

Dict. Manually set tick/point positions and text positions. Could be for example:``{1:’1’, 3.14:r’$pi$’, 5:’5’,7:’seven’, 10:’10’}`

'u_title_draw_center'

False

Boolean. Title is drawn to center of line.

'u_title_distance_center'

'0.5'

Float. When 'u_title_draw_center' is 'True' sets distance of title from axis.

'u_title_opposite_tick'

True

Boolean. Title in opposite direction w.r.t ticks.

'u_align_func'

lambda u:u

func(u). function to align different scales.

'u_align_x_offset'

0.0

Float. If axis is aligned with other axis, this value x offsets final scale.

'u_align_y_offset'

0.0

Float. If axis is aligned with other axis, this value y offsets final scale.

'u_text_format'

r'$%4.4g$ '

String. Format for numbers in scale.

'u_extra_params'

[{},...]

Array of Dicts. List of dictionary of params to be drawn additionally.

'u_text_distance_#'

x.x

Float. where #=0,1,2,3 or 4. Distance of text from scale line. Number corresponds to the level, where 0 is the major tick and 4 is the most minor ticks.

'u_grid_length_#'

x.x

Float. where #=0,1,2,3 or 4. Length of the tick. Number corresponds to the level, where 0 is the major tick and 4 is the most minor ticks.

'u_text_size_#'

x.x

Float. where #=0,1,2,3 or 4. Text size. For example: text.size.small, text.size.scriptsize or text.size.tiny. Number corresponds to the level, where 0 is the major tick and 4 is the most minor ticks.

'u_text_size_log_#'

x.x

Float. where #=0,1 or 2. Text size. For example: text.size.small, text.size.scriptsize or text.size.tiny . Number corresponds to the level, where 0 is the major tick and 2 is the most minor ticks.

'u_full_angle'

False

Boolean. If true, text can be upside down, otherwise +- 90 degrees from horizontal. Good foor example for full circle scales.

'u_extra_angle'

0.0

Float. Angle to rotate tick text from horizontal along tick.

'u_text_horizontal_align_center'

False

Boolean. Aligns tick text horizontally to center. Good when text rotated 90 degrees.

'u_axis_color'

color.rgb.black

Color. Color of axis.

'u_text_color'

color.rgb.black

Color. Color of tick texts.

'v_values'

List of Floats. List of plotted v values. For example [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]`.

'v_title'

''

String. Axis title.

'v_title_draw_center'

False

Boolean. Title is drawn to center of line.

'v_title_distance_center'

'0.5'

Float. When 'v_title_draw_center' is 'True' sets distance of title from axis.

'v_title_opposite_tick'

True

Boolean. Title in opposite direction w.r.t ticks.

'wd_tag'

'none'

String. To align blocks w.r.t each other along axes with same tag.

'wd_title'

''

String. Axis title.

'wd_title_x_shift'

0.0

Float. Title shift in x-direction.

'wd_title_y_shift'

0.25

Float. Title shift in y-direction.

'wd_scale_type'

'linear'

String. Scale type. Can be 'linear': linear scale. 'log': logarithmic scale. 'smart linear': linear scale with equal spacings. 'smart log': logarithmic scale with equal spacings, can also have negative values. 'manual point': Points and corresponding text positions are given manually in 'manual axis data'. No line is drawn. 'manual line': Ticks and corresponding text positions are given manually in 'manual axis data'.

'wd_tick_levels'

4

Integer. How many levels (minor, minor-minor, etc.) of ticks are drawn. Largest effect to ‘linear’ scale.

'wd_tick_text_levels'

'3'

Integer. How many levels (minor, minor-minor, etc.) of texts are drawn. Largest effect to ‘linear’ scale.

'wd_tick_side'

'right'

String. Tick and text side in final paper. Can be: 'right'``or ``'left'

'wd_reference'

False

Boolean. If axis is treated as reference line that is a turning point.

'wd_reference_padding'

'0.2'

Float. Fraction of reference line over other lines.

'wd_manual_axis_data'

{}

Dict. Manually set tick/point positions and text positions. Could be for example:{1:'1', 3.14:r'$\pi$', 5:'5', 7:'seven', 10:'10'}

'wd_title_draw_center'

False

Boolean. Title is drawn to center of line.

'wd_title_distance_center'

'0.5'

Float. When 'wd_title_draw_center' is 'True' sets distance of title from axis.

'wd_title_opposite_tick'

True

Boolean. Title in opposite direction w.r.t ticks.

'wd_align_func'

lambda u:u

func(u). function to align different scales.

'wd_align_x_offset'

0.0

Float. If axis is aligned with other axis, this value x offsets final scale.

'wd_align_y_offset'

0.0

Float. If axis is aligned with other axis, this value y offsets final scale.

'wd_text_format'

r'$%4.4g$ '

String. Format for numbers in scale.

'wd_extra_params'

[{},...]

Array of Dicts. List of dictionary of params to be drawn additionally.

'wd_text_distance_#'

x.x

Float. where #=0,1,2,3 or 4. Distance of text from scale line. Number corresponds to the level, where 0 is the major tick and 4 is the most minor ticks.

'wd_grid_length_#'

x.x

Float. where #=0,1,2,3 or 4. Length of the tick. Number corresponds to the level, where 0 is the major tick and 4 is the most minor ticks.

'wd_text_size_#'

x.x

Float. where #=0,1,2,3 or 4. Text size. For example: text.size.small, text.size.scriptsize or text.size.tiny. Number corresponds to the level, where 0 is the major tick and 4 is the most minor ticks.

'wd_text_size_log_#'

x.x

Float. where #=0,1 or 2. Text size. For example: text.size.small, text.size.scriptsize or text.size.tiny . Number corresponds to the level, where 0 is the major tick and 2 is the most minor ticks.

'wd_full_angle'

False

Boolean. If true, text can be upside down, otherwise +- 90 degrees from horizontal. Good foor example for full circle scales.

'wd_extra_angle'

0.0

Float. Angle to rotate tick text from horizontal along tick.

'wd_text_horizontal_align_center'

False

Boolean. Aligns tick text horizontally to center. Good when text rotated 90 degrees.

'wd_axis_color'

color.rgb.black

Color. Color of axis.

'wd_text_color'

color.rgb.black

Color. Color of tick texts.

'horizontal_guides'

False

Boolean. When 'True' generates horizontal guide lines.

'horizontal_guide_nr'

?

Float. When 'horizontal_guides' is 'True' generates 'n' evenly space horizontal guide lines.

'vertical_guides'

True

Boolean. When 'True' generates vertical guide lines.

'vertical_guide_nr'

?

Float. When 'vertical_guides' is 'True' generates 'n' evenly space vertical guide lines.

'isopleth_values'

[[]]

** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example:[[0.8,'x',0.7],[0.7,0.8,'x']]

General parameters

See Main params for top level main parameters.

Type 6

Type 6 is ladder nomograph:

\[u = u.\]

In practice this means that if one axis has for example y-position as

\[y = f_1(u)\]

and it was desirable to have

\[y = f_2(u)\]

in order to connect blocks together, one uses ladder to make the transformation.

Note

Ladders are not beautiful and should be used only when no other solution exist.

Simple example

This simple example plots nomograph for equation:

\[u = u,\]

where linear scale is converted to a logarithmic scale.

Generated nomograph

../_images/ex_type6_nomo_1.png

Source code of simple example of type6

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""
    ex_type6_nomo_1.py

    Simple nomogram of type 6.
"""
import sys
sys.path.insert(0, "..")
from pynomo.nomographer import *

N_params_1={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u**0.5,
        'title':'u',
        'tick_levels':3,
        'tick_text_levels':2,
        'tick_side':'left',
        }

N_params_2={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:log(u),
        'title':'u',
        'tick_levels':3,
        'tick_text_levels':2,
        }

block_params={
              'block_type':'type_6',
              'f1_params':N_params_1,
              'f2_params':N_params_2,
              'width':5.0,
              'height':10.0,
              'isopleth_values':[[2.2,'x']],
              #'curve_const':0.01
                     }

main_params={
              'filename':'ex_type6_nomo_1.pdf',
              'paper_height':10.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[('rotate',0.01),('scale paper',)]
              }

Nomographer(main_params)

Parameters for type 6

Axis parameters

Specific axis parameters for type 6

parameter key

default value

type, explanation

'function'

func(u). Function in equation For example lambda u: u

'u_min'

Float. Minimum value of function variable.

'u_max'

Float. Maximum value of function variable.

See Common axis params for other parameters.

Block parameters

Specific block parameters for type 6

parameter

default value

explanation

'block_type'

'type_6'

String. This is type 6 block.

'type'

'parallel'

String. Can be either 'parallel'``or ``'orthogonal'.

'x_empty'

0.2

Float. If orthogonal, how much fractional space before start of x-axis.

'y_empty'

0.2

Float. If orthogonal, how much fractional space before start of y-axis.

'curve_const'

0.0

Float. Sets the lenght of angle of Bezier curve. low value = straigh line, high value = curved line.

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'f1_params'

Axis params Dict. Axis params for function f1

'f2_params'

Axis params Dict. Axis params for function f2

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'ladder_color'

color.rgb.black

Color. Ladder color.

'isopleth_values'

[[]]

** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example:[[0.8,'x'],[0.7,'x']]

General parameters

See Main params for top level main parameters.

Type 7

Type 7 is “angle” nomograph that has functional relationship:

\[\frac{1}{F_1(u_1)}+\frac{1}{F_2(u_2)}=\frac{1}{F_3(u_3)}\]

Simple example

This simple example plots nomograph for equation:

\[1/ u_1 + 1/u_2 = 1 / u_3\]

Generated nomograph

../_images/ex_type7_nomo_1.png

Source code of simple example of type 2

Parameters for type 7

Axis parameters

Specific axis parameters for type 7

parameter key

default value

type, explanation

'function'

func(u). Function in equation For example lambda u: u

'u_min'

Float. Minimum value of function variable.

'u_max'

Float. Maximum value of function variable.

See Common axis params for other parameters.

Block parameters

Specific block parameters for type 7

parameter

default value

explanation

'block_type'

'type_7'

String. This is type 7 block

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'f1_params'

Axis params Dict. Axis params for function f1

'f2_params'

Axis params Dict. Axis params for function f2

'f3_params'

Axis params Dict. Axis params for function f3

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'angle_u'

45.0

Float. Angle between u1 and u3. Note: later transformations may alter the angle.

'angle_v'

45.0

Float. Angle between u2 and u3. Note: later transformations may alter the angle.

'isopleth_values'

[[]]

** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example:[[0.8,'x',0.7],[0.7,0.8,'x']]

General parameters

See Main params for top level main parameters.

Type 8

Type 8 is single nomograph:

\[y = F(u)\]

or

\[x = F_x(u),\]
\[y = F_y(u).\]

x and y are coordinates of canvas. Often this block is used for construction of dual-scales to existing scales.

Simple example

This simple example plots single vertical scale.

Generated nomograph

../_images/ex_type8_nomo_1.png

Source code of simple example of type 8

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
    ex_type8_nomo_1.py

    Simple nomogram of type 8.
"""
import sys
sys.path.insert(0, "..")
from pynomo.nomographer import *

N_params_1={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':'u',
        'tick_levels':3,
        'tick_text_levels':2,
        'tick_side':'left',
        }

block_params={
              'block_type':'type_8',
              'f_params':N_params_1,
              'width':5.0,
              'height':10.0,
              'isopleth_values':[[5]]
                     }

main_params={
              'filename':'ex_type8_nomo_1.pdf',
              'paper_height':10.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[]
              }

Nomographer(main_params)

Parameters for type 8

Axis parameters

Specific axis parameters for type 8

parameter key

default value

type, explanation

'function'

func(u). Function in equation. For example lambda u: u.

'u_min'

Float. Minimum value of function variable.

'u_max'

Float. Maximum value of function variable.

'function_x'

func(u). x-position in function. If used ‘function_y’ must be defined. For example lambda u: u.

'function_y'

func(u). y-position in function. If used ‘function_x’ must be defined. Overrides ‘function’. For example lambda u: u.

See Common axis params for other parameters.

Block parameters

Specific block parameters for type 8

parameter

default value

explanation

'block_type'

'type_8'

String. This is type 8 block

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'f1_params'

Axis params Dict. Axis params for function f1

'f2_params'

Axis params Dict. Axis params for function f2

'f3_params'

Axis params Dict. Axis params for function f3

'f4_params'

Axis params Dict. Axis params for function f4

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'padding'

0.9

Float. How much axis extend w.r.t. width/height.

'float_axis'

'F1 or F2'

Strings. If given ‘F1 or F2’, then scaling is according to them, otherwise according to F3 and F4.

'reference_color'

color.rgb.black

Color. Color of reference lines.

'isopleth_values'

[[]]

** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example:[[0.8,'x',0.7,0.5], [0.7,0.8,'x',0.3]]

General parameters

See Main params for top level main parameters.

Type 9

Type 9 is “general determinant” nomograph that has functional relationship:

\[\begin{split}\begin{vmatrix} F_1(u_1[,v_1]) & G_1(u_1[,v_1]) & H_1(u_1[,v_1]) \\ F_2(u_2[,v_2]) & G_2(u_2[,v_2]) & H_2(u_2[,v_2]) \\ F_3(u_3[,v_3]) & G_3(u_3[,v_3]) & H_3(u_3[,v_3]) \end{vmatrix} = 0.\end{split}\]

This is the basic building block for line nomographs. Notation \(u[,v]\,\) is to be understood such that if v is defined´, a grid is constructed for the row, otherwise a normal scale with variable u.

Simple example

This simple example plots nomograph for equation in determinant form:

\[\begin{split}\begin{vmatrix} 0 & u_1 & 1 \\ u_2+2 & 2v_2+5 & 1 \\ 4 & u_3 & 1 \end{vmatrix} = 0\end{split}\]

Generated nomograph

../_images/ex_type9_nomo_1.png

Source code of simple example of type 9

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"""
    ex_type9_nomo_1.py

    Simple nomogram of type 9: determinant
"""
import sys
sys.path.insert(0, "..")
from pynomo.nomographer import *

N_params_1={
            'u_min':3.0,
            'u_max':10.0,
            'f':lambda u:0,
            'g':lambda u:u,
            'h':lambda u:1.0,
            'title':r'$u_1$',
            'scale_type':'linear',
            'tick_levels':3,
            'tick_text_levels':2,
            'grid':False}

N_params_2={
        'u_min':0.0, # for alignment
        'u_max':1.0,  # for alignment
        'f_grid':lambda u,v:u+2.0,
        'g_grid':lambda u,v:2*v+5.0,
        'h_grid':lambda u,v:1.0,
        'u_start':0.0,
        'u_stop':1.0,
        'v_start':0.0,
        'v_stop':1.0,
        'u_values':[0.0,0.25,0.5,0.75,1.0],
        'v_values':[0.0,0.25,0.5,0.75,1.0],
        'grid':True,
        'text_prefix_u':r'$u_2$=',
        'text_prefix_v':r'$v_2$=',
        }

N_params_3={
            'u_min':3.0,
            'u_max':10.0,
            'f':lambda u:4.0,
            'g':lambda u:u,
            'h':lambda u:1.0,
            'title':r'$u_3$',
            'scale_type':'linear',
            'tick_levels':3,
            'tick_text_levels':2,
            'grid':False
            }

block_params={
             'block_type':'type_9',
             'f1_params':N_params_1,
             'f2_params':N_params_2,
             'f3_params':N_params_3,
             'transform_ini':False,
             'isopleth_values':[[7,[0.75,0.5],'x']]
             }

main_params={
              'filename':'ex_type9_nomo_1.pdf',
              'paper_height':10.0,
              'paper_width':10.0,
              'block_params':[block_params],
              'transformations':[('rotate',0.01),('scale paper',)]
              }
Nomographer(main_params)

Parameters for type 9

Axis parameters

Specific axis parameters for type 9 grid axis

parameter key

default value

type, explanation

'grid'

Bool. True because this is grid.

'f'

func(u,v). F function in determinant. For example lambda u,v:u+v

'g'

func(u,v). G function in determinant. For example lambda u,v:u+v

'h'

func(u,v). H function in determinant. For example lambda u,v:u+v

'u_start'

u start when drawing v=const line

'u_stop'

u stop when drawing v=const line

'v_start'

v start when drawing u=const line

'v_stop'

v stop when drawing u=const line

'u_values'

List of grid lines u=const. For example [0.0,0.25,0.5,0.75,1.0]

'v_values'

List of grid lines v=const. For example ``[0.0,0.25,0.5,0.75,1.0]`

'text_prefix_u'

Text prefix for u before value

'text_prefix_v'

Text prefix for v before value

'v_texts_u_start'

False

If v-texts are in u start side

'v_texts_u_stop'

True

If v-texts are in u stop side

'u_texts_v_start'

False

If u-texts are in v start side

'u_texts_v_stop'

True

If u-texts are in v stop side

'u_line_color'

color.rgb.black

Color. u line color

'v_line_color'

color.rgb.black

Color. v line color

'u_text_color'

color.rgb.black

Color. u text color

'v_text_color'

color.rgb.black

Color. v text color

'text_distance'

0.25

Float. Text distance

'circles'

False

Boolean. If marker circles to crossings

'extra_params'

List of Dicts. List of params to be drawn.

See Common axis params for other parameters.

Block parameters

Specific block parameters for type 9

parameter

default value

explanation

'block_type'

'type_9'

String. This is type 9 block

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'f1_params'

Axis params Dict. Axis params for function f1

'f2_params'

Axis params Dict. Axis params for function f2

'f3_params'

Axis params Dict. Axis params for function f3

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'transform_ini'

False

Boolean. If row 1 and row 3 end and start are to be transformed to be in rectangle corners. If True, be sure that ‘u_min_trafo’ and ‘u_max_trafo’ are defined.

'isopleth_values'

[[]]

** List of list of isopleth values.** Grid values are given with tuple (a,b) and are not solved. Unknown values are given with strings, e.g. ‘x’. An example:[[0.8,(0.1,0.2),'x'], ['x',(0.1,0.2),1.0]]

General parameters

See Main params for top level main parameters.

Type 10

Type 10 is nomograph that has one curved line. It has functional relationship:

\[F_1(u)+F_2(v)F_3(w)+F_4(w)=0.\]

Simple example

This simple example plots nomograph for equation:

\[u + v w + w = 0.\]

Generated nomograph

../_images/ex_type10_nomo_1.png

Source code of simple example of type 10

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""
    ex_type10_nomo_1.py

    Simple nomogram of type 7: F1(u)+F2(v)*F3(w)+F4(w)=0
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
import sys
sys.path.insert(0, "..")
from pynomo.nomographer import *

N_params_1={
        'u_min':-10.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$u$',
        'tick_levels':3,
        'tick_text_levels':2,
                }

N_params_2={
        'u_min':-10.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':r'$v$',
        'tick_levels':3,
        'tick_text_levels':2,
        'tick_side':'left',
                }

N_params_3={
        'u_min':0.3,
        'u_max':4.0,
        'function_3':lambda u:u,
        'function_4':lambda u:u,
        'title':r'$w$',
        'tick_levels':4,
        'tick_text_levels':3,
        'scale_type':'linear smart',
        'title_draw_center':True,
                }

block_1_params={
             'block_type':'type_10',
             'width':10.0,
             'height':10.0,
             'f1_params':N_params_1,
             'f2_params':N_params_2,
             'f3_params':N_params_3,
             'isopleth_values':[[6,-4,'x']]
             }

main_params={
              'filename':'ex_type10_nomo_1.pdf',
              'paper_height':10.0,
              'paper_width':10.0,
              'block_params':[block_1_params],
              'transformations':[('rotate',0.01),('scale paper',)],
              'title_str':r'$u+vw+w=0$'
              }
Nomographer(main_params)

Parameters for type 10

Axis parameters

Specific axis parameters for type 10

parameter key

default value

type, explanation

'function'

func(u). Function in the equation for \(F_1\) and \(F_2. For example \)

'function_3'

func(u). Function in the equation for \(F_3\). For example lambda u: u

'function_4'

func(u). Function in the equation for \(F_4\). For example lambda u: u

'u_min'

Float. Minimum value of function variable.

'u_max'

Float. Maximum value of function variable.

See Common axis params for other parameters.

Block parameters

Specific block parameters for type 10

parameter

default value

explanation

'block_type'

'type_10'

String. This is type 10 block

'width'

10.0

Float. Block width (to be scaled)

'height'

10.0

Float. Block height (to be scaled)

'f1_params'

Axis params Dict. Axis params for function f1

'f2_params'

Axis params Dict. Axis params for function f2

'f3_params'

Axis params Dict. Axis params for function f3

'f4_params'

Axis params Dict. Axis params for function f4

'mirror_x'

False

Boolean. If x-axis is mirrored

'mirror_y'

False

Boolean. If y-axis is mirrored

'padding'

0.9

Float. How much axis extend w.r.t. width/height.

'float_axis'

'F1 or F2'

Strings. If given ‘F1 or F2’, then scaling is according to them, otherwise according to F3 and F4.

'reference_color'

color.rgb.black

Color. Color of reference lines.

'isopleth_values'

[[]]

** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example:[[0.8,'x',0.7,0.5],[0.7,0.8,'x',0.3]]

General parameters

See Main params for top level main parameters.