Differences From Artifact [df61ed3cec]:

To Artifact [9e7d64559f]:


144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161














162
163
164
165
166
167
168
pack .plotbar.dim     -expand false -fill x -side right
pack .plotbar.plot    -expand false -fill x -side right
pack .plotbar.select  -expand false -fill x -side right

# button bar
canvas .buttonbar

button .buttonbar.rotate -text "Rotate 3D" -relief raised -command { rotate_3d }
button .buttonbar.replot -text "Refresh"   -relief raised -command { puts "replot" }

button .buttonbar.newwin -text "New Plot"  -relief raised -command {
    set windownum [expr 1 + \$windownum]
    puts "set term x11 \$windownum"
}

pack .buttonbar.newwin  -expand false -side right
pack .buttonbar.replot  -expand false -side right
pack .buttonbar.rotate  -expand false -side right















## parameter list canvas
canvas		.parameters
listbox		.parameters.list -background oldlace -foreground black
scrollbar	.parameters.yscrollbar	-orient v

## configure scrollbars







<









|
>
>
>
>
>
>
>
>
>
>
>
>
>
>







144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
pack .plotbar.dim     -expand false -fill x -side right
pack .plotbar.plot    -expand false -fill x -side right
pack .plotbar.select  -expand false -fill x -side right

# button bar
canvas .buttonbar


button .buttonbar.replot -text "Refresh"   -relief raised -command { puts "replot" }

button .buttonbar.newwin -text "New Plot"  -relief raised -command {
    set windownum [expr 1 + \$windownum]
    puts "set term x11 \$windownum"
}

pack .buttonbar.newwin  -expand false -side right
pack .buttonbar.replot  -expand false -side right

# rotation bar
canvas .rotationbar
scale .rotationbar.xrot  -label "Rotate X" -orient h -from "0" -to "180" -command { do_rotate_3d "xrot" }
scale .rotationbar.zrot  -label "Rotate Z" -orient h -from "0" -to "360" -command { do_rotate_3d "zrot" }
pack .rotationbar.xrot  -side left
pack .rotationbar.zrot  -side right
.rotationbar.xrot set 30
.rotationbar.zrot set 60
pack .rotationbar		-expand false -fill x    -side bottom

proc "enable_rotationbar" "" {
}
proc "disable_rotationbar" "" {
}

## parameter list canvas
canvas		.parameters
listbox		.parameters.list -background oldlace -foreground black
scrollbar	.parameters.yscrollbar	-orient v

## configure scrollbars
301
302
303
304
305
306
307

308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327

328
329
330
331
332
333
334
    global ytitle
    global ztitle
    global dimension
    global plottype
    global lastplot
    switch -- \$dimension {
	2D	{

	    switch -- \$plottype {
		Single	{
		    puts "set xlabel '\$xtitle'"
		    puts "set ylabel '\$ytitle'"
		    puts "set nokey"
		    puts "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"
		}
		Multi	{
		    puts "set xlabel ''"
		    puts "set ylabel ''"
		    puts "set key"
		    if {"\$lastplot" != "2D"} {
			puts "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"
		    } else {
			puts "replot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"	    
		    }
		}
	    }
	}
	3D	{

	    switch -- \$plottype {
		Single	{
		    puts "set xlabel '\$xtitle'"
		    puts "set ylabel '\$ytitle'"
		    puts "set zlabel '\$ztitle'"
		    puts "set nokey"
		    puts "splot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle  y:\$ytitle  x:\$xtitle' with lines"







>




















>







314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
    global ytitle
    global ztitle
    global dimension
    global plottype
    global lastplot
    switch -- \$dimension {
	2D	{
	    disable_rotationbar
	    switch -- \$plottype {
		Single	{
		    puts "set xlabel '\$xtitle'"
		    puts "set ylabel '\$ytitle'"
		    puts "set nokey"
		    puts "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"
		}
		Multi	{
		    puts "set xlabel ''"
		    puts "set ylabel ''"
		    puts "set key"
		    if {"\$lastplot" != "2D"} {
			puts "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"
		    } else {
			puts "replot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"	    
		    }
		}
	    }
	}
	3D	{
	    enable_rotationbar
	    switch -- \$plottype {
		Single	{
		    puts "set xlabel '\$xtitle'"
		    puts "set ylabel '\$ytitle'"
		    puts "set zlabel '\$ztitle'"
		    puts "set nokey"
		    puts "splot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle  y:\$ytitle  x:\$xtitle' with lines"
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
    if {"\$get_scale_status" == "ok"} {
	return "\$get_scale_retval"
    } else {
	return ""
    }
}

proc "rotate_3d" "" {
    listbox .f -background slateblue
    set xrot	30
    set yrot	60
    set scale	1
    set zscale	1
    scale .f.xrot   -background slateblue -foreground yellow -label "Rotate X" -orient h -from "0" -to "180" -command { do_rotate_3d "xrot" }
    scale .f.yrot   -background slateblue -foreground yellow -label "Rotate Z" -orient h -from "0" -to "360" -command { do_rotate_3d "yrot" }
    scale .f.scale  -background slateblue -foreground yellow -label "Scale"    -orient h -from "-4" -to "4" -command { do_rotate_3d "scale" }
    scale .f.zscale -background slateblue -foreground yellow -label "Scale Z"  -orient h -from "-4" -to "4" -command { do_rotate_3d "zscale" }
    button .f.ok -background slateblue -foreground yellow -text "OK" -command { destroy .f }
    pack .f.xrot -side top
    pack .f.yrot -side top
    pack .f.scale -side top
    pack .f.zscale -side top
    pack .f.ok -side bottom
    place .f -in .parameters -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside
}

proc "do_rotate_3d" "var val" {
    switch -- \$var {
	xrot	{ puts "set view \$val,,, ; replot" }
	yrot	{ puts "set view ,\$val,, ; replot" }
	scale	{ puts "set view ,,[expr pow(2,\$val)], ; replot" }
	zscale	{ puts "set view ,,,[expr pow(2,\$val)] ; replot" }
    }
}

    
# Defaults







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



|







492
493
494
495
496
497
498



















499
500
501
502
503
504
505
506
507
508
509
    if {"\$get_scale_status" == "ok"} {
	return "\$get_scale_retval"
    } else {
	return ""
    }
}




















proc "do_rotate_3d" "var val" {
    switch -- \$var {
	xrot	{ puts "set view \$val,,, ; replot" }
	zrot	{ puts "set view ,\$val,, ; replot" }
	scale	{ puts "set view ,,[expr pow(2,\$val)], ; replot" }
	zscale	{ puts "set view ,,,[expr pow(2,\$val)] ; replot" }
    }
}

    
# Defaults

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]