MathGroup Archive 2009

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

Search the Archive

Re: ListPlot ColorFunction

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99129] Re: ListPlot ColorFunction
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Tue, 28 Apr 2009 04:43:32 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <gt3tma$npk$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de

Hi,

ListPlot[#, Filling -> Axis, PlotStyle -> PointSize[0.02],
    Epilog -> (If[#[[2]] === 0, {PointSize[0.02], RGBColor[1, 0, 0],
          Point[#]}, {}] & /@ MapIndexed[Append[#2, #1] &, #])] &[{9,
   4, 1, 0, 0, 0, 1, 4, 9}
  ]

?

Regards
   Jens

Serych Jakub wrote:
> Dear Mathematica users,
> first let me thank you for many nice zigzag solutions from my previous post.
> 
> Today I have another question. I need to highlight some data points in
> ListPlot by changing their color. How to do it? I tried the similar solution
> which somebody have sent me time ago for the same problem which I had with
> Plot, but it doesn't work with ListPlot.
> 
> In the example below I'm trying to make the zero points Red and all other
> Blue.
> 
> ListPlot[{9, 4, 1, 0, 0, 0, 1, 4, 9}, Filling -> Axis,
>  PlotStyle -> PointSize[0.02],
>  ColorFunction -> (If[# == 0, RGBColor[1, 0, 0], RGBColor[0, 0, 1]] &)]
> 
> 
> Thanks in advance for any help
> 
> Jakub
> 


  • Prev by Date: Select and Cases Give Different Answers
  • Next by Date: Re: ListPlot ColorFunction
  • Previous by thread: ListPlot ColorFunction
  • Next by thread: Re: ListPlot ColorFunction