Plot with ordinate values summed
- To: mathgroup at smc.vnet.net
- Subject: [mg122361] Plot with ordinate values summed
- From: leigh pascoe <leigh at evry.inserm.fr>
- Date: Wed, 26 Oct 2011 17:40:04 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
Dear Mathgroup, Can someone please help me with the following display problem. I have data of the form data={{{x1,y1}, {x1,y2}, {x2,y2}.....{xn,yn}}{xx,yy},{},........}}} or a list of lists of {x,y} coordinates. I want to plot each set separately, which I have done with the following inelegant commands: fil1=Import[...//file1]; fil2=Import[.. //file2]; etc filelist = {"fil1", "fil2", "fil3", f "il4", "fil5", "fil6", "fil7", "fil8", "fil9", "fil10", "fil11", "fil12", "fil13", "fil14", "fil15", "fil16", "fil17", "fil18", "fil19", "fil20", "fil21", "fil22"} elementlist = {fil1[[All, {3, 5}]], fil2[[All, {3, 5}]], fil3[[All, {3, 5}]], fil4[[All, {3, 5}]], fil5[[All, {3, 5}]], fil6[[All, {3, 5}]], fil7[[All, {3, 5}]], fil8[[All, {3, 5}]], fil9[[All, {3, 5}]], fil10[[All, {3, 5}]], fil11[[All, {3, 5}]], fil12[[All, {3, 5}]], fil13[[All, {3, 5}]], fil14[[All, {3, 5}]], fil15[[All, {3, 5}]], fil16[[All, {3, 5}]], fil17[[All, {3, 5}]], fil18[[All, {3, 5}]], fil19[[All, {3, 5}]], fil20[[All, {3, 5}]], fil21[[All, {3, 5}]], fil22[[All, {3, 5}]]}; i.e. taking data from columns 3 and 5 to get my {x,y} data. ListPlot[#, Filling -> Axis, AxesLabel -> {"theta", "lod"}] & /@ elementlist Then gives me a plot for each file with labeled Axes. I would also like to plot data corresponding to the sums of the y values where the x value is repeated, so {{x1,y1},{x1,y2},{x1,y3}} in a given file should become {x1,y1+y2+y3} and the mean of the y values i.e. {x1, (y1+y2+y3)/3} etc Finally it would be nice to have a title for each plot corresponding to the file name or other list of titles. I can't quite seem to get this to work. I would appreciate any help. Thanks LP