Plots > XY Plots > Plotting Data > Example: Understanding Density Plots
  
Example: Understanding Density Plots
1. Define the initial number of data points.
Click to copy this expression
Click to copy this expression
2. Use the sin and rnd functions to define an array as a function of the data points.
Click to copy this expression
3. Plot the array of data points against the normalized x-axis.
Click to copy this expression
The visible gaps in the trace are due to the relatively low number of data points.
4. Define a larger number of data points.
Click to copy this expression
Click to copy this expression
5. Define and plot the new array of data points against the normalized x-axis.
Click to copy this expression
Click to copy this expression
There are far less visible gaps in the trace due to the relatively higher number of data points.
6. Define a much larger number of data points.
Click to copy this expression
Click to copy this expression
7. Define and plot the new array of data points against the normalized x-axis.
Click to copy this expression
Click to copy this expression
Since the number of data points is larger than 50000, the data is plotted using the density plot technique where data points with approximately equal values are mapped onto a single pixel. This mapping results in some pixels having one or more data points mapped onto them and other pixels having no data points mapped onto them. The latter pixels appear uncolored.
8. Compare the number of data points inside a small slice of the plot for all three plots.
Number of data points = 2000
Click to copy this expression
Number of data points = 40000
Click to copy this expression
Number of data points = 70000
Click to copy this expression
As the number of data points increases, more data points appear close to a neighboring data point and plotting such data points makes them appear on the plot as one point.
Since the rnd function is used in the definition of the three arrays, recalculate the worksheet and observe the changes in the above plots.