0
$\begingroup$

I'm trying to perform a simple task: export data into a '.dat' file, then importing that file onto Mathematica on another terminal, and then plotting the list. But I keep getting the same blank plot!

For example, my export command looks like:

Export["Data1.dat",Data1,"Table"]

Then I use:

DATA = Import["Data1.dat", "Table"];

x = DATA[[All, 1]];
y = DATA[[All, 2]];

data = Transpose[{x, y}];

ListPlot[data, Mesh -> All]

Is there a subtlety in what I export?

$\endgroup$
3
  • $\begingroup$ Here is the link to the Data1 file: 1drv.ms/u/s!Ak_7kWMZ0x15g8Zi6V2XjeE5VCNQOQ?e=wrmoyO $\endgroup$
    – j.foobles
    Commented Sep 27, 2019 at 9:46
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Dunlop
    Commented Sep 27, 2019 at 11:13
  • $\begingroup$ Maybe try restarting with a new Kernel? Another thing you can try is to create a small table of data with the same shape as your large data file and check to see if the format is correct. $\endgroup$
    – Dunlop
    Commented Sep 27, 2019 at 11:13

1 Answer 1

1
$\begingroup$

Numbers in your file are written as strings.

data = Import["Data1.dat", "Table"];

ListPlot[ToExpression@data, PlotRange -> All]

$\endgroup$
1
  • $\begingroup$ Thank you! I knew it had to be a simple solution. $\endgroup$
    – j.foobles
    Commented Sep 27, 2019 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.