Multiple data sets with ListPlot and different PointSizes - Mesh
- To: mathgroup at smc.vnet.net
- Subject: [mg85687] Multiple data sets with ListPlot and different PointSizes - Mesh
- From: Tibor <TiborNyers at gmail.com>
- Date: Tue, 19 Feb 2008 01:59:37 -0500 (EST)
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!
- Follow-Ups:
- RE: Multiple data sets with ListPlot and different PointSizes - Mesh
- From: "David Annetts" <davidannetts@aapt.net.au>
- RE: Multiple data sets with ListPlot and different PointSizes - Mesh