DISLIN Examples / Tcl

Demonstration of CURVE / Tcl

load dislin.so

set n 101
set pi 3.1415926
set f [expr $pi / 180]
set step [expr 360.0 / ($n - 1)]

for { set i 0 } { $i < $n } { incr i } {
    lappend xray [expr $i * $step]
    set x [expr $i * $step * $f]
    lappend y1ray [expr sin ($x)]
    lappend y2ray [expr cos ($x)]
}

Dislin::metafl cons
Dislin::scrmod revers
Dislin::disini

Dislin::complx
Dislin::pagera

Dislin::name X-axis  X
Dislin::name Y-axis  Y

Dislin::axspos 450 1800 
Dislin::axslen 2200 1200 

Dislin::labdig -1 X 
Dislin::ticks 10 XY 

Dislin::titlin "Demonstration of CURVE"  1
Dislin::titlin "SIN (X), COS (X)"  3

set ic [Dislin::intrgb 0.95 0.95 0.95]
Dislin::axsbgd $ic
Dislin::graf 0 360 0 90 -1 1 -1 0.5
Dislin::setrgb 0.7 0.7 0.7
Dislin::grid 1 1

Dislin::color fore
Dislin::height 50
Dislin::title

Dislin::color red
Dislin::curve $xray $y1ray $n
Dislin::color green
Dislin::curve $xray $y2ray $n
Dislin::disfin

Polar Plots / Tcl

load dislin.so

set n 300
set m 10
set f [expr 3.1415927 / 180.]
set step [expr 360. / ($n - 1)]

for { set i 0 } { $i < $n } { incr i } {
    set a [expr ($i * $step) * $f]
    lappend y1 $a
    set a [expr 5 * $a]
    lappend x1 [expr sin ($a)]
}

for { set i 1 } { $i <= $m } { incr i } {
    lappend x2 $i
    lappend y2 $i
}

Dislin::setpag da4p
Dislin::metafl cons
Dislin::disini 
Dislin::complx 
Dislin::pagera 

Dislin::titlin "Polar Plots" 2
Dislin::ticks  3 Y
Dislin::axends NOENDS X
Dislin::labdig -1 Y
Dislin::axslen 1000 1000
Dislin::axsorg 1050 900

set ic [Dislin::intrgb 0.95 0.95 0.95]
Dislin::axsbgd $ic

Dislin::grafp  1 0 0.2 0 30
Dislin::curve  $x1 $y1 $n
Dislin::htitle 50
Dislin::title  
Dislin::endgrf 

Dislin::labdig -1 X
Dislin::axsorg 1050 2250
Dislin::labtyp VERT Y
Dislin::grafp  10 0 2 0 30
Dislin::barwth -5
Dislin::polcrv FBARS
Dislin::curve  $x2 $y2 $m

Dislin::disfin 

Symbols / Tcl

load dislin.so

set ctit Symbols

Dislin::setpag da4p
Dislin::metafl cons

Dislin::disini 
Dislin::pagera 
Dislin::complx 
Dislin::paghdr "H. Michels ("  ")" 2 0

Dislin::height 60
set nl [Dislin::nlmess $ctit]
Dislin::messag $ctit  [expr (2100 - $nl) / 2] 200

Dislin::height 50
Dislin::hsymbl 120

set ny 150

for { set i 0 } { $i < 24 } { incr i } {
  set nl [Dislin::nlnumb $i -1]
  set j [expr $i % 4]
  if {$j == 0} {
    set ny [expr $ny + 400]
    set nxp 550
  } else {
    set nxp [expr $nxp + 350]
  }

  Dislin::number $i -1 [expr $nxp - $nl/2] [expr $ny + 150]
  Dislin::symbol $i $nxp $ny
}
Dislin::disfin 

Interpolation Methods / Tcl

load dislin.so

set ctit "Interpolation Methods"

set xray [list 0. 1. 3. 4.5 6. 8. 9. 11. 12. 12.5 13. 15. 16. 17. 19. 20.]
set yray [list 2. 4. 4.5 3. 1. 7. 2. 3. 5. 2. 2.5  2. 4. 6. 5.5 4.]
set cpol [list SPLINE STEM BARS STAIRS STEP LINEAR]

Dislin::setpag da4p
Dislin::scrmod revers
Dislin::metafl cons

Dislin::disini 
Dislin::pagera 
Dislin::complx 

Dislin::incmrk 1
Dislin::hsymbl 20
Dislin::titlin $ctit 1
Dislin::axslen 1500 350
Dislin::setgrf LINE LINE LINE LINE

set ic [Dislin::intrgb 1.0 1.0 0.0]
Dislin::axsbgd $ic

set nya 2700
for { set i 0 } { $i < 6 } { incr i } {
    Dislin::axspos 350 [expr $nya - $i * 350]
    Dislin::polcrv [lindex $cpol $i]
    Dislin::marker 0
    Dislin::graf   0 20 0 5 0 10 0 5
    set nx [Dislin::nxposn 1.0]
    set ny [Dislin::nyposn 8.0]
    Dislin::messag [lindex $cpol $i] $nx $ny
    Dislin::color red
    Dislin::curve  $xray $yray 16
    Dislin::color fore

    if {$i == 5} {
      Dislin::height 50
      Dislin::title 
    }

    Dislin::endgrf 
}
Dislin::disfin 

Bar Graphs / Tcl

load dislin.so

set x  [list 1.0  2.0  3.0  4.0  5.0  6.0  7.0  8.0  9.0]
set y  [list 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0]
set y1 [list 1.0  1.5  2.5  1.3  2.0  1.2  0.7  1.4  1.1]
set y2 [list 2.0  2.7  3.5  2.1  3.2  1.9  2.0  2.3  1.8]
set y3 [list 4.0  3.5  4.5  3.7  4.0  2.9  3.0  3.2  2.6]

set nya 2700
set ctit "Bar Graphs (BARS)"

Dislin::setpag da4p
Dislin::metafl cons
Dislin::disini 
Dislin::pagera 
Dislin::complx 
Dislin::ticks  1 x
Dislin::intax  
Dislin::axslen 1600 700
Dislin::titlin $ctit 3

set cbuf " "
Dislin::legini $cbuf 3 8
Dislin::leglin $cbuf FIRST 1
Dislin::leglin $cbuf SECOND 2
Dislin::leglin $cbuf THIRD 3
Dislin::legtit " "
Dislin::shdpat 5

for { set i 0 } { $i < 3 } { incr i } {
    if {$i > 0} {
       Dislin::labels none X
    }
    Dislin::axspos 300 [expr $nya - $i * 800]
    Dislin::graf 0.0 10.0 0.0 1.0 0.0 5.0 0.0 1.0

    if {$i == 0} {
       Dislin::bargrp 3 0.15
       Dislin::color red
       Dislin::bars $x $y $y1 9
       Dislin::color green
       Dislin::bars $x $y $y2 9
       Dislin::color blue
       Dislin::bars $x $y $y3 9
       Dislin::color fore
       Dislin::reset bargrp
    } elseif {$i == 1} {
       Dislin::height 30
       Dislin::labels delta bars
       Dislin::labpos center bars
       Dislin::color red
       Dislin::bars $x $y $y1 9
       Dislin::color green
       Dislin::bars $x $y1 $y2 9
       Dislin::color blue
       Dislin::bars $x $y2 $y3 9
       Dislin::color fore
       Dislin::reset height 
    } elseif {$i == 2} {
       Dislin::labels second bars
       Dislin::labpos outside bars
       Dislin::color red
       Dislin::bars $x $y $y1 9
       Dislin::color  fore
    }

    if {$i != 2} {
       Dislin::legend $cbuf 7
    }
    
    if {$i == 2} {
       Dislin::height 50
       Dislin::title  
    }
  Dislin::endgrf 
}
Dislin::disfin 

Pie Charts / Tcl

load dislin.so

