Message Boards Message Boards

Preprocess and visualize data from a texto.txt file?

Posted 8 years ago

The data are attached. How is wrong with the code? Is very important, I spend much time to make this code and I don't know what is wrong. I need help.

data=Import["texto.txt","Table"];

SetOptions[{ListContourPlot,ListPlot3D},ImageSize->300];

{ListContourPlot[data,
FrameStyle->Directive[Black,13],
ContourLines->True,
Contours->20,
AspectRatio->Full,
ColorFunction->"TemperatureMap",
FrameLabel->{"x","y"}],

ListPlot3D[data,
BaseStyle->{FontSize->14},
Mesh->None,
InterpolationOrder->3,
ColorFunction->"SouthwestColors",
BoxRatios->Automatic]}

enter image description here

Attachments:
POSTED BY: Carmen Gonzalez

The code isn't wrong, the data must be preprocessed: texto.txt needs dots to make up numbers to Mathematica: 0.7 instead of 0,7:

enter image description here

Then it works - take into account that

In[44]:= Clear[data]
data = Import[FileNameJoin[{NotebookDirectory[], "test", "texto.txt"}], "Table"];

In[46]:= Dimensions[data]
Out[46]= {21, 29}

the dimension of data are 21 lists of the length 29: be sure that you want that. Notebook attached.

Attachments:
POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract