MathGroup Archive 2002

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

Search the Archive

Re: Re: Colored ListPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg36918] Re: [mg36904] Re: Colored ListPlot
  • From: Selwyn Hollis <selwynh at earthlink.net>
  • Date: Wed, 2 Oct 2002 03:31:48 -0400 (EDT)
  • References: <200210010845.EAA14460@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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