set xray [list 1. 2.5 2. 2.7 1.8]

set ctit "Pie Charts (PIEGRF)"

Dislin::setpag da4p
Dislin::metafl cons
Dislin::disini 
Dislin::pagera 
Dislin::complx 
Dislin::chnpie both

Dislin::axslen 1600 1000
Dislin::titlin $ctit 2

set cbuf " "
Dislin::legini $cbuf 5 8
Dislin::leglin $cbuf FIRST  1
Dislin::leglin $cbuf SECOND 2
Dislin::leglin $cbuf THIRD  3
Dislin::leglin $cbuf FOURTH 4
Dislin::leglin $cbuf FIFTH  5

Dislin::patcyc 1 7
Dislin::patcyc 2 4
Dislin::patcyc 3 13
Dislin::patcyc 4 3
Dislin::patcyc 5 5

Dislin::axspos 250 2800
Dislin::piegrf $cbuf 1 $xray 5
Dislin::endgrf 

Dislin::axspos 250 1600
Dislin::labels DATA PIE
Dislin::labpos EXTERNAL PIE
Dislin::piegrf $cbuf 1 $xray 5

Dislin::height 50
Dislin::title  
Dislin::disfin 

3-D Bar Graph / 3-D Pie Chart / Tcl

load dislin.so

set xray  [list 2.0  4.0  6.0  8.0  10.]
set y1ray [list 0.0  0.0  0.0  0.0  0.0]
set y2ray [list 3.2  1.5  2.0  1.0  3.0]

set ic1ray [list 50  150  100  200  175]
set ic2ray [list 50  150  100  200  175]

Dislin::metafl cons
Dislin::setpag da4p
Dislin::disini 
Dislin::pagera 
Dislin::hwfont 

Dislin::titlin "3-D Bar Graph / 3-D Pie Chart"  2
Dislin::htitle 40

Dislin::shdpat 16
Dislin::axslen 1500  1000
Dislin::axspos 300  1400

Dislin::barwth 0.5
Dislin::bartyp 3dvert
Dislin::labels second  bars
Dislin::labpos outside  bars
Dislin::labclr 255  bars
Dislin::graf   0.0  12.0  0.0  2.0  0.0  5.0  0.0  1.
Dislin::title  
Dislin::color  red
Dislin::bars   $xray  $y1ray  $y2ray  5
Dislin::endgrf 

Dislin::shdpat 16
Dislin::labels data  pie
Dislin::labclr 255  pie
Dislin::chnpie none
Dislin::pieclr $ic1ray $ic2ray  5
Dislin::pietyp 3d
Dislin::axspos 300  2700
set cbuf " " 
Dislin::piegrf $cbuf  0  $y2ray  5  
Dislin::disfin 

3-D Bars / BARS3D / Tcl

load dislin.so

set n 18

set xray  [list 1.0  3.0  8.0  1.5  9.0  6.3  5.8  2.3  8.1 \
 3.5 2.2  8.7  9.2  4.8  3.4  6.9  7.5  3.8]
set yray  [list 5.0  8.0  3.5  2.0  7.0  1.0  4.3  7.2  6.0  8.5 \
 4.1 5.0  7.3  2.8  1.6  8.9  9.5  3.2]
set z1ray [list 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0 \
 0.0 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0]
set z2ray [list 4.0  5.0  3.0  2.0  3.5  4.5  2.0  1.6  3.8 \
 4.7  2.1  3.5  1.9  4.2  4.9  2.8  3.6  4.3]
set icray [list 30  30  30  30  30  30  100  100  100  100 \
 100  100  170  170  170  170  170  170]

for { set i 0 } { $i < $n } { incr i } {
    lappend xwray 0.5 
    lappend ywray 0.5
} 

Dislin::metafl xwin
Dislin::setpag da4p
Dislin::disini 
Dislin::hwfont 
Dislin::pagera 

Dislin::axspos 200  2600
Dislin::axslen 1800  1800

