Chart-EPS_graph
view release on metacpan or search on metacpan
lib/Chart/EPS_graph/PS.pm view on Meta::CPAN
0 1 points_array length 1 sub {
points_array 1 index get
column_array-0 2 index get
h_min_value sub exch
v_min_value
y2? { v_ratio_y2 div } if
sub exch
h_units exch
y2? {
v_units_y2 v_min_value_y2 v_units_y2 sub v_min_value v_units add
}{
v_units
} ifelse
3 -1 roll 0 eq {
2 copy moveto
}{
2 copy lineto
} ifelse
id_point
} for
} bind def
/plot_pairs {
/show_x
curve_id
15 mul
data_set_id 1 sub
10 mul add
def
/show_y 0 def
gsave
origin moveto
currentpoint translate
plot_paired_arrays
bg_line_edge
stroke
gsave
0 1 show_curve_id_x length 1 sub
{ show_curve_id
show_curve_id_x 1 index get
/show_x exch def
show_curve_id_y exch get
/show_y exch def
} for
grestore
grestore
} bind def
/plot_lines {
gsave
origin moveto currentpoint translate
0 5 x-fin {
y.line exch mm exch mm
dup 0 lt { pop 0 } if
lineOp
} for
stroke
grestore
} bind def
/formula {
-194.77 250.75 2 index mul add
.13976 2 index 2 exp mul sub
2.2082e-2 3 xpnt sub
1.5757e-4 4 xpnt add
3.2312e-7 5 xpnt sub
} def
/do_curve {
/x-fin 200 def /y.line { formula } def
plot_pairs stroke
} def
/graph {
font_name findfont font_size scalefont setfont
origin moveto
h_tick_value v_tick_value
hLines vLines
segregate? { marks_y2 } if
marks_y1 marks_top marks_x
} def
/bg_color_bbox {
0 0 moveto
pg_width 0 lineto
pg_width pg_height lineto
0 pg_height lineto
closepath
bg_color cvx exec set_color_rgb exec
fill
} def
/do_graph {
/origin { 80 110 } def
/grid_height { pg_height origin exch pop 2 mul sub 60 add } def
/grid_width { pg_width origin pop 2 mul sub } def
gsave
fg_color cvx exec set_color_rgb exec
graph
grestore
} def
/compensate { } def % {1 1.08133 div mul} def
/floor_ceiling_div 10 def
/set_ceiling {
/low_ceiling false def
all_y_cols_max
dup 0 gt
1 index 1 lt and {
floor_ceiling_div mul
/low_ceiling true def
} if
ceiling
low_ceiling { floor_ceiling_div div } if
} def
/set_floor {
all_y_cols_min
low_ceiling { floor_ceiling_div mul } if
floor
low_ceiling { floor_ceiling_div div } if
} def
/init_graph_params {
1 setlinecap
1 setlinejoin
segregate? {
segregate_y_coords
( run in 2.623 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )