Re: Re: plot
- To: mathgroup at smc.vnet.net
- Subject: [mg19006] Re: [mg18952] Re: [mg18241] plot
- From: BobHanlon at aol.com
- Date: Tue, 3 Aug 1999 13:44:45 -0400
- Sender: owner-wri-mathgroup at wolfram.com
You can also use a bar chart with thin bars: Needs["Graphics`Graphics`"]; data = {1, 2, 3, 4, 4}; BarChart[data, BarSpacing -> .9]; Bob Hanlon In a message dated 7/30/99 7:24:14 AM, m.van.almsick at cityweb.de writes: >>If I have a list such as { 1, 2, 3, 4, 4}, I want to plot the list that >>a verticle line will be draw from the x axis to end at the value. How >>to do it? > >Here are two functions that do the job: > >for a list of data values use: > >LinePlot[data : {__?NumericQ}] := > Show[Graphics[ > MapThread[Line[{{#1, 0}, {#1, #2}}] &, {Range[Length[data]], data}], > Axes -> True]] > >LinePlot[{1, 1, 3, 4, 4}] > > >for a list of data (x,y)-pairs use: > >LinePlot[data : {{_?NumericQ, _?NumericQ} ..}] := > Show[Graphics[MapThread[Line[{{#1, 0}, {#1, #2}}] &, Transpose[data]], > Axes -> True]] > >LinePlot[{{1, 1}, {2, 1}, {3, 3}, {4, 4}, {4.5, 4}}] >