Difference between revisions of "Graphgrid.asy"

(A template for Asymptote graph creation)
 
 
Line 1: Line 1:
{{Graphgrid.asy}}
+
Graphgrid.asy is a template created by user Lord_Baltimore to allow easy creation of equation graphs in the Cartesian plane. It is free for anyone to use for any purpose. Its code is shown below:
 
 
Graphgrid.asy is a template created by user Lord_Baltimore to allow easy creation of equation graphs in the Cartesian plane. Its code is shown below:
 
  
  
Line 10: Line 8:
  
 
draw((-10,-11)--(-10,11),rgb(.7,.7,.7));draw((-9,-11)--(-9,11),rgb(.7,.7,.7));draw((-8,-11)--(-8,11),rgb(.7,.7,.7));draw((-7,-11)--(-7,11),rgb(.7,.7,.7));draw((-6,-11)--(-6,11),rgb(.7,.7,.7));draw((-5,-11)--(-5,11),rgb(.7,.7,.7));draw((-4,-11)--(-4,11),rgb(.7,.7,.7));draw((-3,-11)--(-3,11),rgb(.7,.7,.7));draw((-2,-11)--(-2,11),rgb(.7,.7,.7));draw((-1,-11)--(-1,11),rgb(.7,.7,.7));draw((-0,-11)--(0,11),rgb(.7,.7,.7));draw((1,-11)--(1,11),rgb(.7,.7,.7));draw((2,-11)--(2,11),rgb(.7,.7,.7));draw((3,-11)--(3,11),rgb(.7,.7,.7));draw((4,-11)--(4,11),rgb(.7,.7,.7));draw((5,-11)--(5,11),rgb(.7,.7,.7));draw((6,-11)--(6,11),rgb(.7,.7,.7));draw((7,-11)--(7,11),rgb(.7,.7,.7));draw((8,-11)--(8,11),rgb(.7,.7,.7));draw((9,-11)--(9,11),rgb(.7,.7,.7));draw((10,-11)--(10,11),rgb(.7,.7,.7));draw((-11,10)--(11,10),rgb(.7,.7,.7));draw((-11,9)--(11,9),rgb(.7,.7,.7));draw((-11,8)--(11,8),rgb(.7,.7,.7));draw((-11,7)--(11,7),rgb(.7,.7,.7));draw((-11,6)--(11,6),rgb(.7,.7,.7));draw((-11,5)--(11,5),rgb(.7,.7,.7));draw((-11,4)--(11,4),rgb(.7,.7,.7));draw((-11,3)--(11,3),rgb(.7,.7,.7));draw((-11,2)--(11,2),rgb(.7,.7,.7));draw((-11,1)--(11,1),rgb(.7,.7,.7));draw((-11,0)--(11,0),rgb(.7,.7,.7));draw((-11,-1)--(11,-1),rgb(.7,.7,.7));draw((-11,-2)--(11,-2),rgb(.7,.7,.7));draw((-11,-3)--(11,-3),rgb(.7,.7,.7));draw((-11,-4)--(11,-4),rgb(.7,.7,.7));draw((-11,-5)--(11,-5),rgb(.7,.7,.7));draw((-11,-6)--(11,-6),rgb(.7,.7,.7));draw((-11,-7)--(11,-7),rgb(.7,.7,.7));draw((-11,-8)--(11,-8),rgb(.7,.7,.7));draw((-11,-9)--(11,-9),rgb(.7,.7,.7));draw((-11,-10)--(11,-10),rgb(.7,.7,.7));draw((11,0)--(-11,0),blue,Arrows);draw((0,11)--(0,-11),blue,Arrows);label("<math>y</math>",(0,11),N);label("<math>-y</math>",(0,-11),S);label("<math>x</math>",(11,0),E);label("<math>-x</math>",(-11,0),W);
 
