2D Contour plot with multiple files
Mostrar comentarios más antiguos
hello, i have a list of data files. like 50-60 basically representing CAD. each files consists of columns of different variables. among which one is "x" which represents radius and the other one is mass fraction of "Hiroy SOOT". the latter quantity changes in each file. I want to make a contour plot of Hiroysoot mass. (can be calculated for each col file by multiplying Hiroy soot column with MASS column). X-axis being CAD progression, y-axis being the radius with accumulated hiroy soot plotted as a contour. Basicallly the accumulated soot at each CAD along radius. The files are attached below.
any idea will be appreciated.
7 comentarios
KSSV
el 12 de Nov. de 2022
It looks like you have 3D data. You want to plot contour for 3D data?
Usama Bin Khalid
el 12 de Nov. de 2022
Below i tried to plot the points listed in the files by using the x,y and z values. However, at first glance there are not enough data points to cover a full grid.
You will need to provide more information about the data... Try to avoid technical nomenclature (for me CAD means computer aided design, in your questions it likley means something else).
% unzip the file
Files = unzip("https://nl.mathworks.com/matlabcentral/answers/uploaded_files/1190023/output.zip");
for i = 1:length(Files)
% read the current file
currFile = readtable(Files{i},'FileType','text');
% plot the locations of the data points (i.e. x,y and z values in the file)
figure(i)
scatter3(currFile.x,currFile.y,currFile.z)
axis equal
grid on
view(3)
title("Data points for "+Files{i})
end
Usama Bin Khalid
el 12 de Nov. de 2022
If I understand it, this is part of combustion analysis in engine design. CAD would refer to crank angle in degrees. So we're looking at byproduct formation over a range of timings? I don't know if that's an accurate interpretation or if it's helpful either way.
I'm not really sure how it's intended to be plotted, and I'm not really sure we're talking about the same things. A lot of people say "contour" when they mean something more analgous to a heatmap. A contour map takes a (e.g.) surface and reduces it to a series of isolines. Extending that one dimension higher gets cumbersome to visualize. It's either going to be a series of nested isosurfaces (which will tend to obscure each other), or it will be sliced on one dimension and represented as stacked isoline plots (see contour3).
On the other hand, If you want your data visualized as a smooth colored map (as in the one 2D plot you showed) that's not a contour map. It might still be cumbersome to visualize, but we'd need to know what we're trying to do in order to work in the right direction.
That said, what I see is a sequence of multiple 3D maps that need to be combined into one visualization. I'm not really sure how you want to do that. Obviously plotting all 4 dimensions is out, but it could be sliced or permuted such that it could be represented as a series of 2D or 3D plots of some sort.
Usama Bin Khalid
el 12 de Nov. de 2022
Usama Bin Khalid
el 15 de Nov. de 2022
Editada: Usama Bin Khalid
el 15 de Nov. de 2022
Respuestas (0)
Categorías
Más información sobre Image Arithmetic en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




