Any way to extract data from contour plots using paraView?
Hi all,
I have a newbie question about how to extract x, y coordinates of interpolation points on a contour and their interpolated field values by using paraView? Thanks. Angela:) |
after contour
choose : Filters -> Data analysis -> integrate Variables then a new window will open, then in "showing" tab , choose "contour" if you want to save data in ".csv" you can choose : file -> save data |
Quote:
|
I have also exported my contour data and the export seems fine. However, I plan to plot the contour with tikz.
It seems that the contour data is highly unsorted. Thus, the tikz plots don't look like they should. Is there any way to pre-sort the contour lines before exporting or do I have to manually piece the points together? Cheers Alex |
Quote:
Thanks |
1 Attachment(s)
Quote:
Hey, what's up? yes, I have managed to sort the contours by coding an octave file that reads in all the unsorted contours and builds a matrix that compares the vector length difference of all points to the current and reconstructs the contours. You might have to do a little tweaking depending on your columns of the .csv output file. This code currently sorts velocity contours I think. You can possibly also run this in matlab although I am not sure if matlab recognizes all the octave syntax correctly. Proof picture below so you know what it actually looks like afterwards in tikz (or gnuplot, whatever) Code:
#!/usr/bin/octave -qf |
Quote:
Thanks for the code! I have been searching yesterday and trying to tackle with a matlab code 'points2contour', which I found in mathworks website. I will try to modify your code as per my data and let you know the results. Also, I use octave, not comfortable with matlab. :) Your reply and willingness to help is really appreciated. Thanks |
Quote:
Cheers |
1 Attachment(s)
Quote:
Thanks for the detailed info. I have used the code without much modifications, though I faced some minor issues. I noticed that an iso-contour from paraview bears not exactly same contour values, minor deviations in the order of 0.001 were present. So, I had to re-export the data from paraview with precision set to 4, and thus able to sort most of the contours. Still,some repetitions and random jumps were there. But, I managed to edit the output file manually without much headache. Please see the figure attached. Thanks again for the help! Jabir |
Quote:
looks good so far :) some minor manipulation of the output was also necessary for me. Instead of lowering the output resolution you could have also put in another threshold for the p value in form of changing: Code:
do Code:
do Best wishes for the rest of your project Alex |
Quote:
That's a cool idea to give some tolerance to the contour magnitude. I will definitely try this next time. Thanks for your help. I really appreciate it. :) Jabir |
All times are GMT -4. The time now is 18:26. |