draw((-10,-11)--(-10,11),rgb(.7,.7,.7));draw((-9,-11)--(-9,11),rgb(.7,.7,.7));draw((-8,-11)--(-8,11),rgb(.7,.7,.7));draw((-7,-11)--(-7,11),rgb(.7,.7,.7));draw((-6,-11)--(-6,11),rgb(.7,.7,.7));draw((-5,-11)--(-5,11),rgb(.7,.7,.7));draw((-4,-11)--(-4,11),rgb(.7,.7,.7));draw((-3,-11)--(-3,11),rgb(.7,.7,.7));draw((-2,-11)--(-2,11),rgb(.7,.7,.7));draw((-1,-11)--(-1,11),rgb(.7,.7,.7));draw((-0,-11)--(0,11),rgb(.7,.7,.7));draw((1,-11)--(1,11),rgb(.7,.7,.7));draw((2,-11)--(2,11),rgb(.7,.7,.7));draw((3,-11)--(3,11),rgb(.7,.7,.7));draw((4,-11)--(4,11),rgb(.7,.7,.7));draw((5,-11)--(5,11),rgb(.7,.7,.7));draw((6,-11)--(6,11),rgb(.7,.7,.7));draw((7,-11)--(7,11),rgb(.7,.7,.7));draw((8,-11)--(8,11),rgb(.7,.7,.7));draw((9,-11)--(9,11),rgb(.7,.7,.7));draw((10,-11)--(10,11),rgb(.7,.7,.7));draw((-11,10)--(11,10),rgb(.7,.7,.7));draw((-11,9)--(11,9),rgb(.7,.7,.7));draw((-11,8)--(11,8),rgb(.7,.7,.7));draw((-11,7)--(11,7),rgb(.7,.7,.7));draw((-11,6)--(11,6),rgb(.7,.7,.7));draw((-11,5)--(11,5),rgb(.7,.7,.7));draw((-11,4)--(11,4),rgb(.7,.7,.7));draw((-11,3)--(11,3),rgb(.7,.7,.7));draw((-11,2)--(11,2),rgb(.7,.7,.7));draw((-11,1)--(11,1),rgb(.7,.7,.7));draw((-11,0)--(11,0),rgb(.7,.7,.7));draw((-11,-1)--(11,-1),rgb(.7,.7,.7));draw((-11,-2)--(11,-2),rgb(.7,.7,.7));draw((-11,-3)--(11,-3),rgb(.7,.7,.7));draw((-11,-4)--(11,-4),rgb(.7,.7,.7));draw((-11,-5)--(11,-5),rgb(.7,.7,.7));draw((-11,-6)--(11,-6),rgb(.7,.7,.7));draw((-11,-7)--(11,-7),rgb(.7,.7,.7));draw((-11,-8)--(11,-8),rgb(.7,.7,.7));draw((-11,-9)--(11,-9),rgb(.7,.7,.7));draw((-11,-10)--(11,-10),rgb(.7,.7,.7));draw((11,0)--(-11,0),blue,Arrows);draw((0,11)--(0,-11),blue,Arrows);label("<math>y</math>",(0,11),N);label("<math>-y</math>",(0,-11),S);label("<math>x</math>",(11,0),E);label("<math>-x</math>",(-11,0),W);
 +
[/asy]
  
//red dot
+
{Examples}
dot((0,0),linewidth(5)+red);
+
<asy>
label("\$\textcolor{red}{(0,0)}\$",(0,0),SW);
+
size(400);
 +
//You can adjust this parameter to your needs - it's the size of the whole graph.
 +
 +
