MathGroup Archive 2005

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

Search the Archive

Re: How to plot ....................

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59418] Re: How to plot ....................
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Tue, 9 Aug 2005 03:30:48 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 8/8/05 at 3:34 AM, tkghosh at mp.okayama-u.ac.jp (T. K. Ghosh)
wrote:

>Suppose I have a data file with the extension filename.dat. This
>data file has more than 2 columns, say there are 3 columns. I would
>like to plot column 1 vs column 2 and similarly column 1 vs column
>3 on the same frame. I can easily plot this data file using GNU
>plot. Is it possible to use Mathematica to plot such a data file?

Yes. For example:

First generate some data

test = Table[{x,x+Random[],x^2/10+Random[]}, {x, 10}];

then plot it

Show[
 Block[{$DisplayFunction = Identity}, 
    {ListPlot[Most /@ test, PlotStyle -> Red], 
     ListPlot[test[[All,{1, 3}]]]}]];
     
Here, I've used Block to temporarily set $DisplayFunction to Identity in order to surpress the output of the ListPlot expressions. Then Show does the work of combining the plots and displaying them.

Another way to achieve the same effect would be to use the DisplayTogether function in the Graphics`Graphics` package.

Another thing you might want to consider is the PairwiseScatterPlot in the Statistics`StatisticsPlots` package. With a single command, it produces a plot of every column vs every other column in a data matrix. If there are not too many columns in the data matrix, this is great for rapidly evaluating relationships in data.

For example, with the data above, try

<<Statistics`
PairwiseScatterPlot[test];
--
To reply via email subtract one hundred and four


  • Prev by Date: GoTo between different cell
  • Next by Date: Mathematica goes Bad
  • Previous by thread: Re: How to plot ....................
  • Next by thread: Re: Re: Some bugs in Mathematica - Documentation