Dislin::name   X-axis  X
Dislin::name   Y-axis  Y
Dislin::name   Z-axis  Z

Dislin::titlin "3-D Bars / BARS3D" 3
Dislin::labl3d hori

Dislin::graf3d 0.0 10.0 0.0 2.0 0.0 10.0 0.0 2.0 0.0 5.0 0.0 1.0
Dislin::grid3d 1 1  bottom

Dislin::bars3d $xray $yray $z1ray $z2ray $xwray $ywray $icray $n

set cbuf " "  
Dislin::legini $cbuf  3  20
Dislin::legtit " "  
Dislin::legpos 1350  1150
Dislin::leglin $cbuf  First  1
Dislin::leglin $cbuf  Second  2
Dislin::leglin $cbuf  Third  3
Dislin::legend $cbuf  3

Dislin::height 50
Dislin::title 
Dislin::disfin 

Shading Patterns / Tcl

load dislin.so

set ctit "Shading Patterns (AREAF)"

Dislin::metafl cons
Dislin::disini
Dislin::setvlt small
Dislin::pagera
Dislin::complx

Dislin::height 50
set nl [Dislin::nlmess ($ctit)]
Dislin::messag $ctit [expr (2970 - $nl) / 2] 200

set nx0 335
set ny0 350

set iclr 0
for { set i 0 } { $i < 3 } { incr i } {
    set  ny [expr $ny0 + $i * 600]
    for { set j 0 } { $j < 6 } { incr j } {
	set nx  [expr $nx0 + $j * 400]
        set ii [expr $i * 6 + $j]
        Dislin::shdpat $ii
        set iclr [expr $iclr + 1]
        Dislin::setclr $iclr

        set ixp [list $nx [expr $nx + 300] [expr $nx + 300] $nx]
        set iyp [list $ny $ny [expr $ny + 400] [expr $ny + 400]]
        Dislin::areaf $ixp $iyp 4
        set nl [Dislin::nlnumb $ii -1]
        set nx [expr $nx + (300 - $nl) / 2]
        Dislin::color foreground
        Dislin::number $ii -1 $nx [expr $ny + 460] 
    }
}
Dislin::disfin

3-D Colour Plot / Tcl

load dislin.so

set ctit1 "3-D  Colour Plot of the Function"
set ctit2 "F(X,Y) = 2 * SIN(X) * SIN (Y)"

set n 50
set m 50

set fpi  [expr 3.1415927 / 180]
set stepx [expr 360. / ($n - 1)]
set stepy [expr 360. / ($m - 1)]

for { set i 0 } { $i < $n } { incr i } {
    set x [expr $i * $stepx * $fpi]
    for { set j 0 } { $j < $m } { incr j } {
	set y  [expr $j * $stepy * $fpi]
        lappend zmat [expr 2 * sin ($x) * sin ($y)]
    }
}

Dislin::metafl xwin
Dislin::disini 
Dislin::pagera 
Dislin::complx 

Dislin::titlin $ctit1 1
Dislin::titlin $ctit2 3

Dislin::name X-axis X
Dislin::name Y-axis Y
Dislin::name Z-axis Z

Dislin::intax  
Dislin::autres $n $m
Dislin::axspos 300 1850
Dislin::ax3len 2200 1400 1400

Dislin::graf3 0 360 0 90 0 360 0 90 -2 2 -2 1
Dislin::crvmat $zmat $n $m 1 1
Dislin::height 50
Dislin::title  
Dislin::disfin 

Surface Plot / Tcl

load dislin.so

set ctit1 "Surface Plot of the Function"
set ctit2 "F(X,Y) = 2 * SIN(X) * SIN (Y)"

set n 50
set m 50

set fpi  [expr 3.1415927 / 180]
set stepx [expr 360. / ($n - 1)]
set stepy [expr 360. / ($m - 1)]

for { set i 0 } { $i < $n } { incr i } {
    set x [expr $i * $stepx * $fpi]
    for { set j 0 } { $j < $m } { incr j } {
	set y  [expr $j * $stepy * $fpi]
        lappend zmat [expr 2 * sin ($x) * sin ($y)]
    }
}

