|
RIDGELINE PLOTName:
The degree of overlap can be controlled with the command
where <inc> is a positive value. The default value is 1. You may need to generate several iterations of the plot to find a value that works best. The desired degree of overlap is a matter of personal preference, so Dataplot does not try to automatically determine an optimal value. To specify the desired type of plot, enter the command
HISTOGRAM/CUMULATIVE HISTOGRAM> The default, DENSITY, generates a kernel density plot. The HISTOGRAM option generates a relative histogram. The DENSITY and HISTOGRAM options are estimating the probability densities of the data sets. Selecting the CUMULATIVE DENSITY and CUMULATIVE HISTOGRAM will plot estimates of the cumulative distribution functions. This plot works best when there is a clear pattern in the density estimates.
where <y> is a response variable; <x> is a group-id variable; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
<SUBSET/EXCEPT/FOR qualification> where <y1> ... <yk> is a list of one or more response variables; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
RIDGELINE PLOT Y X SUBSET X > 2 MULTIPLE RIDGELINE PLOT Y1 Y2 Y3 Y4 Y5
. Step 1: Read yearly Freon and CO-2 data
.
SET READ FORMAT 3F4.0,F5.0,F6.0,F3.0,2F9.0
SKIP 50
READ PBF11.DAT YEAR DAY J1 J2 FREON FLAG WV CO2
retain year co2 subset co2 > 0
let y = co2
let yeardist = distinct year
let nyears = size yeardist
loop for k = 1 1 nyears
let aval = yeardist(k)
let string s^k = ^aval
end of loop
let ig = group label s1 to s^nyears
.
. Step 2: Set basic plot control features
.
case asis
title case asis
label case asis
tic mark label case asis
title offset 1
title size 1.8
.
let inc = 0.1
let xmax = (nyears-1)*inc
xlimits 0 xmax
major xtic mark number nyears
minor xtic mark number 0
tic mark offset units data
x1tic mark offset 0.05 0.2
x1tic mark label format group label
x1tic mark label content ig
ylimits 320 360
horizontal switch on
.
. Step 3: Generate the plot for kernel density
.
y1label CO2 Level
x1label Year
title Kernel Density Traces for CO2 (Point Barrow)
set ridgeline plot height inc
ridgeline plot y year
.
. Step 4: Now generate using histograms rather than density traces
.
class lower 320
class upper 360
class width 2
bar fill on all
bar fill color cyan red cyan red cyan red cyan red cyan red
.
let inc = 0.15
let xmax = (nyears-1)*inc
xlimits 0 xmax
major xtic mark number nyears
minor xtic mark number 0
tic mark offset units data
x1tic mark offset 0.05 0.2
.
title Histograms for CO2 (Point Barrow)
set ridgeline plot height inc
set ridgeline plot type histogram
ridgeline plot y year
Program 2:
. Step 1: Read yearly Freon and CO-2 data
.
SET READ FORMAT 3F4.0,F5.0,F6.0,F3.0,2F9.0
SKIP 50
READ PBF11.DAT YEAR DAY J1 J2 FREON FLAG WV CO2
retain year co2 subset co2 > 0
let y = co2
let yeardist = distinct year
let nyears = size yeardist
loop for k = 1 1 nyears
let aval = yeardist(k)
let string s^k = ^aval
end of loop
let ig = group label s1 to s^nyears
.
. Step 2: Set basic plot control features
.
case asis
title case asis
label case asis
tic mark label case asis
title offset 1
title size 1.8
.
let inc = 1
let xmax = (nyears-1)*inc
xlimits 0 xmax
major xtic mark number nyears
minor xtic mark number 0
tic mark offset units data
x1tic mark offset 0.1 1.1
x1tic mark label format group label
x1tic mark label content ig
ylimits 320 360
horizontal switch on
.
. Step 3: Generate the plot for cumulative kernel density
.
y1label CO2 Level
x1label Year
title Cumulative Kernel Density Traces for CO2 (Point Barrow)
set ridgeline plot type cumulative density
set ridgeline plot height inc
ridgeline plot y year
.
. Step 4: Generate the plot for cumulative histogram
.
class lower 320
class upper 360
class width 2
bar fill on all
bar fill color cyan red cyan red cyan red cyan red cyan red
.
title Cumulative Histograms for CO2 (Point Barrow)
set ridgeline plot type cumulative histogram
ridgeline plot y year
Date created: 07/15/2025 |
Last updated: 07/15/2025 Please email comments on this WWW page to [email protected]. | |||||||||||||