|
From: Daniel J S. <dan...@ie...> - 2006-06-14 22:43:42
|
Ethan Merritt wrote: > On Wednesday 14 June 2006 02:56 pm, Daniel J Sebald wrote: > >>Ethan Merritt wrote: >> >>>On Wednesday 14 June 2006 12:53 pm, you wrote: >>> >>>>Oh, it would be nice to speed up the palette assignment. Something >>>>just isn't right with those demos that use pm3d; takes forever, >>>>computer speaking. >>> >>>[shrug] I doubt that it matters for any real-world case. >> >>Well, the real issue is the reallocating of the palette >>unnecessarily. > > > I am not following you. The demo plots that 'take forever' are in > fact changing the palette with each plot. That is the point of the > demo, right? So these palette initializations *are* necessary. Half of pm3d.dem, yes. However, there are many plots where the palette is not change from the previous plot. An especially bad example is the last in pm3d.dem. In that demo are 8 separate plots, all of which use the same palette. Hit return on that plot and watch the "allocating colors..." message keep popping up. I added a few lines of fprintf's to show when PaletteMake is called and when the palette tests out to be the same. Here is the result for that particular plot: Plot by pm3d algorithm draws quadrangles filled with color calculated from the z- or color-value of the surrounding 4 corners. The following demo shows different color spots for a plot with very small number of quadrangles (here rectangular pixels). Note that the default option is 'mean'. make palette max_colors = 512 SAME PALETTE make palette max_colors = 512 SAME PALETTE make palette max_colors = 512 SAME PALETTE make palette max_colors = 512 SAME PALETTE make palette max_colors = 512 SAME PALETTE make palette max_colors = 512 SAME PALETTE make palette max_colors = 512 SAME PALETTE Hit return to continuemake palette max_colors = 512 SAME PALETTE |