I need an help with Mathematica 8

  • Context: Mathematica 
  • Thread starter Thread starter kurt1989
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

The discussion focuses on using Mathematica 8 to create a velocity contour map from a CSV file containing pixel coordinates and velocity values. The user is guided to utilize the Import function to read the CSV data and the ListContourPlot function to generate the plot. Specifically, the solution involves extracting the third column of velocity data, formatting it into a matrix using Partition, and then plotting it. If the data points are not in the correct order, sorting is recommended before plotting.

PREREQUISITES
  • Familiarity with Mathematica 8 syntax and functions
  • Understanding of CSV file structure and data importation
  • Knowledge of matrix manipulation in Mathematica
  • Basic concepts of contour plotting
NEXT STEPS
  • Research the Import function in Mathematica for various file types
  • Learn about ListContourPlot and its customization options
  • Explore Partition for data formatting and manipulation
  • Investigate ListInterpolation for handling incomplete datasets
USEFUL FOR

Data scientists, engineers, and researchers who need to visualize velocity data using Mathematica, particularly those working with CSV data formats.

kurt1989
Messages
1
Reaction score
0
Hello everybody!
I'm a new member and I don't know if it is the right section, but I have some problem with the software mathematica so I'm here hoping that someone can help me..

I have a csv file and I have to plot it, but I don't know which function I have to use. The csv file contains 3 columns:the first and the second are the coordinates x y in pixels and the third is the form of the velocity vector. I need to obtain a plot that gives me the velocity countur map.

Someone has an idea??

Thanks to everybody
 
Physics news on Phys.org
If your spreadsheet data is in the form of
1,1, 2
1,2, 5
1,3, 2
1,4, 7
2,1, 4
2,2, 5
2,3, 5
2,4, 6
3,1, 2
3,2, 3
3,3, 3
3,4, 4
where your x,y are in order with every point present and you have n pixels horizontally then

velocity=Partition[Import["yourfile.csv"][[All,3]],n];

which will extract your third column and format it into a rectangular matrix. Then

ListContourPlot[velocity]

should give you your velocity contour plot.

If you have all those points, but they are not in the correct order, then you might be able to sort your rows into order, then select the last column with [[All,3]] and then ListContourPlot the result.

If you don't have all those points and can't get them then I don't know what to tell you. You might be able to use ListInterpolation, but this is getting more and more complicated and I don't want to toss you in the deep end of the pool, yet.
 
Last edited:
Bill Simpson said:
If your spreadsheet data is in the form of
1,1, 2
1,2, 5
1,3, 2
1,4, 7
2,1, 4
2,2, 5
2,3, 5
2,4, 6
3,1, 2
3,2, 3
3,3, 3
3,4, 4
where your x,y are in order with every point present and you have n pixels horizontally then

velocity=Partition[Import["yourfile.csv"][[All,3]],n];

which will extract your third column and format it into a rectangular matrix. Then

ListContourPlot[velocity]

should give you your velocity contour plot.

If you have all those points, but they are not in the correct order, then you might be able to sort your rows into order, then select the last column with [[All,3]] and then ListContourPlot the result.

If you don't have all those points and can't get them then I don't know what to tell you. You might be able to use ListInterpolation, but this is getting more and more complicated and I don't want to toss you in the deep end of the pool, yet.
thanks for your help... :wink::wink::wink::wink:
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K