MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: What's wrong in this plot?


Hi Sergio,


You have *one* Epilog option per one Graphics object. So You must add
the labels
Text[label,{midx,midy}] to the graphics primitives in the plot and You
will see the labels. Otherwise Show[] takes the options from the first
object in its arguments and use this options (including the
Epilog-option)
for the combinated graph.

Hope that helps
  Jens


sergio at scisun.sci.ccny.cuny.edu wrote:

> (*
>    Hello everyone:
>
>    I'm using the following code to plot a set of individual
>    rectangles, labeling each each rectangle with a number at
>    the center.  After that, the plots are combined in a single
>    one using Show. The problem is that only the label of the first
>    rectangle is shown in the combined plot. Could somebody point
>    out what is going and how to overcome the problem?
>
>     Regards,
>     Sergio
>     E-mail: sergio at scisun.sci.ccny.cuny.edu *)
>
> Clear[data];
> data = {{-20., 0.}, {-20., -10.}, {-10., -10.}, {-10., 0.}, {-20., 10.},
>         {-20., 0.}, {-10., 0.}, {-10., 10.}, {-10., 0.}, {-10., -10.},
>         {0., -10.}, {0., 0.}, {-10., 10.}, {-10., 0.}, {0., 0.}, {0.,
> 10.},
>         {0., 0.}, {0., -10.}, {10., -10.}, {10., 0.}, {0., 10.}, {0.,
> 0.},
>         {10., 0.}, {10., 10.}, {10., 0.}, {10., -10.}, {20., -10.},
> {20., 0.},
>         {10., 10.}, {10., 0.}, {20., 0.}, {20., 10.}};
>
> Clear[gridplot, label, midx, midy];
> gridplot = {};
> label = 0;
> Do[
>            midx = (data[[k]][[1]] + data[[k+3]][[1]])/2.0 ;
>            midy = (data[[k]][[2]] + data[[k+1]][[2]])/2.0 ;
>           label = label + 1;
>          AppendTo[gridplot,
>
> ListPlot[Append[Table[data[[i]],{i,k,k+3}],data[[k]]],
>                         PlotJoined -> True,
>                               Axes -> False,
>                             Epilog -> Text[label,{midx,midy}],
>                    DisplayFunction -> Identity]],
>    {k,1,Length[data],4}];
> Show[gridplot[[4]], Frame -> True, DisplayFunction -> $DisplayFunction];
> Show[gridplot[[7]], Frame -> True, DisplayFunction ->
> $DisplayFunction]; Show[gridplot, Frame -> True, DisplayFunction ->
> $DisplayFunction];
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own



  • Prev by Date: Re: error from MathLink, plotting results from a c++ simulation
  • Next by Date: Re: Variables names
  • Previous by thread: Re: What's wrong in this plot?
  • Next by thread: Re: What's wrong in this plot?