MARK A POINT ON A 3D PLOT

Please, I plotted my x,y,z combinations as shown in the figure below. The x,y,z combination is 636,056 (data size). My optimal x,y,z point is highlighted with red. However, the highlighted POINT is not SHOWING ON THE 3D PLOT. I guess this is due to the data size. Becuause, when I tried with few data size, it appears perfectly. Please, how do I solve this problem with my large data size. I want my plot to look similar to this Figure. Thank you.

8 commentaires

Habeeb
Habeeb le 22 Mar 2021
Here is my MATLAB Code
plot3(x0Grid(:,1),x0Grid(:,2),x0Grid(:,3));
hold on
plot3(x0Grid(idx),x0Grid(idx),x0Grid(idx),'ro','MarkerFaceColor','red','MarkerEdgeColor','red','MarkerIndices',10);
dpb
dpb le 22 Mar 2021
You've drawn a 3D scatter(?) plot; the other image is 2D surface.
You've got data in the cubic space that is essentially solid with the number of points and the axes size and undoubtedly the location of the maximum is somewhere in the middle and so is occluded.
You could try setting the MarkerEdgeAlpha and MarkerFaceAlpha properties to something less than 1 (the default) to see if that will let the other point show through.
Habeeb
Habeeb le 22 Mar 2021
Hi dpb. I did as you suggested. Even thought the ploted data appears faded from the legend. However, due to the size of the ploted data, it still occludes the Optimal Point. Please see attahced.
dpb
dpb le 22 Mar 2021
What did you set alpha to? Doesn't look very much less...try 0.1 and see what happens.
You can't see through a solid wall, it takes a window glass--same thing here; the data points are bricks.
I don't know anyway you will be able to have a point buried in the middle to show up -- oh!
Show us the code -- how are you putting the highlight on the one point?
You possibly could plot the point last and then have it on top layer instead...
Habeeb
Habeeb le 22 Mar 2021
I used 0.2
Here is the code.
h = scatter3(x0Grid(:,1),x0Grid(:,2),x0Grid(:,3));
hold on
scatter3(Optimal_k(:,1),Optimal_k(:,2),Optimal_k(:,3),'MarkerFaceColor','r','MarkerEdgeColor','k');
h.MarkerFaceAlpha = .2;
h.MarkerEdgeAlpha = .2;
Habeeb
Habeeb le 22 Mar 2021
Here is the code and result with MarkerFaceAlpha = 0.1
>> h = scatter3(x0Grid(:,1),x0Grid(:,2),x0Grid(:,3));
hold on
scatter3(Optimal_k(:,1),Optimal_k(:,2),Optimal_k(:,3),'MarkerFaceColor','r','MarkerEdgeColor','k');
h.MarkerFaceAlpha = .1;
h.MarkerEdgeAlpha = .1;
dpb
dpb le 23 Mar 2021
So, you can begin to see the dot...try 0.01.
Where's the code to write the max point in the above?
What's the point of plotting so many points as to make just a solid cube, anyways?
Habeeb
Habeeb le 23 Mar 2021
Modifié(e) : darova le 24 Mar 2021
It works now with the 0.01 . Please, see code below and the attached. Many thansk, dpb. regards.
h = scatter3(x0Grid(:,1),x0Grid(:,2),x0Grid(:,3));
hold on
scatter3(Optimal_k(:,1),Optimal_k(:,2),Optimal_k(:,3),'MarkerFaceColor','r','MarkerEdgeColor','r');
h.MarkerFaceAlpha = .01;
h.MarkerEdgeAlpha = .01;

Connectez-vous pour commenter.

Réponses (0)

Question posée :

le 22 Mar 2021

Modifié(e) :

le 24 Mar 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by