CSV Files in Paraview - paraview

I've been following Paraview's documentation for loading in csv files. I have one loaded in and ready to use, but i'm not entirely happy with the processes they've suggested. As both apply to dots and apply to grid points are both pretty ugly...
I'm using the dataset 'Sally', which as my lecturer suggested is apparently pretty well known (looks like a tornado or something). The dot layout of the data make it look like a tornado, but all the dots are set to one colour... How can i map different colours to different layers of the data?
Thank you

Here is how to Open your csv file in ParaView and load it as a Geometry.
File -> Open -> Select your csv file -> Apply
Filters -> Tables To Points -> Set X, Y and Z -> Apply
You know have a polydata with a lot of points. If you want to have coloring based on a parameters, you have to compute some data on the dataset, as your csv file does not seem to contain any.
For example :
Filters -> Elevation -> Z axis -> Apply
Can be what your are looking for.

Related

How to get nodal values in OpenFOAM?

I would appreciate knowing how I can convert the cell values given after the OpenFOAM solution into the ones on the grid points. Is there any direct command for such a thing or I should work with the sampling option?
Thanks a lot for your help.
When you open your case using Paraview/paraFoam, then the interpolated fields at the points (nodes) are already computed by Paraview:
Fields with an orange small circle are the point data, while the fields that have an orange cube icon are the data at the cell centers, i.e:
You can also see the values of the fields (points or cell) using the Spreadsheet view and export them as CSV:

How to visual a 3D bathymetry data in Paraview

I want to display a 3D bathymetry data in paraview, the file datatype is netcdf:
it has two dimensions and three variables;
my netcdf file format
When I try to open it in paraview: it is a 2D not 3D,
2D
I want to display Dlike this:
3D
i’m sorry for bad English and less infomation.
The most simple way to do that is to use the Extrusion Surface representation.
https://blog.kitware.com/a-new-embossing-representations-plugin-for-paraview/
Open ParaView
Tools -> Manage Plugins -> Embossing Representations
Create a new view
Open your file
Switch representation to Extrusion Surface
Only Available since ParaView 5.6.0. Keep in mind this is only a representation, not a change to the actual data. If you want to change the data, you will have to use CellDataToPointData and WarpByScalar, which will require more tweaking.

Visaulize several .vtk files together in Paraview

I am running some simulations on Matlab and then passing them to Paraview using .vtk files. I would like to see all three .vtk files together in Paraview screen but it seems like I can visualise them only one by one, not together.
Anyone knows how to solve this?
Thanks in advance.
It's possible to visualize several .vtk files together in Paraview.
Just hit "Ctrl+O" and select the files you want to visualize.
After that you have to hit apply in any of the loaded files in order to update the pipeline.
Watch out for naming!
If you name your files like:
file1.vtk
file2.vtk
file3.vtk
They will be loaded as a TimeSeries and visualized as an animation. One at a timestep.
Hope it helped!
With ParaView 5.3, you can apply the Group TimeSteps filter, to group all the timesteps into a single multiblock dataset with each timestep added as a separate block.

How to draw several graphics in one picture in Mathematica?

Just like hold on in Matlab.
I met this problem when i want to draw several lines in one picture.
The number of lines varies.
Mathematica has a lot of constructs allowing you to combine plots, graphics and images.
I'll give you several examples. You can search the help system to find out more and understand the subtleties of the examples bellow:
Edit
If you want to read/write from/to files, the following code may serve you as a starting guide:
(*Create data*)
data = RandomReal[1, {8, 2}];
(*Put into a file*)
Export["c:\\test.tab", data, "Table"];
(*Read the file into another list*)
rdat = Import["c:\\test.tab", "Table"];
(*And Plot it like before*)
Graphics[{Line##, Red, PointSize[Large], Point /# #} &#rdat]
Mathematica 8 introduced a new versatile function Overlay, which can be used to graphically overlay any type of expression:
Overlay[{Graphics[{Yellow, Disk[]}], "Sun"}]
Use Show to combine graphics objects.
Show[Plot[Sin[x],{x,0,10}], Plot[Cos[x],{x,0,10}]]
EDIT If you want to draw several lines, then build your Graphics object out of several lines:
Graphics[ Table[ Line[{{0,0}, {Cos[x],Sin[x]}}], {x,0,Pi,Pi/10} ] ]
combine graphics primitives like Szabolcs said:
Graphics[ Table[ Line[{{0,0}, {Cos[x],Sin[x]}}], {x,0,Pi,Pi/10} ] ]
but if you are using plot then what you need to do is:
Show[Table[Plot[A Sin[x],{x,0,2 Pi}],{A,0.1,10}]]
Show command allows you to combine the graphics Table produces varying A, each one of them a Plot over x.

Using matlab to change the color of the polygons of a map from a shp file

My question is that how do I change the polygons of a map from shp file (shapefile) while using matlab. I was doing this project where i was given map in shpfile format that I need to use on, I am able to read the map in matlab but the map is divide in regions and each regions have its color, my problem I met was to change the polygons to its respective colors, anyone sees this please kindly help and reply me asap.
Are you using the Mapping Toolbox by The MathWorks, or third-party codes such as ones from the Shapefile C Library to import the shapefile? If you are using the Mapping Toolbox, I cannot be of much help here as I do not have that toolbox -- hopefully, someone else can help here.
In any case, if you could import the shapefile on to your MATLAB Workspace, you should be able to find the vector data (polygons and attributes data, etc.) somewhere...
If you do not see anything on the Workspace, possibly you can find those data in the Figure (or in the Axis).
data=get(the_handle);
I would look for the data there.
After you obtain the polygon and properties data, you can patch/fill them with any color you like (based on any other information you find there.)
Good Luck