MathGroup Archive 2002

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

Search the Archive

Re: Re: Colored ListPlot


Here's a better version of DotPlot that is improved by Borut's and 
Allan's idea:

Needs["Utilities`FilterOptions`"];

DotPlot[data_?MatrixQ, opts___Rule] :=
Module[{colorfn, scale, dotsize, m, scalefn},
  colorfn = ColorFunction/.{opts}/.{ColorFunction->Hue};
  scale = ColorFunctionScaling/.{opts}/.{ColorFunctionScaling->True};
  dotsize = DotSize/.{opts}/.{DotSize->0.01};
  m = If[scale, {Min[#],Max[#]}& @ Last[Transpose[data]], {0,1}];
  scalefn = (# - m[[1]])/(m[[2]]-m[[1]])& ;
    Show[ Graphics[
     {PointSize[dotsize],colorfn[scalefn[#3]],Point[{#1,#2}]}&@@@data],
     FilterOptions[Graphics, opts] ] ]


--Selwyn



  • Prev by Date: Sum of 1/Primes
  • Next by Date: RE: Re: Using Text Cells
  • Previous by thread: Re: Colored ListPlot
  • Next by thread: Re: Kernel API