List operation, LabeledListPlot, Goto Statement
- To: mathgroup at smc.vnet.net
- Subject: [mg36739] List operation, LabeledListPlot, Goto Statement
- From: "Alexandre Costa" <costa at fem.unicamp.br>
- Date: Sat, 21 Sep 2002 02:22:10 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
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 One: The below code is working fine but I think there are more
elegant ways of doing so.
Any suggestions are VERY WELCOME.
<< DiscreteMath`Permutations`
individual1 = RandomPermutation[12]
individual2 = RandomPermutation[12]
CutPosition = 3 ;
CutLength = 4 ;
CutSequence = Take[Drop[individual1, CutPosition], CutLength]
SonOne = individual2;
Do[
If[MemberQ[SonOne, CutSequence[[i]]],
SonOne = Delete[SonOne, Position[SonOne, CutSequence[[i]]]]],
{i, 1,
CutLength}];
SonOne
SonOne = RotateLeft[SonOne, 1]
Do[SonOne = Insert[SonOne, Reverse[CutSequence][[i]], CutPosition +
1], {i, 1,
CutLength}]
SonOne
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]
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]]