23.10.2014 Views

mfpic-doc.pdf.

mfpic-doc.pdf.

mfpic-doc.pdf.

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.2 COMMON OBJECTS. 18<br />

\xmarks{-2 step 1 until 2}<br />

is the equivalent of<br />

\xmarks{-2,-1,0,1,2}<br />

One must use exactly the words step and until. Spaces are not needed unless a variable name<br />

is used in place of one of the numbers (see subsection 4.12.4). The number of spaces is not significant.<br />

11 Users of this syntax should be aware that if any of the numbers is not an integer then,<br />

because of natural round-off effects, the last value might be overshot and a mark not printed there.<br />

For example, to ensure that a mark is printed at the point 1.0 on the x-axis, the second line below is<br />

better than the first.<br />

\xmarks{0 step .2 until 1.0}<br />

\xmarks{0 step .2 until 1.1}<br />

\setaxismarks{〈axis〉}{〈pos〉}<br />

\setbordermarks{〈lpos〉}{〈bpos〉}{〈rpos〉}{〈tpos〉}<br />

\setallbordermarks{〈pos〉}<br />

\setxmarks{〈pos〉}<br />

\setymarks{〈pos〉}<br />

These set the placement of the hash marks relative to the axis. The parameter 〈axis〉 is one of the<br />

letters x, y, l, b, r, or t, and 〈pos〉 must be one of the literal words inside, outside, centered,<br />

onleft, onright, ontop or onbottom. The second command takes four arguments and sets the<br />

position of the marks on each border. The third command sets the position on all four border axis<br />

to the same value. The last two commands are abbreviations for \setaxismarks{x}{〈pos〉} and<br />

\setaxismarks{y}{〈pos〉}, respectively.<br />

Not all combinations make sense (for example, ontop for the right side axis). In these cases, no<br />

error message is produced. These words are actually METAFONT numeric variables and the variables<br />

ontop and onleft, for example, have the same value. Thus, using ontop for the right axis will have<br />

the same effect as onleft. Similarly, onright and onbottom are the same. The parameters inside<br />

and outside usually make no sense for the x- and y-axes, but if they are used then inside means<br />

ontop for the x-axis and onright for the y-axis.<br />

\grid[〈size〉]{〈xsep〉,〈ysep〉}<br />

\gridpoints[〈size〉]{〈xsep〉,〈ysep〉}<br />

\lattice[〈size〉]{〈xsep〉,〈ysep〉}<br />

\hgridlines{〈ysep〉}<br />

\vgridlines{〈xsep〉}<br />

\gridlines{〈xsep〉,〈ysep〉}<br />

\grid draws a dot at every point for which the first coordinate is an integer multiple of the 〈xsep〉<br />

and the second coordinate is an integer multiple of 〈ysep〉. The diameter of the dot is determined by<br />

〈size〉. The default is the value of \griddotsize, initially 0.5pt. Under the metapost option, the<br />

color of the dot is pointcolor. The commands \gridpoints and \lattice are synonyms for<br />

\grid.<br />

\hgridlines draws the horizontal and \vgridlines the vertical lines through these same<br />

points. \gridlines draws both sets of lines. The thickness of the lines is set by \penwd. Authors<br />

are recommended to either reduce the pen width or change drawcolor to a lighter color for grid<br />

11 Experienced METAFONT programmers may recognize that anything can be used that is permitted in METAFONT’s<br />

〈forloop〉 syntax. Thus the given example can also be reworded \xmarks{-2 upto 2}, or even \xmarks{2 downto -2}.<br />

See subsection 4.12.7 for more on for-loops in MFPIC.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!