How to Create a Density Plot

Table of Contents

What is a Density Plot

A Density Plot offers an alternative view to a Histogram Chart. It is calculated in a similar way, but is is rendered with a semi-transparent Spline Area chart instead. If you show it together with a Histogram, the marker points should be more or less the same.

A Density Plot calculates and renders the statistical distribution of your values over a number of intervals, called bins or buckets. We use by default 20 buckets, but you may change this number and get a slightly different view.

Steps to Create a Density Plot

Start Visual Xtractor or Data Xtractor. Connect to a database. Create or design a SQL query. Run the query and check the results.

  1. Display and enable the Chart query builder.
  2. Select one numeric column as Point ChartsDensity Plot.

Density Plot Demo Query

Look for the ready-to-use Density Plot generated chart query under the Queries > Demo Queries > Charts > Cartesian Charts folder. Click on the “add demo queries” command link, to make sure it’s there.

The demo chart looks more complex, as it is a mixed chart, that we will present as final custom view later on. But is is very easy to start from scratch: just pass all values from any numeric data column you may have to a Density Plot selection.

Density Plot
You may change it anytime with a Histogram analogue selection. Better yet, mix them up together, with the Density Plot on the background, as the second series.

Customize your Density Plot

  1. Play with another number of bins/buckets, for a different view.
  2. Show different types of markers, and the data labels.
  3. Enhance the chart with a Scatter Bar below, on the exact same values.
  4. Switch to 3D eventually, for a nice interesting view.
  5. And you may further include a Histogram as well, on the exact same values.

Density Plot with Scatter Bar


  • Creating a Density Plot in Data Xtractor or Visual Xtractor is fast and immediate: just pass some numeric column values to a Density Plot chart type selection, nothing more.
  • Switch between a Density Plot and Histogram selection, for a different view.
  • Or mix your chart with a Histogram, on the same column values.
  • Or add a horizontal Scatter Bar rendered at the bottom, on the exact same values.
  • All builtin powerful features of these chart type are common to most other charts: filtering series through the legend items, interactivity, monochrome or grayscale colors, rich axis and data label selections etc.
  • Switch to another builtin chart theme, or customize your own, for any possible color or other styles.