1
votes

I'm programming in MATLAB. I've got a data set which is reduced in dimensions and I want to plot a it like the figure below:

enter image description here

This image is produced by python but I think there must be a way to plot it in MATLAB.

Is there a switch for plot or plot3 to make each point a shape like the image above?

I'll be thankful for your answers...

3

3 Answers

4
votes

Is this close to what you need?

x = rand(1,1000);
y = rand(1,1000);
j = jet(1000);
scatter(x,y,10,j(ceil(x*1000),:),'filled','MarkerEdgeColor','k')

enter image description here

1
votes

You can specify lineseries properties to get the look you want. Example:

figure
plot(rand(1,1e3), rand(1,1e3), 'o', ...
    'MarkerFaceColor', 'g', 'MarkerEdgeColor', 'k')

Example plot

0
votes

The usual way would be to make a 3d scatterplot. It will plot your points as flat markers. If you want spheres, you can write a small script to do that. Check http://www.mathworks.ch/ch/help/matlab/ref/sphere.html