Density Plot

The view can be accessed either via the “Open view” action on the executed node or on KNIME Hub.
In the node configuration, you can enable certain controls, which are then available in the view. This includes the ability to choose a dimension column and a condition column or the possibility to set a title.
The configuration also offers a preview of the view, which should help to get the density plot in the desired shape quickly.

Missing as well as NaN (not a number) values in the dimension column are ignored. If a condition column is chosen, a category is ignored when all corresponding cells in the dimension column are ignored. The density is computed via kernel density estimation with a gaussian kernel. The bandwidth for the kernel can either be set to a specific value or computed with Scott's rule of thumb (see R's bw.nrd).

Options

Dimension column
Select the column with numerical values for which you wish to plot a density. Note: Missing and NaN (not a number) values will be ignored.
Condition column
Select the column with respect to which you want to plot conditional densities. The values of the selected column are treated as categories. Note: Also missing values are treated as a separate category.
Title
The title of the graph shown above the generated image. If left blank, no title will be shown.
Kernel bandwidth
The bandwidth of the gaussian kernel used for the density estimation can be configured here. If “Rule of thumb” is selected, the bandwidth is computed with bw = 1.06 * min(std, IQR/1.34) * n^(-1/5), where std is the sample standard deviation, IQR is the interquartile range and n is the number of observations (see R's bw.nrd). Alternatively, it is possible to set a fixed kernel bandwidth.
Adjustment factor
The kernel bandwidth computed by the rule of thumb is multiplied by this adjustment factor. Setting the adjustment factor is only possible if the kernel bandwidth is selected as “Rule of thumb”. The larger this value is the smoother the curve in the plot.
Custom bandwidth
Choose the bandwidth of the gaussian kernel. Setting the custom bandwidth is only possible if the kernel bandwidth is selected as “Fixed”. The larger this value is the smoother the curve in the plot.
Dimension axis limits
Choose if the dimension axis range should be calculated automatically, taken from the domain range or set manually. If “Automatic” is selected the axis ranges from (min - 3 * bw) to (max + 3 * bw) where min and max are the minimum and maximum values of the data and bw is the selected bandwidth. If you select “Domain bounds”, you might need to use a Domain calculator or Edit Numeric Domain node before this node.
Horizontal min
Value that sets the horizontal axis minimum.
Horizontal max
Value that sets the horizontal axis maximum.
Custom dimension axis label
The label used for the horizontal dimension axis. If the checkbox is deactivated, the label will correspond to the selected dimension. If activated and left blank, no label will be shown.
Density axis label
The label used for the vertical value axis. If left blank, no label will be shown.
Line thickness
Numeric value that defines the line size.
Fill area
When checked, the area under the curve is filled. This setting is only available when there is no condition column selected.
Display legend
When checked, the chart’s legend containing the categories of the condition column is displayed.
Enable image download
When checked, an image of the chart can be downloaded by clicking the image download button in the view.
Show tooltip
When checked, hovering over a box will show information about the data.
Enable animation
When checked, the animation of the graph is active.
Generate image
If checked, adds an image output port and, upon execution, generates an image which is made available via this port.
Image type (SVG, PNG)
Choose between the superior quality provided by SVG vector graphics and the better performance of the PNG raster images. SVG graphics are sharp, also when zoomed, and text labels within the graphic can be searched for. On the other hand, PNG images can be smaller and render faster when there are many data points, for example, in a scatter plot.
Width
The width of the generated image (in pixels).
Height
The height of the generated image (in pixels).

Input Ports

Icon
Data table containing the dimension and condition column to be plotted in a density plot.

Output Ports

Icon
Rendered PNG image.

Views

Density Plot
A density plot visualization of the input data.

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.