Dislin::metafl cons
Dislin::setpag da4p
Dislin::disini
Dislin::pagera
Dislin::complx

Dislin::titlin $ctit1 2
Dislin::titlin $ctit2 4

Dislin::axspos 200 2600
Dislin::axslen 1800 1800

Dislin::name   X-axis X
Dislin::name   Y-axis Y
Dislin::name   Z-axis Z

Dislin::view3d -5 -5 4 ABS
Dislin::graf3d 0 360 0 90 0 360 0 90  -3 3 -3 1
Dislin::height 50
Dislin::title

Dislin::color green
Dislin::surmat $zmat $n $m 1 1
Dislin::disfin

Shaded Surface Plot / Tcl

load dislin.so

set ctit1 "Shaded Surface Plot"
set ctit2 "F(X,Y) = 2 * SIN(X) * SIN (Y)"

set n 50
set m 50

set fpi  [expr 3.1415927 / 180]
set stepx [expr 360. / ($n - 1)]
set stepy [expr 360. / ($m - 1)]

for { set i 0 } { $i < $n } { incr i } {
    set x [expr $i * $stepx]
    lappend xray $x
    set x [expr $x * $fpi]
    for { set j 0 } { $j < $m } { incr j } {
	set y  [expr $j * $stepy]
        if {$i == 0} {
          lappend yray $y
        }
        set y [expr $y * $fpi]
        lappend zmat [expr 2 * sin ($x) * sin ($y)]
    }
}

Dislin::metafl cons
Dislin::setpag da4p
Dislin::disini
Dislin::pagera
Dislin::complx

Dislin::titlin $ctit1 2
Dislin::titlin $ctit2 4

Dislin::axspos 200 2600
Dislin::axslen 1800 1800

Dislin::name   X-axis X
Dislin::name   Y-axis Y
Dislin::name   Z-axis Z

Dislin::view3d -5 -5 4 ABS
Dislin::graf3d 0 360 0 90 0 360 0 90  -3 3 -3 1
Dislin::height 50
Dislin::title

Dislin::shdmod smooth surface
Dislin::surshd $xray $n $yray $m $zmat
Dislin::disfin

Contour Plot / Tcl

load dislin.so

set ctit1 "Contour Plot"
set ctit2 "F(X,Y) = 2 * SIN(X) * SIN (Y)"

set n 50
set m 50

set fpi  [expr 3.1415927 / 180]
set stepx [expr 360. / ($n - 1)]
set stepy [expr 360. / ($m - 1)]

for { set i 0 } { $i < $n } { incr i } {
    lappend xray [expr $i * $stepx]
}

for { set i 0 } { $i < $m } { incr i } {
    lappend yray [expr $i * $stepy]
}

for { set i 0 } { $i < $n } { incr i } {
    set x [expr [lindex $xray $i] * $fpi]
    for { set j 0 } { $j < $m } { incr j } {
        set y [expr [lindex $yray $j] * $fpi]
        lappend zmat [expr 2 * sin ($x) * sin ($y)]
    }
}

Dislin::metafl cons
Dislin::setpag da4p
Dislin::disini
Dislin::pagera
Dislin::complx

Dislin::titlin $ctit1 1
Dislin::titlin $ctit2 3

Dislin::intax
Dislin::axspos 450 2650

Dislin::name  X-axis X
Dislin::name  Y-axis Y

Dislin::graf   0 360 0 90 0 360 0 90
Dislin::height 50
Dislin::title

Dislin::height 30
for { set i 0 } { $i < 9 } { incr i } {
    set zlev [expr -2. + $i * 0.5]
    if {$i == 4} {
       Dislin::labels NONE CONTUR
    } else {
       Dislin::labels FLOAT CONTUR
    }
    Dislin::setclr [expr ($i + 1) * 28]
    Dislin::contur $xray $n $yray $m $zmat $zlev
}
Dislin::disfin

Shaded Contour Plot / Tcl

load dislin.so

set ctit1 "Shaded Contour Plot"
set ctit2 "F(X,Y) = (X^2% - 1)^2% + (Y^2% - 1)^2%"

set n 50
set m 50
set stepx [expr 1.6 / ($n - 1)]
set stepy [expr 1.6 / ($m - 1)]

for { set i 0 } { $i < $n } { incr i } {
    lappend xray [expr $i * $stepx]
}

for { set i 0 } { $i < $m } { incr i } {
    lappend yray [expr $i * $stepy]
}

for { set i 0 } { $i < $n } { incr i } {
    set x [lindex $xray $i]
    set x [expr $x * $x - 1]
    set x [expr $x * $x]
    for { set j 0 } { $j < $m } { incr j } {
        set y [lindex $yray $j]
        set y [expr $y * $y - 1]
        set y [expr $y * $y]
        lappend zmat [expr $x + $y]
    }
}

Dislin::metafl cons
Dislin::setpag da4p

Dislin::disini
Dislin::pagera
Dislin::complx
Dislin::mixalf
Dislin::newmix

Dislin::titlin $ctit1 1
Dislin::titlin $ctit2 3

Dislin::name   X-axis X
Dislin::name   Y-axis Y

Dislin::axspos 450 2670
Dislin::shdmod poly contur
Dislin::graf   0 1.6 0 0.2 0 1.6 0 0.2

for { set i 0 } { $i < 12 } { incr i } {
    lappend zlev [expr 0.1 + (11 - $i) * 0.1]
}
Dislin::conshd $xray $n $yray $m $zmat $zlev 12

Dislin::height 50
Dislin::title
Dislin::disfin

Shaded Surface / Contour Plot / Tcl

load dislin.so

set ctit1 "Shaded Surface / Contour Plot"
set ctit2 "F(X,Y) = 2 * SIN(X) * SIN (Y)"

set n 50
set m 50
set nlev 20

set fpi  [expr 3.1415927 / 180]
set stepx [expr 360. / ($n - 1)]
set stepy [expr 360. / ($m - 1)]

for { set i 0 } { $i < $n } { incr i } {
    set x [expr $i * $stepx]
    lappend xray $x
    set x [expr $x * $fpi]
    for { set j 0 } { $j < $m } { incr j } {
	set y  [expr $j * $stepy]
        if {$i == 0} {
          lappend yray $y
        }
        set y [expr $y * $fpi]
        lappend zmat [expr 2 * sin ($x) * sin ($y)]
    }
}

Dislin::metafl cons
Dislin::scrmod revers
Dislin::setpag da4p
Dislin::disini
Dislin::pagera
Dislin::complx

Dislin::titlin $ctit1 2
Dislin::titlin $ctit2 4

Dislin::axspos 200 2600
Dislin::axslen 1800 1800

Dislin::name   X-axis X
Dislin::name   Y-axis Y
Dislin::name   Z-axis Z

Dislin::graf3d 0 360 0 90 0 360 0 90  -2 2 -2 1
Dislin::height 50
Dislin::title

Dislin::grfini -1.0 -1.0 -1.0 1.0 -1.0 -1.0 1.0 1.0 -1.0
Dislin::nograf
Dislin::graf 0.0 360.0 0.0 90.0 0.0 360.0 0.0 90.0
  
set step [expr 4.0 / $nlev]
for { set i 0 } { $i < $n } { incr i } {
    lappend zlev [expr -2.0 + $i * $step]
}

Dislin::conshd $xray $n $yray $n $zmat $zlev $nlev
Dislin::box2d
Dislin::reset nograf
Dislin::grffin

Dislin::shdmod smooth surface
Dislin::surshd $xray $n $yray $m $zmat
Dislin::disfin

Spheres and Tubes / Tcl

load dislin.so

set x [list 10.0 20.0 10.0 20.0 5.0 15.0 25.0 5.0 15.0 25.0 \
 5.0 15.0 25.0 10.0 20.0 10.0 20.0]
