Difference between revisions of "Examples of axes parameters"

From Pynomo
Jump to: navigation, search
(Example 8)
(Example 1)
Line 5: Line 5:
 
|-  
 
|-  
 
| [[Image:Ex axes 1.png|160px]] || <source lang=python>
 
| [[Image:Ex axes 1.png|160px]] || <source lang=python>
from nomographer import *
+
from pynomo.nomographer import *
  
 
N_params={
 
N_params={

Revision as of 18:37, 7 October 2008

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 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 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 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 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 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 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 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)

Logarithmic axes

Example 9

Logarithmic scale:

Ex axes 9.png
from 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)