# Use Show to combine numerous plots?

Posted 6 months ago
829 Views
|
6 Replies
|
1 Total Likes
|
 I've a list of around 2000 ParametricPlot3D plots to be plotted together, using "Show". Around 10 is OK (see the plot with 10 small cones on the hemisphere), but with 50 or more, Mathematica stops the computation prematurely with a "pffft", un-defining all plots and functions (whose names go from black to blue) and returning nothing.This is not the first time I've run into this. Can you guess why this might be happening and suggest a way around the impasse? Attachments:
6 Replies
Sort By:
Posted 6 months ago
 The symptoms are of a Kernel crash. Maybe it runs out of memory. What is the combined size of the 2000 plots?
Posted 6 months ago
 The exported combined plot of 10 plots is 260Kb (pdf). There should be memory available. As far as I know, this type of crashing is random, i.e. it would happen every once in a while with 10 plots combined, and it happens almost all the time with 100 plots. One possibility is to make one plot comprise the data from 200 plots: a mountain range instead of individual peaks. I think I'll need to make extensions connecting them them.Thanks Gianluca,David
Posted 6 months ago
 Here's an idea: maybe you can combine the plots in small batches. So instead of doing something like combinedPlot = Show @@ listOfFigures you could instead do something more along the line of: combinedPlot = Fold[Show, First[listOfFigures], Rest[First[listOfFigures]]] This way, Mathematica never has to combine lost of graphics at once. If this Fold is slow, you could try to partition your listOfFigures and accumulate the figure in batches.
Posted 6 months ago
 Thanks, Sjoerd.I tried making one plot comprising the features of 20 plots. Mathematica quit, as before.Maple combined 180 of these plots in a matter of seconds (the "ring" below the top level consists of 180 cones).Best fromDavid Attachments:
 Ok, here are some more things to try: Combine the plots with Show, but suppress the output with a semicolon. If this crashes the kernel, we know for sure that this problem occurs in the kernel and not the front end. Do a ByteCount of your listOfFigures (or however you have assembled the individual plots). It's good to know what kind of memory size (in the kernel) we're talking about here. Try generating the ParametricPlot3D plots with less fidelity. Whenever I have problems with plots, I usually set the options PlotPoints -> n and MaxRecursion -> 0 (or 1) and play around with n until I get something reasonable. PerformanceGoal -> "Speed" is also something you can try. Are there any elements in your plots that use Opacity? Having semi-transparent elements in large 3D figures can give you a really large hit in performance.
 Perhaps you could post some code. Combining a lot of Sphere's works (15000) Show[Map[Graphics3D[{Hue@RandomReal[], Opacity@RandomReal[], Sphere[#]}] &, Table[RandomInteger[{1, 100}, {1, 3}], 15000]], ImageSize -> 500]