MathGroup Archive 2005

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

Search the Archive

Re: Plotting just specific points

  • To: mathgroup at
  • Subject: [mg54141] Re: [mg54043] Plotting just specific points
  • From: "Wolf, Hartmut" <Hartmut.Wolf at>
  • Date: Fri, 11 Feb 2005 03:34:33 -0500 (EST)
  • Sender: owner-wri-mathgroup at

>-----Original Message-----
>From: zak [mailto:chocolatez at] 
To: mathgroup at
>Sent: Wednesday, February 09, 2005 3:27 PM
>To: mathgroup at
>Subject: [mg54141] [mg54043] Plotting just specific points
>if i have the list:
>and in the ListPlot[a]  i want to show only the points wich 
>represent only the "2" while preserving the positions of the 
>"2" in the list, so i could focus my attention to a specific 
>wanted values, how could i do that or even better if it is 
>possible to plot the whole values of ListPlot[a] while making 
>the points "2" in red color as an example.

As for a simple example check:

b = MapIndexed[If[#1 == 2, Append[#2, #1], Unevaluated[Sequence[]]] &,
{{3, 2}, {4, 2}, {7, 2}, {8, 2}, {10, 2}}

ListPlot[a, PlotJoined -> True, 
  Epilog -> {Hue[0], PointSize[.02], Point /@ b}]

You may refine this on the selection criteria or formatting the points
reflecting further properties.

(Perhaps this appears to be a simpler selection:

b = Cases[Transpose[{Range[Length[a]], a}], {_, 2}]
{{3, 2}, {4, 2}, {7, 2}, {8, 2}, {10, 2}}

of course other variants exist)

Hartmut Wolf

  • Prev by Date: Re: how to have a blind factorization of a polinomial?
  • Next by Date: Re: Re: finding package in ExtraPackages`Enhancements`
  • Previous by thread: Re: Plotting just specific points
  • Next by thread: Re: Plotting just specific points