Difference between revisions of "Asymptote: Labeling"
(Created page with '{{Asymptote}} Let's say you have an point that you want to label, for example, Point A. This is extremely simple. First, draw a dot. <tt>dot((0,0));</tt> <asy> dot((0,0)); <…') |
Mathgeek07 (talk | contribs) |
||
Line 1: | Line 1: | ||
{{Asymptote}} | {{Asymptote}} | ||
− | Let's say you have | + | Let's say you have a point that you want to label, for example, Point A. |
This is extremely simple. First, draw a dot. | This is extremely simple. First, draw a dot. |
Revision as of 20:23, 28 November 2017
Let's say you have a point that you want to label, for example, Point A.
This is extremely simple. First, draw a dot.
dot((0,0));
Now we use the label command.
dot((0,0)); label("A",(0,0));
However, it is likely that this is not what you want your point to look like. We now fix an attribute to this label:
dot((0,0)); label("A",(0,0),S);
The location of the label could also be changed.
dot((0,0)); label("A",(0,0),N);
In fact, you can use North, West, East, South, Northwest (NW), Southeast (SE), etc etc.
Now, lets get fancy with labeling. Let's say we want to label a length. In this case, we can use :
dot((0,0)); dot((1,1)); draw((0,0)--(1,1)); label("The length is $\sqrt{2}$",(0,0)--(1,1),SE);
Notice that I labeled a line.
Even fancier:
dot((0,0)); dot((1,1)); draw((0,0)--(1,1)); label("The length is $\sqrt{2}$",(0,0)--(1,1),SE,green);