Why are there often black grids superimposed on 2-D scatterplots in ENVI?
Note: This help article applies only to Classic ENVI, and not to the new interface that was introduced with ENVI 5.
Many ENVI users have noticed that when they display a 2-D Scatterplot in ENVI using the tool available from the display menu under Interactive Tools -> 2-D Scatterplot, the scatterplot often appears to have a black grid superimposed on the data cloud.
ENVI’s 2-D scatterplots are always displayed in an IDL plot window that is sized such that the scatterplot axes are 256 pixels long (in this case the term pixel is referring to one element on your video monitor - a 'screen pixel' - rather than a 'data pixel' that refers to an image). This allows for each screen pixel in the plot window to represent one of 256 different data values. However, the data ranges assigned to the x and y axes of the scatterplot are automatically set to the data’s maximum and minimum values, essentially stretching out the data plotted on each axis. If the range of the data being scatterplotted is less than 256 then there will be some blank space in the scatterplot because of this stretching of the data range. For example if you have data values from 0 to 127 then every other screen pixel in the plot window would show a "gap", making a horizontal or vertical line across the scatterplot. If you have data values from 0 to 64 then you get 3 gaps between each data point.
This black grid that results from screen pixels being used as spacers between data points will usually happen only with byte or integer data. For floating point data, the image data being scatterplotted must be histogram binned first before being plotted. Thus, it would be the number of histogram bins that will determine if spacers will be necessary (and usually at least 256 bins are used regardless of the data range).
Try this:
1. Create a 256 x 256 test image using File -> Generate Test Data which is a horizontal ramp of byte data with values from 0 to 255.
2. Create a 256 x 256 test image which is a vertical ramp of byte data with values from 0 to 255.
3. Plot a 2-D Scatterplot with the two test images as the input x and y bands. The scatterplot should not show gaps (a black grid superimposed on it).
Next, try this:
1. Create a 256 x 256 test image which is a horizontal ramp of byte data with values from 0 to 64.
2. Create a 256 x 256 test image which is a vertical ramp of byte data with values from 0 to 64.
3. Plot a 2-D Scatterplot with the two new test images as the input x and y bands. The scatterplot should show gaps in the x and y direction (a black grid) because the data only have 65 possible values, but the plot has 256 possible places to show values.
Finally, try this:
1. Plot a 2-D Scatterplot with the horizontal ramp image with values between 0 and 255, and the vertical test image with values between 0 and 64 as the input x and y bands. The scatterplot should show gaps only in the x direction.