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    ex_type1_nomo_1.py
 3
 4    Simple nomogram of type 1: F1+F2+F3=0
 5"""
 6import sys
 7sys.path.insert(0, "..")
 8#sys.path[:0] = [".."]
 9from pynomo.nomographer import *
10
11N_params_1={
12        'u_min':0.0,
13        'u_max':10.0,
14        'function':lambda u:u,
15        'title':r'$u_1$',
16        'tick_levels':2,
17        'tick_text_levels':1,
18                }
19
20N_params_2={
21        'u_min':0.0,
22        'u_max':10.0,
23        'function':lambda u:u,
24        'title':r'$u_2$',
25        'tick_levels':2,
26        'tick_text_levels':1,
27                }
28
29N_params_3={
30        'u_min':0.0,
31        'u_max':-10.0,
32        'function':lambda u:u,
33        'title':r'$u_3$',
34        'tick_levels':2,
35        'tick_text_levels':1,
36                }
37
38
39block_1_params={
40             'block_type':'type_1',
41             'width':10.0,
42             'height':10.0,
43             'f1_params':N_params_1,
44             'f2_params':N_params_2,
45             'f3_params':N_params_3,
46             'isopleth_values':[[6,2,'x']],
47             }
48
49main_params={
50              'filename':'ex_type1_nomo_1.pdf',
51              'paper_height':10.0,
52              'paper_width':10.0,
53              'block_params':[block_1_params],
54              'transformations':[('rotate',0.01),('scale paper',)],
55              'title_str':r'$u_1+u_2+u_3=0$',
56              'debug':False,
57              }
58Nomographer(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    ex_type2_nomo_1.py
 3
 4    Simple nomogram of type 2: F1=F2*F3
 5"""
 6import sys
 7sys.path.insert(0, "..")
 8from pynomo.nomographer import *
 9
10N_params_1={
11        'u_min':0.0,
12        'u_max':10.0,
13        'function':lambda u:u,
14        'title':r'$u_1$',
15        'tick_levels':3,
16        'tick_text_levels':1,
17                }
18
19N_params_2={
20        'u_min':0.5,
21        'u_max':6.0,
22        'function':lambda u:u,
23        'title':r'$u_2$',
24        'tick_levels':3,
25        'tick_text_levels':2,
26        'scale_type':'linear smart',
27                }
28
29N_params_3={
30        'u_min':0.0,
31        'u_max':10.0,
32        'function':lambda u:u,
33        'title':r'$u_3$',
34        'tick_levels':3,
35        'tick_text_levels':1,
36                }
37
38
39block_1_params={
40             'block_type':'type_2',
41             'width':10.0,
42             'height':10.0,
43             'f1_params':N_params_1,
44             'f2_params':N_params_2,
45             'f3_params':N_params_3,
46             'isopleth_values':[[9,1.5,'x']],
47             }
48
49main_params={
50              'filename':'ex_type2_nomo_1.pdf',
51              'paper_height':10.0,
52              'paper_width':10.0,
53              'block_params':[block_1_params],
54              'transformations':[('rotate',0.01),('scale paper',)],
55              'title_str':r'$u_1=u_2\times u_3$'
56              }
57Nomographer(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    ex_type3_nomo_1.py
 3
 4    Simple nomogram of type 3: F1+F2+...+FN=0
 5    You should have received a copy of the GNU General Public License
 6    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 7"""
 8import sys
 9sys.path.insert(0, "..")
10from pynomo.nomographer import *
11
12N_params_1={
13        'u_min':0.0,
14        'u_max':10.0,
15        'function':lambda u:u,
16        'title':r'$u_1$',
17        'tick_levels':2,
18        'tick_text_levels':1,
19                }
20N_params_2={
21        'u_min':0.0,
22        'u_max':10.0,
23        'function':lambda u:u,
24        'title':r'$u_2$',
25        'tick_levels':2,
26        'tick_text_levels':1,
27                }
28N_params_3={
29        'u_min':0.0,
30        'u_max':10.0,
31        'function':lambda u:u,
32        'title':r'$u_3$',
33        'tick_levels':2,
34        'tick_text_levels':1,
35                }
36N_params_4={
37        'u_min':0.0,
38        'u_max':10.0,
39        'function':lambda u:u,
40        'title':r'$u_4$',
41        'tick_levels':2,
42        'tick_text_levels':1,
43                }
44N_params_5={
45        'u_min':0.0,
46        'u_max':10.0,
47        'function':lambda u:u,
48        'title':r'$u_5$',
49        'tick_levels':2,
50        'tick_text_levels':1,
51                }
52N_params_6={
53        'u_min':-20.0,
54        'u_max':0.0,
55        'function':lambda u:u,
56        'title':r'$u_6$',
57        'tick_levels':2,
58        'tick_text_levels':1,
59        'tick_side':'right',
60                }
61
62block_1_params={
63             'block_type':'type_3',
64             'width':10.0,
65             'height':10.0,
66             'f_params':[N_params_1,N_params_2,N_params_3,
67                         N_params_4,N_params_5,N_params_6],
68             'isopleth_values':[[3,2,1,0,3,'x']],
69             }
70
71main_params={
72              'filename':'ex_type3_nomo_1.pdf',
73              'paper_height':20.0,
74              'paper_width':20.0,
75              'block_params':[block_1_params],
76              'transformations':[('rotate',0.01),('scale paper',)],
77              'title_str':r'$u_1+u_2+u_3+u_4+u_5+u_6=0$',
78              'title_y':21.0,
79              }
80Nomographer(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    ex_type4_nomo_1.py
 3
 4    Simple nomogram of type 4: F1/F2=F3/F4
 5"""
 6import sys
 7sys.path.insert(0, "..")
 8from pynomo.nomographer import *
 9
10N_params_1={
11        'u_min':1.0,
12        'u_max':10.0,
13        'function':lambda u:u,
14        'title':r'$u_1$',
15        'tick_levels':3,
16        'tick_text_levels':1,
17        'tick_side':'left',
18                }
19N_params_2={
20        'u_min':1.0,
21        'u_max':10.0,
22        'function':lambda u:u,
23        'title':r'$u_2$',
24        'tick_levels':3,
25        'tick_text_levels':1,
26        'tick_side':'right',
27                }
28N_params_3={
29        'u_min':1.0,
30        'u_max':10.0,
31        'function':lambda u:u,
32        'title':r'$u_3$',
33        'tick_levels':3,
34        'tick_text_levels':1,
35        'tick_side':'right',
36        'title_draw_center':True,
37        'title_opposite_tick':False,
38                }
39N_params_4={
40        'u_min':1.0,
41        'u_max':10.0,
42        'function':lambda u:u,
43        'title':r'$u_4$',
44        'tick_levels':3,
45        'tick_text_levels':1,
46        'tick_side':'left',
47        'title_draw_center':True,
48        'title_opposite_tick':False,
49                }
50
51block_1_params={
52                'block_type':'type_4',
53                'f1_params':N_params_1,
54                'f2_params':N_params_2,
55                'f3_params':N_params_3,
56                'f4_params':N_params_4,
57                'isopleth_values':[[7,6,2,'x']],
58                             }
59
60main_params={
61              'filename':'ex_type4_nomo_1.pdf',
62              'paper_height':10.0,
63              'paper_width':10.0,
64              'block_params':[block_1_params],
65              'transformations':[('rotate',0.01),('scale paper',)],
66              'title_str':r'$u_1/u_2=u_3/u_4$',
67              'title_y':8.0,
68              }
69Nomographer(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    ex_type5_nomo_1.py
 3
 4    Simple nomogram of type 5.
 5"""
 6import sys
 7sys.path.insert(0, "..")
 8from pynomo.nomographer import *
 9
10
11
12block_params={
13   'block_type':'type_5',
14   'u_func':lambda u:u,
15   'v_func':lambda x,v:x+v,
16   'u_values':[1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0],
17   'v_values':[1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0],
18   'wd_tick_levels':2,
19   'wd_tick_text_levels':1,
20   'wd_tick_side':'right',
21   'wd_title':'wd = u-v',
22   'u_title':'u',
23   'v_title':'v',
24   'wd_title_opposite_tick':True,
25   'wd_title_distance_center':2.5,
26   'isopleth_values':[[6.5,7,'x']],
27 }
28
29
30main_params={
31              'filename':'ex_type5_nomo_1.pdf',
32              'paper_height':10.0,
33              'paper_width':10.0,
34              'block_params':[block_params],
35              'transformations':[('rotate',0.01),('scale paper',)]
36              }
37
38Nomographer(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    ex_type6_nomo_1.py
 3
 4    Simple nomogram of type 6.
 5"""
 6import sys
 7sys.path.insert(0, "..")
 8from pynomo.nomographer import *
 9
10N_params_1={
11        'u_min':1.0,
12        'u_max':10.0,
13        'function':lambda u:u**0.5,
14        'title':'u',
15        'tick_levels':3,
16        'tick_text_levels':2,
17        'tick_side':'left',
18        }
19
20N_params_2={
21        'u_min':1.0,
22        'u_max':10.0,
23        'function':lambda u:log(u),
24        'title':'u',
25        'tick_levels':3,
26        'tick_text_levels':2,
27        }
28
29block_params={
30              'block_type':'type_6',
31              'f1_params':N_params_1,
32              'f2_params':N_params_2,
33              'width':5.0,
34              'height':10.0,
35              'isopleth_values':[[2.2,'x']],
36              #'curve_const':0.01
37                     }
38
39main_params={
40              'filename':'ex_type6_nomo_1.pdf',
41              'paper_height':10.0,
42              'paper_width':5.0,
43              'block_params':[block_params],
44              'transformations':[('rotate',0.01),('scale paper',)]
45              }
46
47Nomographer(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    ex_type8_nomo_1.py
 3
 4    Simple nomogram of type 8.
 5"""
 6import sys
 7sys.path.insert(0, "..")
 8from pynomo.nomographer import *
 9
10N_params_1={
11        'u_min':1.0,
12        'u_max':10.0,
13        'function':lambda u:u,
14        'title':'u',
15        'tick_levels':3,
16        'tick_text_levels':2,
17        'tick_side':'left',
18        }
19
20block_params={
21              'block_type':'type_8',
22              'f_params':N_params_1,
23              'width':5.0,
24              'height':10.0,
25              'isopleth_values':[[5]]
26                     }
27
28main_params={
29              'filename':'ex_type8_nomo_1.pdf',
30              'paper_height':10.0,
31              'paper_width':5.0,
32              'block_params':[block_params],
33              'transformations':[]
34              }
35
36Nomographer(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    ex_type9_nomo_1.py
 3
 4    Simple nomogram of type 9: determinant
 5"""
 6import sys
 7sys.path.insert(0, "..")
 8from pynomo.nomographer import *
 9
10N_params_1={
11            'u_min':3.0,
12            'u_max':10.0,
13            'f':lambda u:0,
14            'g':lambda u:u,
15            'h':lambda u:1.0,
16            'title':r'$u_1$',
17            'scale_type':'linear',
18            'tick_levels':3,
19            'tick_text_levels':2,
20            'grid':False}
21
22N_params_2={
23        'u_min':0.0, # for alignment
24        'u_max':1.0,  # for alignment
25        'f_grid':lambda u,v:u+2.0,
26        'g_grid':lambda u,v:2*v+5.0,
27        'h_grid':lambda u,v:1.0,
28        'u_start':0.0,
29        'u_stop':1.0,
30        'v_start':0.0,
31        'v_stop':1.0,
32        'u_values':[0.0,0.25,0.5,0.75,1.0],
33        'v_values':[0.0,0.25,0.5,0.75,1.0],
34        'grid':True,
35        'text_prefix_u':r'$u_2$=',
36        'text_prefix_v':r'$v_2$=',
37        }
38
39N_params_3={
40            'u_min':3.0,
41            'u_max':10.0,
42            'f':lambda u:4.0,
43            'g':lambda u:u,
44            'h':lambda u:1.0,
45            'title':r'$u_3$',
46            'scale_type':'linear',
47            'tick_levels':3,
48            'tick_text_levels':2,
49            'grid':False
50            }
51
52block_params={
53             'block_type':'type_9',
54             'f1_params':N_params_1,
55             'f2_params':N_params_2,
56             'f3_params':N_params_3,
57             'transform_ini':False,
58             'isopleth_values':[[7,[0.75,0.5],'x']]
59             }
60
61main_params={
62              'filename':'ex_type9_nomo_1.pdf',
63              'paper_height':10.0,
64              'paper_width':10.0,
65              'block_params':[block_params],
66              'transformations':[('rotate',0.01),('scale paper',)]
67              }
68Nomographer(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    ex_type10_nomo_1.py
 3
 4    Simple nomogram of type 7: F1(u)+F2(v)*F3(w)+F4(w)=0
 5    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 6"""
 7import sys
 8sys.path.insert(0, "..")
 9from pynomo.nomographer import *
10
11N_params_1={
12        'u_min':-10.0,
13        'u_max':10.0,
14        'function':lambda u:u,
15        'title':r'$u$',
16        'tick_levels':3,
17        'tick_text_levels':2,
18                }
19
20N_params_2={
21        'u_min':-10.0,
22        'u_max':10.0,
23        'function':lambda u:u,
24        'title':r'$v$',
25        'tick_levels':3,
26        'tick_text_levels':2,
27        'tick_side':'left',
28                }
29
30N_params_3={
31        'u_min':0.3,
32        'u_max':4.0,
33        'function_3':lambda u:u,
34        'function_4':lambda u:u,
35        'title':r'$w$',
36        'tick_levels':4,
37        'tick_text_levels':3,
38        'scale_type':'linear smart',
39        'title_draw_center':True,
40                }
41
42block_1_params={
43             'block_type':'type_10',
44             'width':10.0,
45             'height':10.0,
46             'f1_params':N_params_1,
47             'f2_params':N_params_2,
48             'f3_params':N_params_3,
49             'isopleth_values':[[6,-4,'x']]
50             }
51
52main_params={
53              'filename':'ex_type10_nomo_1.pdf',
54              'paper_height':10.0,
55              'paper_width':10.0,
56              'block_params':[block_1_params],
57              'transformations':[('rotate',0.01),('scale paper',)],
58              'title_str':r'$u+vw+w=0$'
59              }
60Nomographer(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.