Blocks¶
Every block in pynomo represents some equation. The blocks and their functions are listed in the following table.
\(F_1(u_1)+F_2(u_2)+F_3(u_3)=0 \,\) |
Three parallel lines |
|
\(F_1(u_1)=F_2(u_2) F_3(u_3) \,\) |
“N” or “Z” |
|
\(F_1(u_1)+F_2(u_2)+\cdots+F_N(u_N)=0\) |
N parallel lines |
|
\(\frac{F_1(u_1)}{F_2(u_2)}=\frac{F_3(u_3)}{F_4(u_4)}\) |
“Proportion” |
|
\(F_1(v) = F_2(x,u). \,\) |
“Contour” |
|
\(u=u \,\) |
“Ladder” |
|
\(\frac{1}{F_1(u_1)}+\frac{1}{F_2(u_2)}=\frac{1}{F_3(u_3)} \,\) |
“Angle” |
|
\(y = {F(u)} \,\) |
“Single” |
|
\(\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” |
|
\(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:
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:
Generated nomograph¶
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¶
parameter key |
default value |
type, explanation |
---|---|---|
|
– |
func(u). Function in equation For example |
|
– |
Float. Minimum value of function variable. |
|
– |
Float. Maximum value of function variable. |
See Common axis params for other parameters.
Block parameters¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 1 block |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
– |
Axis params Dict. Axis params for function f1 |
|
– |
Axis params Dict. Axis params for function f2 |
|
– |
Axis params Dict. Axis params for function f3 |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
|
Float. Factor for spacings between lines |
|
|
** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example: |
General parameters¶
See Main params for top level main parameters.
Type 2¶
Type 1 is “N” or “Z” nomograph that have functional relationship:
Use of this nomograph is given by the following simple example.
Simple example¶
This simple example plots nomograph for equation:
Generated nomograph¶
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¶
parameter key |
default value |
type, explanation |
---|---|---|
|
– |
func(u). Function in equation For example |
|
– |
Float. Minimum value of function variable. |
|
– |
Float. Maximum value of function variable. |
See Common axis params for other parameters.
Block parameters¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 2 block |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
– |
Axis params Dict. Axis params for function f1 |
|
– |
Axis params Dict. Axis params for function f2 |
|
– |
Axis params Dict. Axis params for function f3 |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
|
Float. Factor for spacings between lines |
|
|
** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example: |
General parameters¶
See Main params for top level main parameters.
Type 3¶
Type 3 has N parallel lines that have functional relationship:
Use of this nomograph is given by the following simple example.
Simple example¶
This simple example plots nomograph for equation:
Generated nomograph¶
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¶
parameter key |
default value |
type, explanation |
---|---|---|
|
– |
func(u). Function in equation For example |
|
– |
Float. Minimum value of function variable. |
|
– |
Float. Maximum value of function variable. |
See Common axis params for other parameters.
Block parameters¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 3 block |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
– |
List of Axis params Dict. List of Axis params. |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
|
Float. Additional length to reference axes. |
|
|
Array of Strings. List of reference line titles. For example [‘$R_1$’,’$R_2$’,’$R_3$’]`. |
|
|
Color. Color of reference lines. |
|
|
** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example: |
General parameters¶
See Main params for top level main parameters.
Type 4¶
Type 4 is proportion nomograph that have functional relationship:
Simple example¶
This simple example plots nomograph for equation:
Generated nomograph¶
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¶
parameter key |
default value |
type, explanation |
---|---|---|
|
– |
func(u). Function in equation For example |
|
– |
Float. Minimum value of function variable. |
|
– |
Float. Maximum value of function variable. |
See Common axis params for other parameters.
Block parameters¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 4 block |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
– |
Axis params Dict. Axis params for function f1 |
|
– |
Axis params Dict. Axis params for function f2 |
|
– |
Axis params Dict. Axis params for function f3 |
|
– |
Axis params Dict. Axis params for function f4 |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
|
Float. How much axis extend w.r.t. width/height. |
|
|
Strings. If given ‘F1 or F2’, then scaling is according to them, otherwise according to F3 and F4. |
|
|
Color. Color of reference lines. |
|
|
** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example: |
General parameters¶
See Main params for top level main parameters.
Type 5¶
Type 5 is graphing block that has functional relationship:
This type of block is used commonly in nomographs that have an equation in form
and
cannot be represented as line-nomograph. Typically equation above is written as pair of equations:
and
This equation is written in form
in order to construct this contour block. In reality block consists of horizontal lines:
and contour lines
where x and y are the coordinates of canvas. Coordinate x is reference with name wd in block parameters and it holds
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
and
Thus the original equation is
Generated nomograph¶
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¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 5 block. |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
– |
func(u). u function. For example |
|
– |
func(u,v). v function. For example |
|
– |
func(wd). wd func. For example |
|
– |
func(wd). Inverse of wd-func. For example |
|
– |
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]`. |
|
|
String. To align blocks w.r.t each other along axes with same tag. |
|
|
String. Axis title. |
|
|
Float. Title shift in x-direction. |
|
|
Float. Title shift in y-direction. |
|
|
String. Scale type. Can be |
|
|
Integer. How many levels (minor, minor-minor, etc.) of ticks are drawn. Largest effect to ‘linear’ scale. |
|
|
Integer. How many levels (minor, minor-minor, etc.) of texts are drawn. Largest effect to ‘linear’ scale. |
|
|
String. Tick and text side in final paper. Can be: |
|
|
Boolean. If axis is treated as reference line that is a turning point. |
|
|
Float. Fraction of reference line over other lines. |
|
|
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’}` |
|
|
Boolean. Title is drawn to center of line. |
|
|
Float. When |
|
|
Boolean. Title in opposite direction w.r.t ticks. |
|
|
func(u). function to align different scales. |
|
|
Float. If axis is aligned with other axis, this value x offsets final scale. |
|
|
Float. If axis is aligned with other axis, this value y offsets final scale. |
|
|
String. Format for numbers in scale. |
|
|
Array of Dicts. List of dictionary of params to be drawn additionally. |
|
|
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. |
|
|
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. |
|
|
Float. where #=0,1,2,3 or 4. Text size. For example: |
|
|
Float. where #=0,1 or 2. Text size. For example: |
|
|
Boolean. If true, text can be upside down, otherwise +- 90 degrees from horizontal. Good foor example for full circle scales. |
|
|
Float. Angle to rotate tick text from horizontal along tick. |
|
|
Boolean. Aligns tick text horizontally to center. Good when text rotated 90 degrees. |
|
|
Color. Color of axis. |
|
|
Color. Color of tick texts. |
|
– |
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]`. |
|
|
String. Axis title. |
|
|
Boolean. Title is drawn to center of line. |
|
|
Float. When |
|
|
Boolean. Title in opposite direction w.r.t ticks. |
|
|
String. To align blocks w.r.t each other along axes with same tag. |
|
|
String. Axis title. |
|
|
Float. Title shift in x-direction. |
|
|
Float. Title shift in y-direction. |
|
|
String. Scale type. Can be |
|
|
Integer. How many levels (minor, minor-minor, etc.) of ticks are drawn. Largest effect to ‘linear’ scale. |
|
|
Integer. How many levels (minor, minor-minor, etc.) of texts are drawn. Largest effect to ‘linear’ scale. |
|
|
String. Tick and text side in final paper. Can be: |
|
|
Boolean. If axis is treated as reference line that is a turning point. |
|
|
Float. Fraction of reference line over other lines. |
|
|
Dict. Manually set tick/point positions and text positions. Could be for example: |
|
|
Boolean. Title is drawn to center of line. |
|
|
Float. When |
|
|
Boolean. Title in opposite direction w.r.t ticks. |
|
|
func(u). function to align different scales. |
|
|
Float. If axis is aligned with other axis, this value x offsets final scale. |
|
|
Float. If axis is aligned with other axis, this value y offsets final scale. |
|
|
String. Format for numbers in scale. |
|
|
Array of Dicts. List of dictionary of params to be drawn additionally. |
|
|
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. |
|
|
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. |
|
|
Float. where #=0,1,2,3 or 4. Text size. For example: |
|
|
Float. where #=0,1 or 2. Text size. For example: |
|
|
Boolean. If true, text can be upside down, otherwise +- 90 degrees from horizontal. Good foor example for full circle scales. |
|
|
Float. Angle to rotate tick text from horizontal along tick. |
|
|
Boolean. Aligns tick text horizontally to center. Good when text rotated 90 degrees. |
|
|
Color. Color of axis. |
|
|
Color. Color of tick texts. |
|
|
Boolean. When |
|
|
Float. When |
|
|
Boolean. When |
|
|
Float. When |
|
|
** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example: |
General parameters¶
See Main params for top level main parameters.
Type 6¶
Type 6 is ladder nomograph:
In practice this means that if one axis has for example y-position as
and it was desirable to have
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:
where linear scale is converted to a logarithmic scale.
Generated nomograph¶
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¶
parameter key |
default value |
type, explanation |
---|---|---|
|
– |
func(u). Function in equation For example |
|
– |
Float. Minimum value of function variable. |
|
– |
Float. Maximum value of function variable. |
See Common axis params for other parameters.
Block parameters¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 6 block. |
|
|
String. Can be either |
|
0.2 |
Float. If orthogonal, how much fractional space before start of x-axis. |
|
0.2 |
Float. If orthogonal, how much fractional space before start of y-axis. |
|
0.0 |
Float. Sets the lenght of angle of Bezier curve. low value = straigh line, high value = curved line. |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
– |
Axis params Dict. Axis params for function f1 |
|
– |
Axis params Dict. Axis params for function f2 |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
|
Color. Ladder color. |
|
|
** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example: |
General parameters¶
See Main params for top level main parameters.
Type 7¶
Type 7 is “angle” nomograph that has functional relationship:
Simple example¶
This simple example plots nomograph for equation:
Generated nomograph¶
Source code of simple example of type 2¶
Parameters for type 7¶
Axis parameters¶
parameter key |
default value |
type, explanation |
---|---|---|
|
– |
func(u). Function in equation For example |
|
– |
Float. Minimum value of function variable. |
|
– |
Float. Maximum value of function variable. |
See Common axis params for other parameters.
Block parameters¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 7 block |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
– |
Axis params Dict. Axis params for function f1 |
|
– |
Axis params Dict. Axis params for function f2 |
|
– |
Axis params Dict. Axis params for function f3 |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
|
Float. Angle between u1 and u3. Note: later transformations may alter the angle. |
|
|
Float. Angle between u2 and u3. Note: later transformations may alter the angle. |
|
|
** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example: |
General parameters¶
See Main params for top level main parameters.
Type 8¶
Type 8 is single nomograph:
or
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¶
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¶
parameter key |
default value |
type, explanation |
---|---|---|
|
– |
func(u). Function in equation. For example |
|
– |
Float. Minimum value of function variable. |
|
– |
Float. Maximum value of function variable. |
|
– |
func(u). x-position in function. If used ‘function_y’ must be defined. For example |
|
– |
func(u). y-position in function. If used ‘function_x’ must be defined. Overrides ‘function’. For example |
See Common axis params for other parameters.
Block parameters¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 8 block |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
– |
Axis params Dict. Axis params for function f1 |
|
– |
Axis params Dict. Axis params for function f2 |
|
– |
Axis params Dict. Axis params for function f3 |
|
– |
Axis params Dict. Axis params for function f4 |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
|
Float. How much axis extend w.r.t. width/height. |
|
|
Strings. If given ‘F1 or F2’, then scaling is according to them, otherwise according to F3 and F4. |
|
|
Color. Color of reference lines. |
|
|
** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example: |
General parameters¶
See Main params for top level main parameters.
Type 9¶
Type 9 is “general determinant” nomograph that has functional relationship:
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:
Generated nomograph¶
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¶
parameter key |
default value |
type, explanation |
---|---|---|
|
– |
Bool. |
|
– |
func(u,v). F function in determinant. For example |
|
– |
func(u,v). G function in determinant. For example |
|
– |
func(u,v). H function in determinant. For example |
|
– |
u start when drawing v=const line |
|
– |
u stop when drawing v=const line |
|
– |
v start when drawing u=const line |
|
– |
v stop when drawing u=const line |
|
– |
List of grid lines u=const. For example |
|
– |
List of grid lines v=const. For example ``[0.0,0.25,0.5,0.75,1.0]` |
|
– |
Text prefix for u before value |
|
– |
Text prefix for v before value |
|
|
If v-texts are in u start side |
|
|
If v-texts are in u stop side |
|
|
If u-texts are in v start side |
|
|
If u-texts are in v stop side |
|
|
Color. u line color |
|
|
Color. v line color |
|
|
Color. u text color |
|
|
Color. v text color |
|
0.25 |
Float. Text distance |
|
|
Boolean. If marker circles to crossings |
|
– |
List of Dicts. List of params to be drawn. |
See Common axis params for other parameters.
Block parameters¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 9 block |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
– |
Axis params Dict. Axis params for function f1 |
|
– |
Axis params Dict. Axis params for function f2 |
|
– |
Axis params Dict. Axis params for function f3 |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
|
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. |
|
|
** 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: |
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:
Simple example¶
This simple example plots nomograph for equation:
Generated nomograph¶
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¶
parameter key |
default value |
type, explanation |
---|---|---|
|
– |
func(u). Function in the equation for \(F_1\) and \(F_2. For example \) |
|
– |
func(u). Function in the equation for \(F_3\). For example |
|
– |
func(u). Function in the equation for \(F_4\). For example |
|
– |
Float. Minimum value of function variable. |
|
– |
Float. Maximum value of function variable. |
See Common axis params for other parameters.
Block parameters¶
parameter |
default value |
explanation |
---|---|---|
|
|
String. This is type 10 block |
|
10.0 |
Float. Block width (to be scaled) |
|
10.0 |
Float. Block height (to be scaled) |
|
– |
Axis params Dict. Axis params for function f1 |
|
– |
Axis params Dict. Axis params for function f2 |
|
– |
Axis params Dict. Axis params for function f3 |
|
– |
Axis params Dict. Axis params for function f4 |
|
|
Boolean. If x-axis is mirrored |
|
|
Boolean. If y-axis is mirrored |
|
|
Float. How much axis extend w.r.t. width/height. |
|
|
Strings. If given ‘F1 or F2’, then scaling is according to them, otherwise according to F3 and F4. |
|
|
Color. Color of reference lines. |
|
|
** List of list of isopleth values.** Unknown values are given with strings, e.g. ‘x’. An example: |
General parameters¶
See Main params for top level main parameters.