3
<code file="density_plot.php" />
4
<help file="density_plot.rkh" />
7
<connect client="plotoptions.xvar" governor="x.available"/>
8
<set id="plotoptions.allow_log" to="false"/>
9
<set id="plotoptions.allow_type" to="false"/>
11
<!-- only gaussian kernel works for highest density regions plot -->
12
<convert id="is_normal_density_plot" mode="equals" sources="plot_type.string" standard="density_plot"/>
13
<connect client="kern.rectangular.enabled" governor="is_normal_density_plot"/>
14
<connect client="kern.triangular.enabled" governor="is_normal_density_plot"/>
15
<connect client="kern.epanechnikov.enabled" governor="is_normal_density_plot"/>
16
<connect client="kern.biweight.enabled" governor="is_normal_density_plot"/>
17
<connect client="kern.cosine.enabled" governor="is_normal_density_plot"/>
18
<connect client="kern.optcosine.enabled" governor="is_normal_density_plot"/>
20
<convert id="gaussian_kernel" mode="equals" sources="kern.string" standard="gaussian"/>
21
<connect client="bw.enabled" governor="gaussian_kernel"/>
23
<connect client="rug_ticksize.enabled" governor="rug.state"/>
24
<connect client="rug_lwd.enabled" governor="rug.state"/>
25
<connect client="rug_side.enabled" governor="rug.state"/>
26
<connect client="rug_col.enabled" governor="rug.state"/>
28
<dialog label="Density Plot" >
30
<tab label="Variable(s)" id="tab_vars">
32
<varselector id="vars" />
34
<varslot multi="false" type="numeric" id="x" source="vars" label="variable(s):" required="true" />
36
<preview id="preview"/>
40
<tab label="Options" id="tab_options">
43
<radio id="plot_type" label="type of plot">
44
<option value="density_plot" checked="true" label="plot normal density"/>
45
<option value="hdr_plot" label="plot highest density regions"/>
47
<frame id="frame_density_opts" label="density estimation options">
50
<dropdown id="kern" label="Smoothing Kernel">
51
<option value="gaussian" label="gaussian (default)"/>
52
<option id="rectangular" value="rectangular" label="rectangular"/>
53
<option id="triangular" value="triangular" label="triangular"/>
54
<option id="epanechnikov" value="epanechnikov" label="epanechnikov"/>
55
<option id="biweight" value="biweight" label="biweight"/>
56
<option id="cosine" value="cosine" label="cosine"/>
57
<option id="optcosine" value="optcosine" label="optcosine"/>
59
<dropdown id="bw" label="Bandwidth">
60
<option value="nrd0" label="nrd0"/>
61
<option value="nrd" label="nrd"/>
62
<option value="ucv" label="ucv"/>
63
<option value="bcv" label="bcv"/>
64
<option value="SJ-ste" label="SJ-ste"/>
65
<option value="SJ-dpi" label="SJ-dpi"/>
67
<spinbox type="real" min="0.00001" id="adjust" label="Adjust Bandwidth" initial="1"/>
71
<checkbox id="narm" label="Remove Missing Values" value="na.rm=TRUE" value_unchecked="na.rm=FALSE" checked="true"/>
72
<spinbox id="n" initial="512" label="Resolution" />
79
<frame label="Rug" id="frame_rug">
80
<checkbox value_unchecked="0" value="1" checked="false" id="rug" label="Add rug" />
81
<spinbox min="0" initial="0.03" id="rug_ticksize" label="Ticksize" />
82
<spinbox min="0" initial="0.5" id="rug_lwd" label="Line width of ticks" default_precision="0"/>
83
<radio label="Side of Rug" id="rug_side">
84
<option value="side = 1" label="Rug on Bottom" />
85
<option value="side = 3" label="Rug on Top" />
87
<embed id="rug_col" component="rkward::color_chooser" label="Color"/>
93
<tab label="Axis/Title" id="tab_plotoptions">
95
<embed id="plotoptions" component="rkward::plot_options" as_button="false" label="Plot Options" />