On Oct. 24, James Jarrell wrote:
> I have the following command:
> plot2d([f(x),[discrete,[x1],[y1]],[discrete,[x2],
> [y2]],[gnuplot_preamble,the_pa],
> [style,[lines,3,2],[points,3,1,1],
> [points,3,1,1]])$
>
> It plots my defined f(x) with two points that I have defined.
> I want the first point to be labeled A and the second B.
> How do I place the labels next to the points?
> Is there something I can put in the preamble?
> Seems silly, but its hanging me up. thanks
>
Hi Jim,
I used to remember plot2d better than at present,
now that I have switched to qdraw (available
with ch. 5 on my webpage).
For what it's worth here are two ways to handle
labeling of points using qdraw(..):
-----------------------------------
(%i1) (load(draw),load(qdraw))$
qdraw(...), qdensity(...), syntax: type qdraw();
/* solution putting label next to key entry */
(%i6) qdraw( ex( cos(x), x, 0, %pi ), xr( -1 , 4 ),
yr( -2, 2 ), pts( [ [ 0, 1] ], pc( red ), pk( "A" ) ),
pts( [ [ %pi, -1 ] ], pc( green ), pk( "B" ) ) )$
/* solution putting a label next to each point */
(%i7) qdraw( ex( cos(x), x, 0, %pi ), xr( -1, 4 ),
yr( -2, 2 ), pts( [ [ 0, 1 ] ], pc( red ) ),
pts( [ [%pi, -1 ] ], pc( green ) ),
label( [ "A", 0.2, 1.2 ], [ "B", 3.3, -1 ] ) )$
Ted Woollett
http://www.csulb.edu/~woollett/