draw((-10,-11)--(-10,11),rgb(.7,.7,.7));draw((-9,-11)--(-9,11),rgb(.7,.7,.7));draw((-8,-11)--(-8,11),rgb(.7,.7,.7));draw((-7,-11)--(-7,11),rgb(.7,.7,.7));draw((-6,-11)--(-6,11),rgb(.7,.7,.7));draw((-5,-11)--(-5,11),rgb(.7,.7,.7));draw((-4,-11)--(-4,11),rgb(.7,.7,.7));draw((-3,-11)--(-3,11),rgb(.7,.7,.7));draw((-2,-11)--(-2,11),rgb(.7,.7,.7));draw((-1,-11)--(-1,11),rgb(.7,.7,.7));draw((-0,-11)--(0,11),rgb(.7,.7,.7));draw((1,-11)--(1,11),rgb(.7,.7,.7));draw((2,-11)--(2,11),rgb(.7,.7,.7));draw((3,-11)--(3,11),rgb(.7,.7,.7));draw((4,-11)--(4,11),rgb(.7,.7,.7));draw((5,-11)--(5,11),rgb(.7,.7,.7));draw((6,-11)--(6,11),rgb(.7,.7,.7));draw((7,-11)--(7,11),rgb(.7,.7,.7));draw((8,-11)--(8,11),rgb(.7,.7,.7));draw((9,-11)--(9,11),rgb(.7,.7,.7));draw((10,-11)--(10,11),rgb(.7,.7,.7));draw((-11,10)--(11,10),rgb(.7,.7,.7));draw((-11,9)--(11,9),rgb(.7,.7,.7));draw((-11,8)--(11,8),rgb(.7,.7,.7));draw((-11,7)--(11,7),rgb(.7,.7,.7));draw((-11,6)--(11,6),rgb(.7,.7,.7));draw((-11,5)--(11,5),rgb(.7,.7,.7));draw((-11,4)--(11,4),rgb(.7,.7,.7));draw((-11,3)--(11,3),rgb(.7,.7,.7));draw((-11,2)--(11,2),rgb(.7,.7,.7));draw((-11,1)--(11,1),rgb(.7,.7,.7));draw((-11,0)--(11,0),rgb(.7,.7,.7));draw((-11,-1)--(11,-1),rgb(.7,.7,.7));draw((-11,-2)--(11,-2),rgb(.7,.7,.7));draw((-11,-3)--(11,-3),rgb(.7,.7,.7));draw((-11,-4)--(11,-4),rgb(.7,.7,.7));draw((-11,-5)--(11,-5),rgb(.7,.7,.7));draw((-11,-6)--(11,-6),rgb(.7,.7,.7));draw((-11,-7)--(11,-7),rgb(.7,.7,.7));draw((-11,-8)--(11,-8),rgb(.7,.7,.7));draw((-11,-9)--(11,-9),rgb(.7,.7,.7));draw((-11,-10)--(11,-10),rgb(.7,.7,.7));draw((11,0)--(-11,0),blue,Arrows);draw((0,11)--(0,-11),blue,Arrows);label("$y$",(0,11),N);label("$-y$",(0,-11),S);label("$x$",(11,0),E);label("$-x$",(-11,0),W);
  
//green dot
+
//path drawn
dot((1,2),linewidth(5)+green);
+
pair a = (-5,-5);
label("\$\textcolor{green}{(1,2)}\$",(1,2),NE);
+
pair b = (3,2);
 
+
pair c = (-4,7);
//blue dot
+
pair d = (0,0);
dot((-7,5),linewidth(5)+blue);
+
pair e = (7,-8);
label("\$\textcolor{blue}{(-7,5)}\$",(-7,5),NW);
+
path p = a..b..c..d..e;
 
+
draw(p,magenta);
//cyan dot
 
dot((-1,-6),linewidth(5)+cyan);
 
label("\$\textcolor{cyan}{(-1,-6)}\$",(-1,-6),SW);
 
 
 
//magenta dot
 
dot((5,-5),linewidth(5)+magenta);
 
label("\$\textcolor{magenta}{(5,-5)}\$",(5,-5),SE);
 
 
 
[/asy]
 
  
 +
//dots drawn
 +
dot(a,linewidth(5)+red);
 +
dot(b,linewidth(5)+green);
 +
dot(c,linewidth(5)+blue);
 +
dot(d,linewidth(5)+cyan);
 +
dot(e,linewidth(5)+magenta);
  
Anyone can use this, for anything.
+
//labels
 +
label("$\textcolor{red}{(-5,-5)}$",a,W);
 +
label("$\textcolor{green}{(3,2)}$",b,E);
 +
label("$\textcolor{blue}{(-4,7)}$",c,NW);
 +
label("$\textcolor{cyan}{(0,0)}$",d,SW);
 +
label("$\textcolor{magenta}{(7,-8)}$",e,SE);
 +
</asy>

Latest revision as of 21:18, 16 November 2017

Graphgrid.asy is a template created by user Lord_Baltimore to allow easy creation of equation graphs in the Cartesian plane. It is free for anyone to use for any purpose. Its code is shown below:


[asy] size(400); //You can adjust this parameter to your needs - it's the size of the whole graph.

draw((-10,-11)--(-10,11),rgb(.7,.7,.7));draw((-9,-11)--(-9,11),rgb(.7,.7,.7));draw((-8,-11)--(-8,11),rgb(.7,.7,.7));draw((-7,-11)--(-7,11),rgb(.7,.7,.7));draw((-6,-11)--(-6,11),rgb(.7,.7,.7));draw((-5,-11)--(-5,11),rgb(.7,.7,.7));draw((-4,-11)--(-4,11),rgb(.7,.7,.7));draw((-3,-11)--(-3,11),rgb(.7,.7,.7));draw((-2,-11)--(-2,11),rgb(.7,.7,.7));draw((-1,-11)--(-1,11),rgb(.7,.7,.7));draw((-0,-11)--(0,11),rgb(.7,.7,.7));draw((1,-11)--(1,11),rgb(.7,.7,.7));draw((2,-11)--(2,11),rgb(.7,.7,.7));draw((3,-11)--(3,11),rgb(.7,.7,.7));draw((4,-11)--(4,11),rgb(.7,.7,.7));draw((5,-11)--(5,11),rgb(.7,.7,.7));draw((6,-11)--(6,11),rgb(.7,.7,.7));draw((7,-11)--(7,11),rgb(.7,.7,.7));draw((8,-11)--(8,11),rgb(.7,.7,.7));draw((9,-11)--(9,11),rgb(.7,.7,.7));draw((10,-11)--(10,11),rgb(.7,.7,.7));draw((-11,10)--(11,10),rgb(.7,.7,.7));draw((-11,9)--(11,9),rgb(.7,.7,.7));draw((-11,8)--(11,8),rgb(.7,.7,.7));draw((-11,7)--(11,7),rgb(.7,.7,.7));draw((-11,6)--(11,6),rgb(.7,.7,.7));draw((-11,5)--(11,5),rgb(.7,.7,.7));draw((-11,4)--(11,4),rgb(.7,.7,.7));draw((-11,3)--(11,3),rgb(.7,.7,.7));draw((-11,2)--(11,2),rgb(.7,.7,.7));draw((-11,1)--(11,1),rgb(.7,.7,.7));draw((-11,0)--(11,0),rgb(.7,.7,.7));draw((-11,-1)--(11,-1),rgb(.7,.7,.7));draw((-11,-2)--(11,-2),rgb(.7,.7,.7));draw((-11,-3)--(11,-3),rgb(.7,.7,.7));draw((-11,-4)--(11,-4),rgb(.7,.7,.7));draw((-11,-5)--(11,-5),rgb(.7,.7,.7));draw((-11,-6)--(11,-6),rgb(.7,.7,.7));draw((-11,-7)--(11,-7),rgb(.7,.7,.7));draw((-11,-8)--(11,-8),rgb(.7,.7,.7));draw((-11,-9)--(11,-9),rgb(.7,.7,.7));draw((-11,-10)--(11,-10),rgb(.7,.7,.7));draw((11,0)--(-11,0),blue,Arrows);draw((0,11)--(0,-11),blue,Arrows);label("$y$",(0,11),N);label("$-y$",(0,-11),S);label("$x$",(11,0),E);label("$-x$",(-11,0),W); [/asy]

