diff options
Diffstat (limited to 'metapost')
-rw-r--r-- | metapost/context/base/mpiv/mp-crop.mpiv | 32 | ||||
-rw-r--r-- | metapost/context/base/mpiv/mp-lmtx.mpxl | 158 |
2 files changed, 114 insertions, 76 deletions
diff --git a/metapost/context/base/mpiv/mp-crop.mpiv b/metapost/context/base/mpiv/mp-crop.mpiv index e06cf8def..b3ae3c28d 100644 --- a/metapost/context/base/mpiv/mp-crop.mpiv +++ b/metapost/context/base/mpiv/mp-crop.mpiv @@ -45,10 +45,10 @@ enddef ; vardef crop_marks_cmyk = pickup pencircle scaled 1/2 ; save p ; picture p ; p := image ( - fill ulcircle scaled 12.5 withcolor (1,0,0,0) ; - fill urcircle scaled 12.5 withcolor (0,1,0,0) ; - fill lrcircle scaled 12.5 withcolor (0,0,1,0) ; - fill llcircle scaled 12.5 withcolor (0,0,0,1) ; + fill ulcircle scaled 12.5 withcolor (1,0,0,0) ; + fill urcircle scaled 12.5 withcolor (0,1,0,0) ; + fill lrcircle scaled 12.5 withcolor (0,0,1,0) ; + fill llcircle scaled 12.5 withcolor (0,0,0,1) ; draw (-10,0) -- (10,0) ; draw (0,-10) -- (0,10) ; draw fullcircle scaled 12.5 ; @@ -59,10 +59,10 @@ enddef ; vardef crop_marks_gray = save p ; picture p ; p := image ( - fill ulcircle scaled 12.5 withcolor (0.00) ; - fill urcircle scaled 12.5 withcolor (0.25) ; - fill lrcircle scaled 12.5 withcolor (0.50) ; - fill llcircle scaled 12.5 withcolor (0.75) ; + fill ulcircle scaled 12.5 withcolor (0.00) ; + fill urcircle scaled 12.5 withcolor (0.25) ; + fill lrcircle scaled 12.5 withcolor (0.50) ; + fill llcircle scaled 12.5 withcolor (0.75) ; draw (-10,0) -- (10,0) ; draw (0,-10) -- (0,10) ; draw (-6,0) -- (6,0) withcolor white ; @@ -75,14 +75,14 @@ enddef ; vardef crop_marks_cmykrgb = save p ; picture p ; p := image ( - fill ulcircle scaled 15 withcolor (1,0,0) ; - fill urcircle scaled 15 withcolor (0,1,0) ; - fill lrcircle scaled 15 withcolor (0,0,1) ; - fill llcircle scaled 15 withcolor (.5,.5,.5) ; - fill ulcircle scaled 10 withcolor (1,0,0,0) ; - fill urcircle scaled 10 withcolor (0,1,0,0) ; - fill lrcircle scaled 10 withcolor (0,0,1,0) ; - fill llcircle scaled 10 withcolor (0,0,0,1) ; + fill ulcircle scaled 15 withcolor (1,0,0) ; + fill urcircle scaled 15 withcolor (0,1,0) ; + fill lrcircle scaled 15 withcolor (0,0,1) ; + fill llcircle scaled 15 withcolor (.5,.5,.5) ; + fill ulcircle scaled 10 withcolor (1,0,0,0) ; + fill urcircle scaled 10 withcolor (0,1,0,0) ; + fill lrcircle scaled 10 withcolor (0,0,1,0) ; + fill llcircle scaled 10 withcolor (0,0,0,1) ; draw (-10,0) -- (10,0) ; draw (0,-10) -- (0,10) ; draw fullcircle scaled 10 ; diff --git a/metapost/context/base/mpiv/mp-lmtx.mpxl b/metapost/context/base/mpiv/mp-lmtx.mpxl index 90095d456..8941ca7fe 100644 --- a/metapost/context/base/mpiv/mp-lmtx.mpxl +++ b/metapost/context/base/mpiv/mp-lmtx.mpxl @@ -655,45 +655,46 @@ vardef lmt_do_function = code := getparameter "code" ; swap := getparameter "reverse" ; - if swap : p := image ( fi - - if (getparametercount "functions") > 0 : - for s = 1 upto getparametercount "functions" : - pushparameters "functions" s ; + p := image ( + + if (getparametercount "functions") > 0 : + for s = 1 upto getparametercount "functions" : + pushparameters "functions" s ; + lmt_do_function_p ( + getparameterdefault "xmin", + getparameterdefault "xmax", + getparameterdefault "xstep", + getparameterdefault "code", + getparameterdefault "shape", + getparameterdefault "close", + getparameterdefault "fillcolor", + getparameterdefault "drawsize", + getparameterdefault "drawcolor", + getparameterdefault "pointsymbol", + getparameterdefault "pointsize", + getparameterdefault "pointcolor" + ) ; + popparameters ; + endfor ; + elseif code <> "" : lmt_do_function_p ( - getparameterdefault "xmin", - getparameterdefault "xmax", - getparameterdefault "xstep", - getparameterdefault "code", - getparameterdefault "shape", - getparameterdefault "close", - getparameterdefault "fillcolor", - getparameterdefault "drawsize", - getparameterdefault "drawcolor", - getparameterdefault "pointsymbol", - getparameterdefault "pointsize", - getparameterdefault "pointcolor" + getparameter "xmin", + getparameter "xmax", + getparameter "xstep", + getparameter "code", + getparameter "shape", + getparameter "close", + getparameter "fillcolor", + getparameter "drawsize", + getparameter "drawcolor", + getparameter "pointsymbol", + getparameter "pointsize", + getparameter "pointcolor" ) ; - popparameters ; - endfor ; - elseif code <> "" : - lmt_do_function_p ( - getparameter "xmin", - getparameter "xmax", - getparameter "xstep", - getparameter "code", - getparameter "shape", - getparameter "close", - getparameter "fillcolor", - getparameter "drawsize", - getparameter "drawcolor", - getparameter "pointsymbol", - getparameter "pointsize", - getparameter "pointcolor" - ) ; - fi ; + fi ; + ) ; - if swap : ) ; fi + if not swap : draw p fi ; option := getparameter "xticks" ; if option = "top" : @@ -725,6 +726,25 @@ vardef lmt_do_function = ymin := getparameterdefault "yfirst" ymin ; ymax := getparameterdefault "ylast" ymax ; + if hasoption "frame" "ticks,sticks" : + if xsmall > 0 : + if hasoption "frame" "horizontal" : + for i = ymin step ((ymax-ymin)/ysmall) until ymax : + draw (xmin,i) -- (xmax,i) ; + endfor ; + dodraw (xmin,ymin) ; % flush snippets + fi ; + fi ; + if ysmall > 0 : + if hasoption "frame" "vertical" : + for i = xmin step ((xmax-xmin)/xsmall) until xmax : + draw (i,ymin) -- (i,ymax) ; + endfor ; + dodraw (xmin,ymin) ; % flush snippets + fi ; + fi ; + fi ; + option := getparameter "xarrow" ; if option = "yes" : save ahlength ; ahlength := tl ; @@ -743,35 +763,53 @@ vardef lmt_do_function = draw (xmin,ymin) -- (xmin,ymax) ; fi ; - option := getparameter "frame" ; - if option = "yes" : - draw (xmin,ymin) -- (xmax,ymin) -- (xmax,ymax) -- (xmin,ymax) -- cycle ; - elseif (option = "ticks") or (option = "sticks") : + if hasoption "frame" "yes" : draw (xmin,ymin) -- (xmax,ymin) -- (xmax,ymax) -- (xmin,ymax) -- cycle ; + fi ; + + if hasoption "frame" "ticks,sticks" : if xsmall > 0 : - txs := ((0,0) -- (0,tl)) if option = "sticks" : rotated 180 fi ; - txs := txs transformed tr ; - for i = xmin step ((xmax-xmin)/xsmall) until xmax : - nodraw txs shifted (i,ymin) ; - endfor ; - txs := (0,0) -- (0,-tl) if option = "sticks" : rotated 180 fi ; - txs := txs transformed tr ; - for i = xmin step ((xmax-xmin)/xsmall) until xmax : - nodraw txs shifted (i,ymax) ; - endfor ; + if hasoption "frame" "horizontal" : + for i = ymin step ((ymax-ymin)/ysmall) until ymax : + draw (xmin,i) -- (xmax,i) ; + endfor ; + fi ; + if hasoption "frame" "bottom" : + txs := ((0,0) -- (0,tl)) if hasoption "frame" "sticks" : rotated 180 fi ; + txs := txs transformed tr ; + for i = xmin step ((xmax-xmin)/xsmall) until xmax : + nodraw txs shifted (i,ymin) ; + endfor ; + fi ; + if hasoption "frame" "top" : + txs := (0,0) -- (0,-tl) if hasoption "frame" "sticks" : rotated 180 fi ; + txs := txs transformed tr ; + for i = xmin step ((xmax-xmin)/xsmall) until xmax : + nodraw txs shifted (i,ymax) ; + endfor ; + fi ; dodraw (xmin,ymin) ; % flush snippets fi ; if ysmall > 0 : - tys := (0,0) -- (tl,0) if option = "sticks" : rotated 180 fi ; - tys := tys transformed tr ; - for i = ymin step ysmall until ymax : - nodraw tys shifted (xmin,i) ; - endfor ; - tys := (0,0) -- (-tl,0) if option = "sticks" : rotated 180 fi ; - tys := tys transformed tr ; - for i = ymin step ysmall until ymax : - nodraw tys shifted (xmax,i) ; - endfor ; + if hasoption "frame" "vertical" : + for i = xmin step ((xmax-xmin)/xsmall) until xmax : + draw (i,ymin) -- (i,ymax) ; + endfor ; + fi ; + if hasoption "frame" "left" : + tys := (0,0) -- (tl,0) if hasoption "frame" "sticks" : rotated 180 fi ; + tys := tys transformed tr ; + for i = ymin step ((ymax-ymin)/ysmall) until ymax : + nodraw tys shifted (xmin,i) ; + endfor ; + fi ; + if hasoption "frame" "right" : + tys := (0,0) -- (-tl,0) if hasoption "frame" "sticks" : rotated 180 fi ; + tys := tys transformed tr ; + for i = ymin step ((ymax-ymin)/ysmall) until ymax : + nodraw tys shifted (xmax,i) ; + endfor ; + fi ; dodraw (xmin,ymin) ; % flush snippets fi ; fi ; |