density plot

From DavinciWiki
Jump to: navigation, search

Description

Create a two dimensional density plot or histogram

Arguments and Return Values

Arguments: Two numeric arrays (one for the x axis and one for the y axis)

Return Value: The binned data array

Usage

Syntax: density_plot(xdata,ydata [, xsize=FLOAT][, ysize=FLOAT][, ignorex=FLOAT][, ignorey=FLOAT],[, minx=FLOAT][, maxx=FLOAT][, miny=FLOAT][, maxy=FLOAT])

xdata = data for the x axis

ydata = data for the y axis

Note: xdata and ydata must have the same dimensions

Options:

xsize = output image x dimension (Default = 1500)

ysize = output image y dimension (Default = 1500)

ignorex = ignore value for the x data (Default = 0)

ignorey = ignore value for the y data (Default = 0)

minx = minimum x data value to be plotted (Default = minx-0.1*minx)

maxx = maximum x data value to be plotted (Default = maxx+0.1*maxx)

miny = minimum y data value to be plotted (Default = miny-0.1*miny)

maxy = maximum y data value to be plotted (Default = maxy+0.1*maxy)

Examples

Image data (below)

dv> data
600x600x3 array of byte, bip format [1,080,000 bytes]

Plot band 1 values vs band 2 values

dv> out=density_plot(data[,,1],data[,,2],xsize=200,ysize=200)
200x200x1 array of int, bsq format [160,000 bytes]

Display the result as color, purple is low red is high (image below)

dv> display(colorize(out,ignore=0))
255,000,255 = 1.000000
000,000,255 = 826.600037
000,255,000 = 1652.200073
255,255,000 = 2477.800049
255,128,000 = 3303.400146
255,000,000 = 4129.000000
Writing /tmp/dv_15359/XrF0Km: 200x200x3 PNG file.

Images

Here we are going to plot band 1 vs band 2 in the image below

Original image (left), density plot (right)

unfiltered.pngdensity plot.png

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Related Functions

Recent Library Changes

Created On: 02-18-2011
Modified On: 04-30-2015

Personal tools