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

Click For Summary

Discussion Overview

The discussion focuses on how to sort and manipulate data for list plotting in Mathematica, specifically addressing issues related to importing data, removing unwanted headings, and adjusting the axes of plots. The scope includes practical coding solutions and data preparation techniques.

Discussion Character

  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant seeks guidance on sorting words out of their data and switching the axes in a ListPlot, mentioning the use of AllNumeric in previous versions of Mathematica.
  • Another participant suggests using the Reverse function to switch the order of the data after dropping the header, providing a code snippet as a solution.
  • A later post requests clarification on how to sort out column headings from combined lists of test data before plotting.
  • Another participant asks for a more detailed example to better understand the issue at hand.
  • One participant explains that their data includes titles and headings that need to be removed for proper plotting, indicating a challenge with the data structure.

Areas of Agreement / Disagreement

Participants are engaged in a collaborative problem-solving effort, with some providing solutions while others seek further clarification. There is no consensus on a single method for sorting out words or handling the data structure, indicating ongoing exploration of the topic.

Contextual Notes

Participants mention issues with data structure and the presence of headings, but the specific methods for addressing these issues remain unresolved. There are also limitations in the provided examples, as not all details of the data format are shared.

Who May Find This Useful

This discussion may be useful for Mathematica users dealing with data importation and manipulation, particularly those facing challenges with data formatting and plotting.

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

Replies
7
Views
3K
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K