Tag Info

New answers tagged

5

You code seems simplified enough to me as it is now, though I'm not sure to understand what you wish about adjusting lengths. As for the labels, I would suggest to use the freelabel macro of Metafun, that is to say, to replace the line label.lft(textext ( ve ), point 0.5 of p); in your vector definition by something like that: pair lpoint ; lpoint = point ...


0

This time with the mfpic package, which is a (La)TeX interface to MetaPost or Metafont (here used MetaPost). Note that this program is shorter than my correponding MetaPost coding, since mfpic already has its own drawing macros. In exchange it requires several compilations, à la bibTeX: first compile your LaTeX file, say grid.tex, with LaTeX, then the ...


3

A stack was too much to resist, so onto the bandwagon I jump. \documentclass{article} \usepackage[usestackEOL]{stackengine} \usepackage{xcolor,graphicx,amssymb} \setstackgap{L}{1cm} \def\stacktype{L} % DASHED LINE OF SPECIFIED LENGTH % From morsburg at http://tex.stackexchange.com/questions/12537/ % how-can-i-make-a-horizontal-dashed-line/12553#12553 ...


2

My own try with MetaPost, which is integrated into a LuaLaTeX program. I've picked up some macros I had already created for my own use (and modified some of them slightly). \documentclass[12pt]{scrartcl} \usepackage{unicode-math} \usepackage{luamplib} \everymplib{verbatimtex \leavevmode etex; def hgrid(expr ymin, ymax, ystep, u, v)(text mycolor) = ...


4

No graphics question is complete without a picture mode solution: \documentclass[border=2pt]{standalone} \usepackage{xcolor} \unitlength=1cm \begin{document} \begin{picture}(10.5,10.5)(-5,-5) {\color{gray} \thinlines \multiput(-5,-4)(0,1){9}{\line(1,0){10}} \multiput(-4,-5)(1,0){9}{\line(0,1){10}} } \thicklines \put(-5,0){\vector(1,0){10.2}} ...


14

Why pgfplots is left out? \documentclass[border=2mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[grid=both,ymin=-5,ymax=5,xmax=5,xmin=-5,xticklabel=\empty,yticklabel=\empty, minor tick num=1,axis lines = middle,xlabel=$x$,ylabel=$y$,label style = ...


8

And here is a fairly generic Metapost approach to making a grid. prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); u = 1cm; ymax = xmax = 4.75; xmin = ymin = -4.75; path xx, yy; xx = ((xmin,0) -- (xmax,0)) scaled u; yy = ((0,ymin) -- (0,ymax)) scaled u; drawoptions(dashed evenly scaled .5 withcolor .7 white); for i = ceiling ymin upto floor ...


8

with TiKZ: \documentclass[tikz,border=2mm]{standalone} \begin{document} \begin{tikzpicture} \draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9); \draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$}; \draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$}; \end{tikzpicture} \end{document}


3

A PSTricks solution: \documentclass{article} \usepackage{pst-plot} \begin{document} % parameter \def\size{5} \begin{pspicture}(-\size,-\size)(\size.57,\size.62)% found manually \multido{\iA = -\size+1}{\numexpr2*\size+1}{% \multido{\iB = -\size+1}{\numexpr2*\size+1}{% \psset{linewidth = 0.5\pslinewidth, linestyle = dashed, linecolor = gray!50} ...


1

I also posted this question on comp.text.tex, which is where Stephan Hennig wrote that it looks like 'binary' is not yet part of the MetaPost in TL 2014. (The TL 2014 METAPOST manual does refer to the numberprecision variable...) I decided to post this as an answer, so I can close the question.


2

The standard way to pass color options to a frame is to use the framecolor key. The value of that key can be accessed using \overlaylinecolor. For example: \setupcolors[state=start] \startuseMPgraphic{demo circle} newpath p ; p := fullcircle xscaled \overlaywidth yscaled \overlayheight ; fill p withcolor .85white ; draw p withpen pencircle ...



Top 50 recent answers are included