Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Plotting just specific points

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54095] Re: [mg54043] Plotting just specific points
  • From: "David Park" <djmp at earthlink.net>
  • Date: Thu, 10 Feb 2005 02:46:56 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Zak,

Here is one method. First convert your points to xy pairs.

a = {5, 1, 2, 2, 6, 7, 2, 2, 8, 2};
b = Transpose[{Range[Length[a]], a}]
{{1, 5}, {2, 1}, {3, 2}, {4, 2}, {5, 6}, {6, 7}, {7, 2}, {8, 2}, {9, 8},
 {10, 2}}

Then plot the points by mapping a point routine onto the list of points. The
2 points are plotted in Red and the other points are plotted in LightGray.

Needs["Graphics`Colors`"]

Show[Graphics[
      {AbsolutePointSize[4],
        If[Part[#, 2] == 2, {Red, Point[#]}, {LightGray, Point[#]}] & /@
b}],
    Frame -> True,
    PlotLabel -> "Points with Value 2 in Red",
    Background -> Linen,
    ImageSize -> 400];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


From: zak [mailto:chocolatez at gmail.com]
To: mathgroup at smc.vnet.net

if i have the list:
a={5,1,2,2,6,7,2,2,8,2}
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.
thanks
zak




  • Prev by Date: Re: Plotting just specific points
  • Next by Date: Re: finding package in ExtraPackages`Enhancements`
  • Previous by thread: Re: Plotting just specific points
  • Next by thread: Re: Plotting just specific points