How This Image Can Be Created in a Document |
This version of the Cartesian Coordinates was created using the LaTeX "picture" environment. There is a much easier way to create an equivalent image using texdraw, however, this version is useful when graphing a parabola, as is explained elsewhere on this site.
The first two lines of the file establish the size of the picture.\setlength{\unitlength}{.7 mm} \begin{picture}(100,100) The size of the coordinate axes can easily be scaled by changing the "unitlength" parameter. The second line sets up a drawing area 100 units by 100 units---in this case, a drawing 70 mm by 70 mm. |
Now we draw the coordinate axes, with labels, with the origin in the center of the drawing area. In the LaTeX drawing environment, a "vector" yields a line with an arrowhead. The syntax is \vector(H,V){length}, where H and V are the relative number of units to move in the horizontal and vertical directions (slope of the arrow) until "length" units have been traversed horizontally (or vertically if the vector is vertical).
\thicklines \put(50,50){\vector(0,1){50}} \put(50,50){\vector(1,0){50}} \put(50,50){\vector(0,-1){50}} \put(50,50){\vector(-1,0){50}} \put(100,45){$x$} \put(45,100){$y$} |
Now we add the grid lines. We want the grid to be faint, so a graph will be easily visible on the graph paper--if the grid lines are too heavy, the graph is hard to read.
The drawing primitives available in the picture environment were not up to the task. I wanted very short, thin line segments, and the minimum size available is too large. Instead, I opted for a series of "rules." A rule is simply a filled rectangular area, whose size is specified by the user. For each grid line, we place a 100 of filled rectangles, each .05 mm by .5 mm, spaced one "unitlength" apart.
% Vertical grid lines \multiput(0,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(5,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(10,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(15,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(20,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(25,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(30,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(35,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(40,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(45,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(55,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(60,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(65,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(70,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(75,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(80,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(85,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(90,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(95,0)(0,1){100}{\rule{.05mm}{.5mm}} \multiput(100,0)(0,1){100}{\rule{.05mm}{.5mm}} |
||
% Horizontal grid lines \multiput(0,0)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,5)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,10)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,15)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,20)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,25)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,30)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,35)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,40)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,45)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,55)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,60)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,65)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,70)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,75)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,80)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,85)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,90)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,95)(1,0){100}{\rule{.5mm}{.05mm}} \multiput(0,100)(1,0){100}{\rule{.5mm}{.05mm}} \end{picture} |