subdivide the axis into a grid without using subplot
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hey Guys, I have 100 patch objects, p1,p2,..p100 [for eg. p1=sphere(1), p2=sphere(2) .. p(100)=sphere(100)]
I want to visualize these 100 objects simultaneously. As a starting point, I use the subplot using which I obtain 100 axes and I can render 1 patch object in each axis, as follows:
for i=1:100, p=subplot(10,10,i); sphere(i); end
This clearly gets very graphically exhausting for matlab. I would like to subdivide a single axis into 100 components and position each object into one position. I have a possible line of thought, set(gca,'position',....) but I'm unclear if there is a better solution than gluing an object to a predefined position. Any Ideas or Files out there that anyone may be aware of, I'd appreciate it.
Thanks
0 comentarios
Respuestas (3)
Matt Fig
el 23 de Abr. de 2011
Are you certain that your patch objects wouldn't just stack and obscure each other? In your example (assuming appropriate adjustments were made), the only patch you would see is the last one because all spheres are unit spheres.
Could you give a better example of what you are trying to do?
%
%
%
%
EDIT In response to your comments below...
Every plotted object has x and y coordinates, right? So simply find the largest object (xmax-xmin and ymax-ymin) then make your grid larger than this. Next at each grid node to the xdata and ydata of the objects. For example, say you want to plot 3 circles of diameter 5,2,1 and each has origin as center. Then simply use a grid of 10 (or some number) to add to the xdata of the largest circle so its center is at (10,0). Then at 5 to the xdata of the second largest circle so its center is at (5,0). Then you can keep the smallest circle at the origin or move it over.
Do the same for the y coordinate to arrange your objects in a grid....
2 comentarios
Matt Fig
el 23 de Abr. de 2011
I am not sure how much this will actually help MATLAB. But why not try it and see? Just call patch in the loop and see what happens... You subdivide by simply centering your patch objects on a grid.
Jiro Doke
el 23 de Abr. de 2011
Why don't you simply keep creating the patch object in a loop, without creating multiple axes. As long as the coordinates of the objects don't overlap, then you'll have them all in one axes.
0 comentarios
Ver también
Categorías
Más información sobre Graphics Performance 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!