How to Sort and Manipulate Data for List Plotting in Mathematica?

AI Thread Summary
To sort and manipulate data for list plotting in Mathematica, users can import data from a .dat file and remove unwanted headers using the Drop function. The code snippet provided demonstrates how to drop the first five rows of data and create a list plot. For switching axes, users can reverse the order of the data pairs using the Reverse function. To sort out unwanted column headings from combined lists, a detailed example is requested to illustrate how to filter out titles before plotting. Proper data manipulation is essential for effective visualization in Mathematica.
TwoSeat
Messages
4
Reaction score
0
I am importing data as a .dat file into Mathematica and making a list plot. I need to know: a)How to sort the words out of my data? I used to use AllNumeric but that went away with version 6
b)How to switch the axis on my graph? My data is coming in as a pair sequence {1#`,2#`} but I need it to be {2#`,1#`} Or I need to know how to rotate my plotting sequence so it will flip.


This is the code I am using

data=Import["Test2.dat","Data"];
b=Drop[data,5]; %This just removes the header from my data file
ListPlot
 
Physics news on Phys.org
Try this:
Code:
data=Import["Test2.dat","Data"];
b=Reverse[Drop[data,5],2];
ListPlot[b]
 
Thanks!
 
Does you know how to sort words out of data? I have lists of data combined into one sheet and need to remove the column headings out of the data before it is plotted.
 
Can you post an example in more detail?
 
It has two columns of that are combined lists of test data. Every so often there will be titles and headings inserted into the two columns and I need to delete these in order to use the ListPlot command.

Unfortunately I cannot upload it in a large section so there is just the start of it attached.

Thank you for all of your help
 

Attachments

Similar threads

Back
Top