Page 1 of 1
Density of XY scatter plots
Posted: Sun Jun 15, 2008 1:45 pm
by richpauir
Is there a way to create a colored density background for a XY scatter plot?
For example, I'd like to be able to convey the amount of clustering of data points that overlay or are proximal to each other in a scatter plot such as this...

Posted: Sun Jun 15, 2008 2:10 pm
by DPlotAdmin
No, sorry. There isn't, but it's something to think about for a future release. What I'm imagining would only have meaning if the X and Y axes were in the same units. If they are then the input would be "how many points are within <radius> units". One technical hurdle to overcome would be determining at what points within the plot that question needs to be answered. Off the top of my head the answer is "all of them" - all pixels/printer dots, that is, but I'd think this would be way, way slow.
I'll give it some thought but this one may take a while to figure out and implement.
Posted: Sun Jun 15, 2008 3:08 pm
by richpauir
One simple solution might be to allow the user to define opacity for the data point symbols. A choice of large symbol size, no symbol border and moderate symbol opacity would create a type of density plot. The more points near each other, the more their symbols would overlap and create a darker shade.
Posted: Sun Jun 15, 2008 3:31 pm
by DPlotAdmin
That's an excellent suggestion, thanks. It precludes users with 256-color displays from using that feature, but I'm been trying to cull them out for a while anyway

Posted: Sat Nov 01, 2008 11:57 am
by richpauir
Just wondering if symbol opacity might be a useful feature for others.
I've got a need again for showing density of a scatter plot.
Posted: Sat Nov 01, 2008 12:14 pm
by DPlotAdmin
No idea, but I appreciate you posting again. This one had slipped my mind, but it's on my to-do list now where I can't ignore it.
One downside to transparency is this will pretty much eliminate the option to save/copy to a metafile. There's no such thing as a semi-transparent graphic primitive in metafile lingo, so the symbols will have to be drawn pixel-by-pixel. Since metafiles have such a high resolution, the resulting metafile would be huge... and not work particularly well in any case, since the whole point of metafiles is that they're very scalable. But for the display, saved bitmap images, and prints it should work very well.
Posted: Sat Nov 01, 2008 12:25 pm
by richpauir
David, thanks for putting it on the To-Do list.

Posted: Sun Nov 02, 2008 3:50 pm
by DPlotAdmin
For anybody else following this thread, below is an example of what Rich is talking about. Needs a lot of testing yet, but this will be in the next release.

Posted: Tue Nov 04, 2008 3:01 pm
by richpauir
Some pretty cool plots can be created by tweaking the opacity, colors, and symbol sizes.
Thanks David for taking time to add this feature to DPlot!
