Skip to main content
Tweeted twitter.com/#!/StackMma/status/311199040324915200
Improved formatting ; removed extraneous remarks
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

render Transform 3D data into 2D colormapcolor map like matlabMatlab's surf/imagesc

I have a bunch of 3D data (x, y coordinates and values) which is generated in Matlab and I need to render them in a 2D color map with certain axis ranges. Here are the Matlab code and the generated figure.

rho = linspace(0, 80, 100);
phi = linspace(0, 2*pi, 100);
[PHI,RHO] = meshgrid(phi, rho);
dat = rand(size(PHI)); % data was generated in cylindrical coordinate
[x, y] = pol2cart(PHI, RHO);
surf(x, y, data,'edgecolor','none'); shading interp;
view(0, 90);
axis equal; axis off;
xlim([-50, 50]); ylim([-50, 50])
save('data.mat', 'x', 'y', 'dat')

render 3d data into a 2d colormap

In Mathematica, I imported these data {x,y,dat}=Import["data.mat", "MAT"],by evaluating

{x, y, dat} = Import["data.mat", "MAT"]

but I have no idea how to render them as shown above. I tried ListPlot3D[{x,y,dat}].

ListPlot3D[{x, y, dat}]

It gave a 3D pattern andbut was extremely slow because I have a big numberlot of data (which is not 100x100 indeed). Matlab surf is very fast though. Could anyone give me a hint to tackle this problem?

render 3D data into 2D colormap like matlab surf/imagesc

I have a bunch of 3D data (x, y coordinates and values) which is generated in Matlab and I need to render them in a 2D color map with certain axis ranges. Here are the Matlab code and the generated figure.

rho = linspace(0, 80, 100);
phi = linspace(0, 2*pi, 100);
[PHI,RHO] = meshgrid(phi, rho);
dat = rand(size(PHI)); % data was generated in cylindrical coordinate
[x, y] = pol2cart(PHI, RHO);
surf(x, y, data,'edgecolor','none'); shading interp;
view(0, 90);
axis equal; axis off;
xlim([-50, 50]); ylim([-50, 50])
save('data.mat', 'x', 'y', 'dat')

render 3d data into a 2d colormap

In Mathematica, I imported these data {x,y,dat}=Import["data.mat", "MAT"], but I have no idea how to render them as shown above. I tried ListPlot3D[{x,y,dat}]. It gave a 3D pattern and was extremely slow because I have a big number of data (which is not 100x100 indeed). Matlab surf is very fast though. Could anyone give me a hint to tackle this problem?

Transform 3D data into 2D color map like Matlab's surf/imagesc

I have a bunch of 3D data (x, y coordinates and values) which is generated in Matlab and I need to render them in a 2D color map with certain axis ranges. Here are the Matlab code and the generated figure.

rho = linspace(0, 80, 100);
phi = linspace(0, 2*pi, 100);
[PHI,RHO] = meshgrid(phi, rho);
dat = rand(size(PHI)); % data was generated in cylindrical coordinate
[x, y] = pol2cart(PHI, RHO);
surf(x, y, data,'edgecolor','none'); shading interp;
view(0, 90);
axis equal; axis off;
xlim([-50, 50]); ylim([-50, 50])
save('data.mat', 'x', 'y', 'dat')

render 3d data into a 2d colormap

In Mathematica, I imported these data by evaluating

{x, y, dat} = Import["data.mat", "MAT"]

but I have no idea how to render them as shown above. I tried

ListPlot3D[{x, y, dat}]

It gave a 3D pattern but was extremely slow because I have a lot of data. Could anyone give me a hint to tackle this problem?

Source Link
Tony Dong
  • 899
  • 9
  • 18

render 3D data into 2D colormap like matlab surf/imagesc

I have a bunch of 3D data (x, y coordinates and values) which is generated in Matlab and I need to render them in a 2D color map with certain axis ranges. Here are the Matlab code and the generated figure.

rho = linspace(0, 80, 100);
phi = linspace(0, 2*pi, 100);
[PHI,RHO] = meshgrid(phi, rho);
dat = rand(size(PHI)); % data was generated in cylindrical coordinate
[x, y] = pol2cart(PHI, RHO);
surf(x, y, data,'edgecolor','none'); shading interp;
view(0, 90);
axis equal; axis off;
xlim([-50, 50]); ylim([-50, 50])
save('data.mat', 'x', 'y', 'dat')

render 3d data into a 2d colormap

In Mathematica, I imported these data {x,y,dat}=Import["data.mat", "MAT"], but I have no idea how to render them as shown above. I tried ListPlot3D[{x,y,dat}]. It gave a 3D pattern and was extremely slow because I have a big number of data (which is not 100x100 indeed). Matlab surf is very fast though. Could anyone give me a hint to tackle this problem?