set y [list 10.0 10.0 20.0 20.0 5.0 5.0 5.0 15.0 15.0 15.0 \
 25.0 25.0 25.0 10.0 10.0 20.0 20.0]
set z [list 5.0 5.0 5.0 5.0 15.0 15.0 15.0 15.0 15.0 15.0 \
 15.0 15.0 15.0 25.0 25.0 25.0 25.]  
set idx [list 1 2 1 3 3 4 2 4 5 6 6 7 8 9 9 10 \
 11 12 12 13  5 8 8 11 6 9 9 12 7 10 10 13  14 15 16 17 14 16 15 17 \
 1 5 2 7 3 11 4 13 5 14 7 15 11 16 13 17]

Dislin::setpag da4p
Dislin::scrmod revers
Dislin::metafl cons
Dislin::disini 
Dislin::pagera 
Dislin::hwfont 
Dislin::light on
Dislin::matop3 0.02 0.02 0.02 specular

Dislin::clip3d none
Dislin::axspos 0 2500
Dislin::axslen 2100 2100

Dislin::htitle 50
Dislin::titlin "Spheres and Tubes" 4

Dislin::name X-axis x
Dislin::name Y-axis y
Dislin::name Z-axis z

Dislin::labdig -1 xyz
Dislin::labl3d hori
Dislin::graf3d 0.0 30.0 0.0 5.0 0.0 30.0 0.0 5.0 0.0 30.0 0.0 5.0
Dislin::title 

Dislin::shdmod smooth surface

set iret [Dislin::zbfini]
Dislin::matop3 1.0 0.0 0.0 diffuse
for { set i 0 } { $i < 17 } { incr i } {
    Dislin::sphe3d [lindex $x $i] [lindex $y $i] [lindex $z $i] 2.0 50 25
}

Dislin::matop3 0.0 1.0 0.0 diffuse
for { set i 0 } { $i < 28 } { incr i } {
    set j [expr 2 * $i]
    set j1 [expr [lindex $idx $j] - 1]
    set j [expr $j + 1]
    set j2 [expr [lindex $idx $j] - 1]
    Dislin::tube3d [lindex $x $j1] [lindex $y $j1] [lindex $z $j1] \
	[lindex $x $j2] [lindex $y $j2] [lindex $z $j2] 0.5 5 5 
}
Dislin::zbffin 
Dislin::disfin 

Some Solids / Tcl

load dislin.so

Dislin::setpag da4p
Dislin::scrmod revers
Dislin::metafl cons
Dislin::disini 
Dislin::pagera 
Dislin::hwfont 
Dislin::light on
Dislin::litop3 1 0.5 0.5 0.5 ambient

Dislin::clip3d none
Dislin::axspos 0 2500
Dislin::axslen 2100 2100

Dislin::htitle 60
Dislin::titlin "Some Solids" 4

Dislin::nograf 
Dislin::graf3d -5.0 5.0 -5.0 2.0 -5.0 5.0 -5.0 2.0 -5.0 5.0 -5.0 2.0
Dislin::title 
 
Dislin::shdmod smooth surface
set iret [Dislin::zbfini]
Dislin::matop3 1.0 0.5 0.0 diffuse
Dislin::tube3d -3.0 -3.0 8.0 2.0 3.0 5.5 1.0 40 20 

Dislin::rot3d -60.0 0.0 0.0 
Dislin::matop3 1.0 0.0 1.0 diffuse
Dislin::setfce bottom
Dislin::matop3 1.0 0.0 0.0 diffuse
Dislin::cone3d -3.0 -3.0 3.5 2.0 3.0 3.0 40 20
Dislin::setfce top

Dislin::rot3d 0.0 0.0 0.0 
Dislin::matop3 0.0 1.0 1.0 diffuse
Dislin::plat3d 4.0 4.0 3.0 3.0 icos

Dislin::rot3d 0.0 0.0 0.0 
Dislin::matop3 1.0 1.0 0.0 diffuse
Dislin::sphe3d 0.0 0.0 0.0 3.0 40 20

Dislin::rot3d 0.0 0.0 -20.0 
Dislin::matop3 0.0 0.0 1.0 diffuse
Dislin::quad3d -4.0 -4.0 -3.0 3.0 3.0 3.

Dislin::rot3d 0.0 0.0 30.0 
Dislin::matop3 1.0 0.3 0.3 diffuse
Dislin::pyra3d -2.0 -5.0 -10.0 3.0 5.0 5.0 4

Dislin::rot3d 0.0 0.0 0.0 
Dislin::matop3 1.0 0.0 0.0 diffuse
Dislin::torus3d 7.0 -3.0 -2.0 1.5 3.5 1.5 0.0 360.0 40 20
Dislin::rot3d 0.0 90.0 0.0 

Dislin::matop3 0.0 1.0 0.0 diffuse
Dislin::torus3d 7.0 -5.0 -2.0 1.5 3.5 1.5 0.0 360.0 40 20
Dislin::zbffin 
Dislin::disfin 

Map Plot / Tcl

load dislin.so

Dislin::metafl xwin
Dislin::disini
Dislin::pagera
Dislin::complx

Dislin::axspos 400 1850
Dislin::axslen 2400 1400

Dislin::name   Longitude X
Dislin::name   Latitude  Y
Dislin::titlin "World Coastlines and Lakes" 3

Dislin::labels MAP XY
Dislin::labdig -1 XY
Dislin::grafmp -180 180 -180 90 -90 90 -90 30

Dislin::gridmp 1 1
Dislin::color  green
Dislin::world

Dislin::color  foreground
Dislin::height 50
Dislin::title
Dislin::disfin

Tex Instructions for Mathematical Formulas / Tcl

load dislin.so

Dislin::setpag da4p
Dislin::metafl cons
Dislin::disini 
Dislin::pagera 
Dislin::complx 
Dislin::height 40

set cstr "TeX Instructions for Mathematical Formulas"
set nl [Dislin::nlmess $cstr]
Dislin::messag $cstr [expr (2100 - $nl) / 2] 100
  
Dislin::texmod on
Dislin::messag {$\frac{1}{x+y}$}  150  400
Dislin::messag {$\frac{a^2 - b^2}{a+b} = a - b$}  1200  400
  
Dislin::messag {$r = \sqrt{x^2 + y^2}}  150  700
Dislin::messag {$\cos \phi = \frac{x}{\sqrt{x^2 + y^2}}$}  1200  700

Dislin::messag {$\Gamma(x) = \int_0^\infty e^{-t}t^{x-1}dt$}  150  1000
Dislin::messag {$\lim_{x \to \infty} (1 + \frac{1}{x})^x = e$}  1200  1000

Dislin::messag {$\mu = \sum_{i=1}^n x_i p_i$}  150  1300
Dislin::messag {$\mu = \int_{-\infty}^ \infty x f(x) dx$}  1200  1300

Dislin::messag {$\overline{x} = \frac{1}{n} \sum_{i=1}^n x_i$}  150  1600
Dislin::messag {$s^2 = \frac{1}{n-1} \sum_{i=1}^n (x_i - \overline{x})^2$} \
 1200  1600

Dislin::messag {$\sqrt[n]{\frac{x^n - y^n}{1 + u^{2n}}}$}  150  1900  
Dislin::messag {$\sqrt[3]{-q + \sqrt{q^2 + p^3}}$}  1200  1900

Dislin::messag {$\int \frac{dx}{1+x^2} = \arctan x + C$}  150  2200
Dislin::messag {$\int \frac{dx}{\sqrt{1+x^2}} = {\rm arsinh} x + C$} \
 1200  2200

Dislin::messag {$\overline{P_1P_2} = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}$} \
               150 2500
Dislin::messag {$x = \frac{x_1 + \lambda x_2}{1 + \lambda}$}  1200  2500
Dislin::disfin 
Zur Redakteursansicht