Mystery solved! There was a stray "hold off" earlier in the code that didn't affect any figures except for this one. Why it didn't affect the other figures is equally mysterious to me, but I'm glad it works now!
Using "hold all" and "hold on" for a 3D scatterplot
49 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yasmeen
el 14 de En. de 2014
Comentada: Walter Roberson
el 15 de En. de 2014
I am making a large number of figures proceeded by a for loop. Every iteration of the for loop adds a plot layer on top of each figure.
Using "hold all" and calling the figure axes works for all of these scatterplots except for one, which is a 3D scatterplot (made using scatter3). This figure displays only the information from the last iteration.
Is there a reason why scatter3 wouldn't have the same hold properties as scatter, and if so, how can I make the plots hold? Thanks!
0 comentarios
Respuesta aceptada
Yasmeen
el 15 de En. de 2014
1 comentario
Walter Roberson
el 15 de En. de 2014
"hold off" without an axes specification only applies to the "current axes" of the time.
Más respuestas (1)
Walter Roberson
el 14 de En. de 2014
If you are using
scatter2(...)
hold on
scatter3(...)
then the 2D view from the scatter2() is held, so the scatter3() that goes on top of it appears to give a 2D result. If you rotate the view after the scatter3() then you can see the points in their proper respective positions.
scatter(rand(1,10),rand(1,10))
hold on
scatter3(rand(1,10),rand(1,10),rand(1,10))
Now click on the rotate tool in the toolbar and rotate out of plane; the blue 2D points will show up all at z = 0 as expected.
2 comentarios
Walter Roberson
el 15 de En. de 2014
The obvious supposition would be that you do not have "hold on" applied on axis a14.
hold(a14, 'on')
Ver también
Categorías
Más información sobre Scatter Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!