Re: Multiple data sets with ListPlot and different PointSizes - Mesh
- To: mathgroup at smc.vnet.net
- Subject: [mg85702] Re: Multiple data sets with ListPlot and different PointSizes - Mesh
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Tue, 19 Feb 2008 07:05:17 -0500 (EST)
- Organization: Uni Leipzig
- References: <fpdvjj$rts$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, and toDisk[{x_, y_, r_}] := Disk[{x, y}, 0.02*r] Graphics[{{RGBColor[1, 0, 0], toDisk /@ data1}, {RGBColor[0, 1, 0], toDisk /@ data2}}, Frame -> True] is not simpler ?? Regards Jens Tibor wrote: > Hi, > I would like to plot a few data sets with different PointSizes using > ListPlot. > My format: {{x1Pos,y1Pos,dot1Size}, {x2Pos,y2Pos,dot2Size},...} > The initial state: > data1 = {{1, 1, 3}, {5, 5, 6}, {6, 8, 10}} > data2 = {{1, 2, 10}, {2, 3, 5}, {6, 10, 16}} > data3 = ... > > Any solution would be appreciated. > > I found a handy example in the help: ListPlot / Mesh / Use explicit > styles at specific points > > ListPlot[Table[{x, Sin[x]}, {x, 0, 2 Pi, 2 Pi/20}], Mesh -> {Table[{x, > Directive[Hue[x/(2 Pi)], PointSize[Medium]]}, {x,0., 2 Pi, 2 Pi/8}]}, > Joined -> True] > > My go: > For a more readable code: > data1Plot = Table[{data1[[i, 1]], data1[[i, 2]]}, {i, 1, > Length[data1]}] > data2Plot = Table[{data2[[i, 1]], data2[[i, 2]]}, {i, 1, > Length[data2]}] > > dot1 = Table[{data1[[i, 1]], Directive[PointSize[data1[[i, > 3]]*0.002]]}, {i, 1, Length[data1]}] > dot2 = Table[{data2[[i, 1]], Directive[PointSize[data2[[i, > 3]]*0.002]]}, {i, 1, Length[data2]}] > > Everything is fine with one data set: > ListPlot[data1Plot, AxesOrigin -> {0, 0}, Joined -> True, Mesh -> > {dot1}] > > But with 2 sets of data, Mesh just take the first argument of its list > and mesh the two data sets the same: > ListPlot[{data1Plot, data2Plot}, AxesOrigin -> {0, 0}, Joined -> True, > Mesh -> {dot1, dot2}] > > I hope it's clear enough. > Thank you in advance! >