Difference between revisions of "Examples of axes parameters"

From Pynomo
Jump to: navigation, search
(Example 8)
(Example 8.1)
Line 357: Line 357:
 
{| style="background:white; color:black" border="1" cellpadding="5" cellspacing="0"  
 
{| style="background:white; color:black" border="1" cellpadding="5" cellspacing="0"  
 
|-  
 
|-  
| [[Image:Ex axes 8.png|420px]] || <source lang=python>
+
| [[Image:Ex axes 8 1.png|420px]] || <source lang=python>
 
N_params={
 
N_params={
 
         'u_min':0.0,
 
         'u_min':0.0,

Revision as of 20:47, 30 July 2009

Linear Axes

Example 1

Ex axes 1.png
from pynomo.nomographer import *
 
N_params={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':'u',
        }
 
block_params={
              'block_type':'type_8',
              'f_params':N_params,
              'width':5.0,
              'height':15.0,
                     }
 
main_params={
              'filename':'ex_axes_1.pdf',
              'paper_height':15.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
 
Nomographer(main_params)

Example 2

We put less ticks, change tick side and labelings for them:

Ex axes 2.png
from pynomo.nomographer import *
 
N_params={
        '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,
              'width':5.0,
              'height':10.0,
                     }
main_params={
              'filename':'ex_axes_2.pdf',
              'paper_height':10.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
Nomographer(main_params)

Example 3

We change axis title position:

Ex axes 3a.png
from pynomo.nomographer import *
 
_params={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':'u',
        'tick_levels':3,
        'tick_text_levels':2,
        'tick_side':'left',
        'title_x_shift':-1.0,
        'title_y_shift':0.5
        }
block_params={
              'block_type':'type_8',
              'f_params':N_params,
              'width':5.0,
              'height':10.0,
                     }
main_params={
              'filename':'ex_axes_3.pdf',
              'paper_height':10.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
Nomographer(main_params)

Example 4

We put title to center of axis and change tick and text levels at different parameters range by using 'extra_params':

Ex axes 4.png
from pynomo.nomographer import *
 
N_params={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':'title',
        'tick_levels':2,
        'tick_text_levels':1,
        'tick_side':'left',
        'title_draw_center':True,
        'extra_params':[{
                        'u_min':5.0,
                        'u_max':10.0,
                        'tick_levels':3,
                        'tick_text_levels':2,
                        },
                        {
                        'u_min':9.0,
                        'u_max':10.0,
                        'tick_levels':4,
                        'tick_text_levels':2,
                        }
                        ]
        }
block_params={
              'block_type':'type_8',
              'f_params':N_params,
              'width':5.0,
              'height':10.0,
                     }
main_params={
              'filename':'ex_axes_4.pdf',
              'paper_height':10.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
Nomographer(main_params)

Manual Axes

Example 5

We put manual points:

Ex axes 5.png
from pynomo.nomographer import *
 
N_params={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':'title',
        'tick_levels':2,
        'tick_text_levels':1,
        'tick_side':'left',
        'title_draw_center':True,
        'scale_type':'manual point',
        'manual_axis_data': {1.0:'one',
                     2.0:'two',
                     3.0:'three',
                     3.1415:r'$\pi$',
                     4.0:'four',
                     5.0:'five',
                     6.0:'six',
                     7.0:'seven',
                     8.0:'eight',
                     9.0:'nine',
                     10.0:'ten'}
        }
block_params={
              'block_type':'type_8',
              'f_params':N_params,
              'width':5.0,
              'height':10.0,
                     }
main_params={
              'filename':'ex_axes_5.pdf',
              'paper_height':10.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
Nomographer(main_params)

Example 6

We put manual lines:

Ex axes 6.png
from pynomo.nomographer import *
 
N_params={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':'title',
        'tick_levels':2,
        'tick_text_levels':1,
        'tick_side':'left',
        'title_draw_center':True,
        'scale_type':'manual line',
        'manual_axis_data': {1.0:'one',
                     2.0:'two',
                     3.0:'three',
                     3.1415:r'$\pi$',
                     4.0:'four',
                     5.0:'five',
                     6.0:'six',
                     7.0:'seven',
                     8.0:'eight',
                     9.0:'nine',
                     10.0:'ten'}
 
        }
block_params={
              'block_type':'type_8',
              'f_params':N_params,
              'width':5.0,
              'height':10.0,
                     }
main_params={
              'filename':'ex_axes_6.pdf',
              'paper_height':10.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
Nomographer(main_params)


Example 7

Combination of manual lines and linear scale:

Ex axes 7.png
from pynomo.nomographer import *
 
N_params={
        'u_min':1.0,
        'u_max':10.0,
        'function':lambda u:u,
        'title':'title',
        'tick_levels':2,
        'tick_text_levels':1,
        'tick_side':'left',
        'scale_type':'manual line',
        'manual_axis_data': {1.0:'one',
                     2.0:'two',
                     3.0:'three',
                     3.1415:r'$\pi$',
                     4.0:'four',
                     5.0:'five',
                     6.0:'six',
                     7.0:'seven',
                     8.0:'eight',
                     9.0:'nine',
                     10.0:'ten'},
        'extra_params':[{
                        'u_min':1.0,
                        'u_max':10.0,
                        'scale_type':'linear',
                        'tick_levels':3,
                        'tick_text_levels':2,
                        'tick_side':'right',
                        }]
        }
block_params={
              'block_type':'type_8',
              'f_params':N_params,
              'width':5.0,
              'height':10.0,
                     }
main_params={
              'filename':'ex_axes_7.pdf',
              'paper_height':10.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
Nomographer(main_params)

XY Axes

Example 8

Scale defined by x and y functions that are specific for type 8 single block

Ex axes 8.png
from pynomo.nomographer import *
 
N_params={
        'u_min':0.0,
        'u_max':300.0,
        'function_x':lambda u:3*sin(u/180.0*pi),
        'function_y':lambda u:3*cos(u/180.0*pi),
        'title':'u',
        'tick_levels':3,
        'tick_text_levels':1,
        'title_x_shift':-0.5,
        }
 
block_params={
              'block_type':'type_8',
              'f_params':N_params,
              'width':5.0,
              'height':15.0,
                     }
 
main_params={
              'filename':'ex_axes_8.pdf',
              'paper_height':10.0,
              'paper_width':10.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
 
Nomographer(main_params)

Example 8.1

Let's add some more definitons and color to example 8 type 8

Ex axes 8 1.png
N_params={
        'u_min':0.0,
        'u_max':300.0,
        'function_x':lambda u:3*sin(u/180.0*pi),
        'function_y':lambda u:3*cos(u/180.0*pi),
        'title':'u',
        'tick_levels':3,
        'tick_text_levels':1,
        'title_x_shift':-0.5,
         #'grid_length':0.1,
         'grid_length_0':0.8/4,
         'grid_length_1':0.6/4,
         'grid_length_2':0.5/4,
         'grid_length_3':0.4/4,
         'grid_length_4':0.3/4,
         #'text_size': text.size.scriptsize, #not used in this example
         'text_size_0': text.size.tiny,
         'text_size_1': text.size.tiny,
         'text_size_2': text.size.tiny,
         'text_size_3': text.size.tiny,
         'text_size_4': text.size.tiny,
         #'text_size_log_0': text.size.tiny, #not used in this example
         #'text_size_log_1': text.size.tiny, #not used in this example
         #'text_size_log_2': text.size.tiny, #not used in this example
         #'text_size_manual': text.size.tiny, #not used in this example
         'text_distance_0':1.2/4,
         'text_distance_1':1.1/4,
         'text_distance_2':1.0/4,
         'text_distance_3':1.0/4,
         'text_distance_4':1.0/4,
         'title_distance_center':0.7,
         'title_opposite_tick':True,
         'title_draw_center':True,
         'text_format':"$%3.1f$",
         'full_angle':True,
         'extra_angle':90.0,
         'text_horizontal_align_center':True,
         'text_format':r"$%2.0f$",
         'text_color':color.cmyk.Sepia,
        }
 
block_params={
              'block_type':'type_8',
              'f_params':N_params,
              'width':5.0,
              'height':15.0,
                     }
 
main_params={
              'filename':'ex_axes_8_1.pdf',
              'paper_height':10.0,
              'paper_width':10.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
 
Nomographer(main_params)

Logarithmic axes

Example 9

Logarithmic scale:

Ex axes 9.png
from pynomo.nomographer import *
 
N_params={
        'u_min':1.0,
        'u_max':10000.0,
        'function':lambda u:log(u),
        'title':'u',
        'scale_type':'log',
        }
 
block_params={
              'block_type':'type_8',
              'f_params':N_params,
              'width':5.0,
              'height':15.0,
                     }
 
main_params={
              'filename':'ex_axes_9.pdf',
              'paper_height':15.0,
              'paper_width':5.0,
              'block_params':[block_params],
              'transformations':[('scale paper',)]
              }
 
Nomographer(main_params)