{Examples} [asy] size(400); //You can adjust this parameter to your needs - it's the size of the whole graph.   draw((-10,-11)--(-10,11),rgb(.7,.7,.7));draw((-9,-11)--(-9,11),rgb(.7,.7,.7));draw((-8,-11)--(-8,11),rgb(.7,.7,.7));draw((-7,-11)--(-7,11),rgb(.7,.7,.7));draw((-6,-11)--(-6,11),rgb(.7,.7,.7));draw((-5,-11)--(-5,11),rgb(.7,.7,.7));draw((-4,-11)--(-4,11),rgb(.7,.7,.7));draw((-3,-11)--(-3,11),rgb(.7,.7,.7));draw((-2,-11)--(-2,11),rgb(.7,.7,.7));draw((-1,-11)--(-1,11),rgb(.7,.7,.7));draw((-0,-11)--(0,11),rgb(.7,.7,.7));draw((1,-11)--(1,11),rgb(.7,.7,.7));draw((2,-11)--(2,11),rgb(.7,.7,.7));draw((3,-11)--(3,11),rgb(.7,.7,.7));draw((4,-11)--(4,11),rgb(.7,.7,.7));draw((5,-11)--(5,11),rgb(.7,.7,.7));draw((6,-11)--(6,11),rgb(.7,.7,.7));draw((7,-11)--(7,11),rgb(.7,.7,.7));draw((8,-11)--(8,11),rgb(.7,.7,.7));draw((9,-11)--(9,11),rgb(.7,.7,.7));draw((10,-11)--(10,11),rgb(.7,.7,.7));draw((-11,10)--(11,10),rgb(.7,.7,.7));draw((-11,9)--(11,9),rgb(.7,.7,.7));draw((-11,8)--(11,8),rgb(.7,.7,.7));draw((-11,7)--(11,7),rgb(.7,.7,.7));draw((-11,6)--(11,6),rgb(.7,.7,.7));draw((-11,5)--(11,5),rgb(.7,.7,.7));draw((-11,4)--(11,4),rgb(.7,.7,.7));draw((-11,3)--(11,3),rgb(.7,.7,.7));draw((-11,2)--(11,2),rgb(.7,.7,.7));draw((-11,1)--(11,1),rgb(.7,.7,.7));draw((-11,0)--(11,0),rgb(.7,.7,.7));draw((-11,-1)--(11,-1),rgb(.7,.7,.7));draw((-11,-2)--(11,-2),rgb(.7,.7,.7));draw((-11,-3)--(11,-3),rgb(.7,.7,.7));draw((-11,-4)--(11,-4),rgb(.7,.7,.7));draw((-11,-5)--(11,-5),rgb(.7,.7,.7));draw((-11,-6)--(11,-6),rgb(.7,.7,.7));draw((-11,-7)--(11,-7),rgb(.7,.7,.7));draw((-11,-8)--(11,-8),rgb(.7,.7,.7));draw((-11,-9)--(11,-9),rgb(.7,.7,.7));draw((-11,-10)--(11,-10),rgb(.7,.7,.7));draw((11,0)--(-11,0),blue,Arrows);draw((0,11)--(0,-11),blue,Arrows);label("$y$",(0,11),N);label("$-y$",(0,-11),S);label("$x$",(11,0),E);label("$-x$",(-11,0),W);  //path drawn pair a = (-5,-5); pair b = (3,2); pair c = (-4,7); pair d = (0,0); pair e = (7,-8); path p = a..b..c..d..e; draw(p,magenta);  //dots drawn dot(a,linewidth(5)+red); dot(b,linewidth(5)+green); dot(c,linewidth(5)+blue); dot(d,linewidth(5)+cyan); dot(e,linewidth(5)+magenta);  //labels label("$\textcolor{red}{(-5,-5)}$",a,W); label("$\textcolor{green}{(3,2)}$",b,E); label("$\textcolor{blue}{(-4,7)}$",c,NW); label("$\textcolor{cyan}{(0,0)}$",d,SW); label("$\textcolor{magenta}{(7,-8)}$",e,SE); [/asy]