Density of XY scatter plots

Have a suggestion for improving DPlot or a question about existing features? Let us know

Moderator: DPlotAdmin

Post Reply
richpauir
Posts: 37
Joined: Wed Feb 21, 2007 1:33 pm
Location: College Station, Texas

Density of XY scatter plots

Post 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...

Image
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post 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.
Visualize Your Data
support@dplot.com
richpauir
Posts: 37
Joined: Wed Feb 21, 2007 1:33 pm
Location: College Station, Texas

Post 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.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post 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 :-)
Visualize Your Data
support@dplot.com
richpauir
Posts: 37
Joined: Wed Feb 21, 2007 1:33 pm
Location: College Station, Texas

Post 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.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post 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.
Visualize Your Data
support@dplot.com
richpauir
Posts: 37
Joined: Wed Feb 21, 2007 1:33 pm
Location: College Station, Texas

Post by richpauir »

David, thanks for putting it on the To-Do list. :D
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post 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.


Image
Visualize Your Data
support@dplot.com
richpauir
Posts: 37
Joined: Wed Feb 21, 2007 1:33 pm
Location: College Station, Texas

Post 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!


Image
Post Reply