📄 plot2.idlg
字号:
/*
plot2.idlg
*! VERSION 1.0.4 01jun2005
// SCRIPTS and PROGRAMS for external use
* SCRIPT plot2_disable
* SCRIPT plot2_enable
* PROGRAM plot2_output
******
The following tabs are identical. Changes made to one
must be made to ALL
plot1.idlg
plot2.idlg
plot3.idlg
plot4.idg
addplot.idlg ** the POSTINT SCRIPT for this tab is different
------
*/
SCRIPT plot2_PREINIT
BEGIN
create BOOLEAN plot2_is_pc_type
create BOOLEAN plot2_is_weights
create BOOLEAN plot2_uses_scatter_weights
END
SCRIPT plot2_POSTINIT
BEGIN
plot2.cb_type.withvalue plot2.cb_type.setvalue "@"
plot2.cb_msize_wgt.additem "Weighted"
END
DEFINE vnwd 130
DEFINE vnsep +150
DIALOG plot2, tabtitle("Plot 2")
BEGIN
TEXT tx_type _lft _top 180 ., ///
label("Plot type to add:")
LISTBOX cb_type @ _ss @ 315, ///
contents(plot2_graph_type) ///
values(plot2_graph_type_val) ///
onselchangelist(plot2_change)
TEXT tx_x 200 _top vnwd ., ///
label("X variable:")
VARNAME vn_x @ _ss @ ., ///
label("X variable")
TEXT tx_y vnsep _top vnwd .,
VARNAME vn_y @ _ss @ ., ///
label("Y variable")
TEXT tx_if vnsep _top vnwd ., ///
label("If: (expression)")
EXP ex_if @ _ss 249 ., ///
label("Create...")
CHECKBOX ck_sort 200 _ms vnwd ., ///
label("Sort on X") option(sort)
CHECKBOX ck_xaxis2 200 75 vnwd ., ///
label("Second X axis") option(xaxis(2))
CHECKBOX ck_yaxis2 350 95 vnwd ., ///
label("Second Y axis") option(yaxis(2))
TEXT tx_x2 200 55 vnwd ., ///
label("X-2 variable:")
VARNAME vn_x2 200 75 vnwd ., ///
label("X-2 variable:")
TEXT tx_y2 350 55 vnwd ., ///
label("Y variable: (lower)")
DEFINE y @y
VARNAME vn_y2 350 75 @ ., ///
label("Y variable (lower)")
CHECKBOX ck_inrange 500 55 249 ., ///
onclickon(script plot2_inrange_on) ///
onclickoff(script plot2_inrange_off) ///
label("Use a range of observations")
TEXT tx_from 500 75 30 ., ///
label("From:")
SPINNER sp_from +32 @ _spwd ., ///
min(1) default(1) max(c(N))
TEXT tx_to _spsep @ 14 ., ///
label("to:")
SPINNER sp_to +16 @ _spwd ., ///
min(1) default(c(N)) max(c(N))
GROUPBOX gb_generic 200 100 550 70, ///
label("Median-band")
CHECKBOX ck_mband 210 120 vnwd ., ///
label("Number of bands") ///
onclickon(plot2.sp_mband.enable) ///
onclickoff(plot2.sp_mband.disable)
SPINNER sp_mband 230 140 _spwd ., ///
default(10) min(1) max(10000000) option(bands)
CHECKBOX ck_mpoints 350 120 300 ., ///
label("Number of points between knots") ///
onclickon(plot2.sp_mpoints.enable) ///
onclickoff(plot2.sp_mpoints.disable)
SPINNER sp_mpoints 370 140 _spwd ., ///
default(10) min(1) max(10000000) option(n)
/**** BEGIN -- lowess options ****/
// share gb_generic here
CHECKBOX ck_mean 210 120 530 ., ///
label("Running-mean smoothing") option(mean)
CHECKBOX ck_nowieght 210 140 530 ., ///
option(noweight) ///
label("Prevents use of Cleveland's tricube weighting function")
CHECKBOX ck_logit 210 160 530 ., ///
option(logit) label("Transform smoothed yvar into logit")
CHECKBOX ck_noadjust 210 180 530 ., ///
option(noadjust) ///
label("Adjust mean of the smoothed yvar to equal the mean of yvar")
EDIT ed_bandwidth 210 210 _en7wd ., ///
default(0.8) numonly option(bwidth)
TEXT tx_bandwidth _en7sep 210 vnwd ., ///
label("Bandwidth")
/**** END -- lowess options ****/
/**** BEGIN -- kdensity options ****/
// share gb_generic here
TEXT tx_function 210 120 530 ., ///
label("Kernel function:")
COMBOBOX cb_function 210 140 _vnwd ., ///
dropdownlist ///
contents(kernel_function) ///
values(kernel_function_val)
CHECKBOX ck_kernelwidth 210 170 530 ., ///
label("Override optimal width (smoothing parameter)") ///
onclickon(script plot2_kernelwidth_on) ///
onclickoff(script plot2_kernelwidth_off)
EDIT ed_kernelwidth 210 190 _en7wd ., ///
option(width)
TEXT tx_kernelwidth _en7sep 190 200 ., ///
label("Halfwidth of the kernel")
SPINNER sp_kerneleval 210 220 _en7wd ., ///
default(300) min(1) max(10000000) option(n)
TEXT tx_kerneleval _en7sep 220 400 ., ///
label("Number of points at which the estimate is evaluated")
/**** END -- kernel options ****/
/**** BEGIN -- Fit/fitci options ****/
GROUPBOX gb_fit 200 100 550 115, ///
label("Quadratic prediction w/ci")
CHECKBOX ck_fitrange 215 125 60 ., ///
onclickon(script plot2_fitrange_on) ///
onclickoff(script plot2_fitrange_off) ///
label("Range")
EDIT ed_fitfrom +65 125 _spwd ., default(.)
TEXT tx_fitto _spsep 125 14 ., label("to:")
EDIT ed_fitto +16 125 _spwd ., default(.)
RADIO rb_predpoints 490 118 20 ., ///
first onclickon(program plot2_predpoints_on)
RADIO rb_predx 490 138 249 ., ///
onclickon(script plot2_predx_on) ///
label("Predict at X values") last option(atobs)
SPINNER sp_predpoints 510 118 _spwd ., ///
default(100) min(1) max(10000000) option(n)
TEXT tx_predpoints _spsep 118 150 ., ///
label("Prediction points")
TEXT tx_ci_src 210 163 65 ., ///
label("CI source:") right
COMBOBOX cb_ci_src +70 163 99 ., ///
dropdownlist ///
contents(plot2_ci_source) values(plot2_ci_source_values)
TEXT tx_fitplot 379 163 65 ., ///
label("Fit plot:") right
COMBOBOX cb_fitplot +70 163 99 ., ///
option(fitplot) ///
dropdownlist ///
onselchangelist(plot2_fitplots_change) ///
contents(plot2_fitplots) values(plot2_fitplots_values)
TEXT tx_regress_opt 560 163 75 ., ///
label("Regress opts:") right
EDIT ed_regress_opt +80 163 99 ., ///
label("Regress options") option(estopts)
TEXT tx_level 210 188 65 ., ///
label("CI level:") right
SPINNER sp_level +70 188 99 ., ///
default(95) min(10) max(99) option(level)
TEXT tx_ciplot 379 188 65 ., ///
label("CI plot:") right
COMBOBOX cb_ciplot +70 188 99 ., ///
option(ciplot) ///
dropdownlist ///
onselchangelist(plot2_ciplots_change) ///
contents(plot2_ciplots) values(plot2_ciplots_values)
TEXT tx_pred_opt 560 188 75 ., ///
label("Predict opts:") right
EDIT ed_pred_opt +80 188 99 ., ///
label("Predict optins") option(predopts)
TEXT tx_ecommand 203 125 75 ., ///
label("Estimation:") right
COMBOBOX cb_ecommand 280 125 99 ., ///
dropdownlist contents(plot2_estimation_command_list) ///
option(estcmd) default(regress)
/**** END -- fit & fit with ci options ****/
/**** BEGIN -- Scatter options ****/
GROUPBOX gb_marker 200 120 550 _ht11, ///
label("Markers")
TEXT tx_msymbol 210 140 65 ., ///
label("Symbol:") right
COMBOBOX cb_msymbol 280 140 99 ., ///
option(msymbol) ///
dropdownlist ///
contents(symbols)
TEXT tx_msize 392 140 65 ., ///
label("Size:") right
COMBOBOX cb_msize_wgt +70 140 99 ., ///
option(msize) ///
dropdownlist ///
contents(symbolsizes) onselchange(program plot2_weight_check)
COMBOBOX cb_msize @ @ @ ., ///
option(msize) ///
dropdownlist ///
contents(symbolsizes)
TEXT tx_mcolor 570 140 65 ., ///
label("Color:") right
COMBOBOX cb_mcolor +70 140 82 ., ///
option(mcolor) ///
dropdownlist ///
contents(colors) onselchangelist(plot2_color_mcolor)
COLOR cl_mcolor +85 140 _btwd ., ///
option(mcolor)
CHECKBOX ck_mlabel 210 170 530 85, ///
label("Marker labels") groupbox ///
onclickon(script plot2_mlabel_1_enable) ///
onclickoff(script plot2_mlabel_1_disable)
TEXT tx_mlabel 220 195 58 ., ///
label("Variable:") right
VARNAME vn_mlabel +63 195 99 ., ///
label("Marker labels variable") option(mlabel)
TEXT tx_mlsize 220 225 58 ., ///
label("Size:") right
COMBOBOX cb_mlsize +63 225 99 ., ///
option(mlabsize) ///
dropdownlist ///
contents(textsizes)
TEXT tx_mlcolor 399 195 58 ., ///
label("Color:") right
COMBOBOX cb_mlcolor +63 195 82 ., ///
option(mlabcolor) ///
dropdownlist ///
contents(colors) onselchangelist(plot2_color_mlcolor)
COLOR cl_mlcolor +85 195 _btwd ., ///
option(mlabcolor)
TEXT tx_mlposition 399 225 58 ., ///
label("Position:") right
COMBOBOX cb_mlposition +63 225 99 ., ///
option(mlabposition) ///
dropdownlist ///
contents(clockpos)
TEXT tx_weightvar 362 170 95 ., ///
label("Weight variable:") right
VARNAME vn_weightvar +100 170 99 ., ///
label("Weight variable")
TEXT tx_orientation 570 170 65 ., ///
label("Orientation:") right
COMBOBOX cb_orientation +70 170 99 ., ///
contents(plot2_orientation_contents) ///
values(plot2_orientation_values) ///
dropdownlist
/**** END -- Scatter options ****/
/**** BEGIN -- Line options ****/
GROUPBOX gb_line 200 120 550 80, ///
label("Lines")
TEXT tx_clcolor 210 140 65 ., ///
label("Line color:") ///
right
COMBOBOX cb_clcolor +70 140 82 ., ///
dropdownlist option(lcolor) ///
contents(colors) onselchangelist(plot2_color_clcolor)
COLOR cl_clcolor +85 140 _btwd ., ///
option(lcolor)
TEXT tx_connect 210 170 65 ., ///
label("Type:") right
COMBOBOX cb_connect +70 170 99 ., ///
option(connect) ///
dropdownlist ///
contents(connecttypes)
TEXT tx_clwidth 392 140 65 ., ///
label("Width:") right
COMBOBOX cb_clwidth +70 140 99 ., ///
dropdownlist ///
contents(linewidths) option(lwidth)
TEXT tx_clpattern 392 170 65 ., ///
label("Pattern:") right
COMBOBOX cb_clpattern +70 170 99 ., ///
dropdownlist ///
contents(linepatterns) option(lpattern)
/**** END -- Line options ****/
/**** BEGIN -- Area options ****/
GROUPBOX gb_common 200 120 550 80, ///
label("Area")
TEXT tx_blcolor 210 140 65 ., ///
label("Line color:") ///
right
COMBOBOX cb_blcolor +70 140 82 ., ///
option(lcolor) ///
dropdownlist ///
contents(colors) onselchangelist(plot2_color_blcolor)
COLOR cl_blcolor +85 140 _btwd ., ///
option(lcolor)
TEXT tx_bfcolor 210 170 65 ., ///
label("Fill color:") ///
right
COMBOBOX cb_bfcolor +70 170 82 ., ///
option(fcolor) ///
dropdownlist ///
contents(colors) onselchangelist(plot2_color_bfcolor)
COLOR cl_bfcolor +85 170 _btwd ., ///
option(fcolor)
TEXT tx_blwidth 392 140 65 ., ///
label("Line width:") right
COMBOBOX cb_blwidth +70 140 99 ., ///
dropdownlist ///
contents(linewidths) option(lwidth)
TEXT tx_blpattern 392 170 65 ., ///
label("Ln. pattern:") right
TEXT tx_barwidth 392 170 65 ., ///
label("Bar width:") right
COMBOBOX cb_blpattern +70 170 99 ., ///
dropdownlist ///
contents(linepatterns) option(lpattern)
EDIT en_barwidth @ 170 99 ., ///
default(1) numonly option(barwidth)
TEXT tx_base 570 140 65 ., ///
label("Baseline:") right
EDIT en_base +70 140 99 ., ///
default(0) numonly option(base)
/**** END -- Area options ****/
/**** BEGIN -- pcarrow options ****/
TEXT tx_barbsize 210 225 65 ., ///
label("Barbsize:") right
COMBOBOX cb_barbsize 280 225 99 ., ///
option(barbsize) dropdownlist contents(symbolsizes)
CHECKBOX ck_headlabel 590 310 139 ., ///
label("Label head of arrow") option(headlabel)
/**** END -- pcarrow options ****/
/**** BEGIN -- Histogram options ****/
TEXT tx_histtype 210 120 140 ., ///
label("Histogram type:")
COMBOBOX cb_histtype 210 140 140 ., ///
dropdownlist ///
contents(plot2_histogram_list) values(plot2_histogram_list_values)
GROUPBOX gb_datatype 210 175 140 70, ///
label("Type of data")
RADIO rb_continuous 220 195 120 ., ///
first label("Continuous data") ///
onclickon(program plot2_datatype_ckeck)
RADIO rb_discrete 220 215 120 ., ///
last label("Discrete data") option(discrete) ///
onclickon(program plot2_datatype_ckeck)
SPINNER sp_gap 386 125 _spwd ., ///
default(0) min(0) max(100) option(gap)
TEXT tx_gap _spsep 125 100 ., ///
label("Gap")
EDIT ed_datamin 500 125 _en7wd ., ///
option(start)
TEXT tx_datamin _en7sep 125 150 ., ///
label("Theoretical data minimum")
CHECKBOX ck_num_of_bins 386 205 350 ., ///
onclickon(script plot2_num_of_bins_on) ///
onclickoff(script plot2_num_of_bins_off) ///
label("Override number of bins used with continuous data")
SPINNER sp_num_of_bins 386 225 _spwd ., ///
default(10) min(1) max(1000) option(bin)
CHECKBOX ck_width_of_bins 386 155 350 ., ///
onclickon(script plot2_width_of_bins_on) ///
onclickoff(script plot2_width_of_bins_off) ///
label("Override width of bins")
EDIT ed_width_of_bins 386 175 _en7wd ., ///
option(width)
/**** END -- Histogram options ****/
END
PROGRAM plot2_weight_check
BEGIN
if plot2_uses_scatter_weights {
if plot2.cb_msize_wgt.iseq("weight") {
call plot2_is_weights.settrue
call plot2.ck_mlabel.hide
call plot2.tx_mlabel.hide
call plot2.vn_mlabel.hide
call plot2.tx_mlsize.hide
call plot2.cb_mlsize.hide
call plot2.tx_mlcolor.hide
call plot2.cb_mlcolor.hide
call plot2.cl_mlcolor.hide
call plot2.tx_mlposition.hide
call plot2.cb_mlposition.hide
call plot2.gb_marker.setposition . . . 80
call plot2.tx_weightvar.show
call plot2.vn_weightvar.show
exit
}
call script plot2_scatter_show_options
call plot2.cb_msize.hide
call plot2.cb_msize_wgt.show
call plot2_is_weights.setfalse
if plot2.cb_type.iseq("rscatter") {
call plot2.gb_marker.setposition . . . 170
}
if ! plot2.cb_type.iseq("rscatter") {
call plot2.gb_marker.setposition . . . 140
}
call plot2.tx_weightvar.hide
call plot2.vn_weightvar.hide
}
END
SCRIPT plot2_set_scatter_weights_on
BEGIN
plot2_uses_scatter_weights.settrue
plot2.cb_msize.hide
plot2.cb_msize_wgt.show
plot2.cb_msize_wgt.withvalue plot2.cb_msize_wgt.setvalue "@"
END
PROGRAM plot2_datatype_ckeck
BEGIN
if plot2.rb_discrete {
call plot2.ck_num_of_bins.hide
call plot2.sp_num_of_bins.hide
call plot2.ck_width_of_bins.enable
if plot2.ck_width_of_bins {
call plot2.ed_width_of_bins.enable
}
}
if plot2.rb_continuous {
call plot2.ck_num_of_bins.show
call plot2.sp_num_of_bins.show
if plot2.ck_num_of_bins {
call plot2.ck_width_of_bins.disable
}
if plot2.ck_width_of_bins {
call plot2.ck_num_of_bins.setoff
}
}
END
SCRIPT plot2_num_of_bins_on
BEGIN
plot2.sp_num_of_bins.enable
plot2.ck_width_of_bins.disable
plot2.ed_width_of_bins.disable
END
SCRIPT plot2_num_of_bins_off
BEGIN
plot2.sp_num_of_bins.disable
plot2.ck_width_of_bins.enable
END
SCRIPT plot2_width_of_bins_on
BEGIN
plot2.ed_width_of_bins.enable
plot2.ck_num_of_bins.disable
plot2.sp_num_of_bins.disable
END
SCRIPT plot2_width_of_bins_off
BEGIN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -