Re: List operation, LabeledListPlot, Goto Statement

• To: mathgroup at smc.vnet.net
• Subject: [mg36770] Re: [mg36739] List operation, LabeledListPlot, Goto Statement
• From: Omega Consulting <omega_consulting at yahoo.com>
• Date: Tue, 24 Sep 2002 01:34:24 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```At 01:22 AM 9/21/2002, Alexandre Costa wrote:

>Dear Group,
>
>      It is a pleasure write to you again. I have three questions to ask.
>
>Thanks for any enlightenment on these subjects.
>
>                                             Alexandre Costa
>
>Question Two:
>
>How can I change points properties (such as Size and Color) for the plot
>below?  The PlotStyle Option does not work for this LabeledListPlot
>
><< Graphics`Graphics`
>
>listcities = {{1, 5}, {4, 6}, {7, 5}, {5, 4}, {9, 4}, {2, 3}, {4, 2},
>{6, 2}, {1, 1}, {5, 1}, {3, 0}, {9, 0}};
>
>LabeledListPlot[listcities, Axes -> None, Frame -> True,
>   GridLines -> Automatic, PlotRange -> All,
>   DisplayFunction -> \$DisplayFunction]

It's not a built-in feature of LabeledListPlot, so you'll have to do it
manually.

gr=LabeledListPlot[listcities, Axes -> None, Frame -> True,
GridLines -> Automatic, PlotRange -> All,
DisplayFunction -> \$DisplayFunction]

You can add graphics directives to the points and text with a replacement rule.

Show[gr/.x_Point|x_Text->{RGBColor[1,0,0],x}]

>Question Three: Why the Goto statement below is not working?
>
>q = 2;
>Label[start];
>q  = 3;
>Label[begin];
>Print[q];
>q += 1; If[q < 6, Goto[begin], Goto[start]]

First, let me say that noone should ever use Goto. You should always use a
loop or some other process instead. With that said . . .

When you type semicolon separated input into the frontend, each command is
treated as a separate input (as if they were in separate input cells). So
the Labels and the Gotos are evaluated separately and there's no way to
jump from one to the other. Instead, the commands need to be within the
same expression. This can be done by wrapping the command in a
CompoundExpression

(
q = 2;
Label[start];
q  = 3;
Label[begin];
Print[q];
q += 1; If[q < 6, Goto[begin], Goto[start]]
)

Or some other expression, like a Module.

--------------------------------------------------------------
Omega Consulting