MathGroup Archive 1999

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

Search the Archive

Re: "LOLLIPOP" PLOTS FOR DISCRETE SEQUENCES


Maya Lemiel [lemiel at bangkok.com] wrote:

> I'm thinking of representing discrete-time sequences by means of 
> "lollipop"
> plots, that is, vertical lines with filled circles on top.  Is there a
> Mathermatica function to meet this need or else can anybody out there
> suggest a straightforward way to implement it.

Suppose you have a sequence of points listA, e.g.:

In[1]:=
listA = Transpose[{{1, 2, 3}, {1, 4, 9}}]
Out[1]=
{{1, 1}, {2, 4}, {3, 9}}

The corresponding abscissas are:

In[2]:=
abscs = Transpose[{{1, 2, 3}, {0, 0, 0}}]
Out[2]=
{{1, 0}, {2, 0}, {3, 0}}

The lines joining the abscissas with the points are:

In[3]:=
Line /@ Transpose[{abscs, listA}]
Out[3]=
{Line[{{1, 0}, {1, 1}}], Line[{{2, 0}, {2, 4}}], Line[{{3, 0}, {3, 9}}]}

The "lollipops" can be obtained like this:

In[4]:=
Show[Graphics[Line /@ Transpose[{abscs, listA}]], 
  Epilog -> Table[Disk[listA[[j]], 0.035], {j, 1, 3}], 
  AspectRatio -> Automatic]

Tomas Garza
Mexico City


  • Prev by Date: Re: PolynomialQ (wrong) behavior ?
  • Next by Date: Re: ListPlot question
  • Previous by thread: "LOLLIPOP" PLOTS FOR DISCRETE SEQUENCES
  • Next by thread: PolynomialQ (wrong) behavior ?