= BLT graph のマーカーを枠外に描画するサンプル == 概要 Tcl/Tk BLT 拡張のgraphでは、マーカーエレメントを用いることでグラフに注釈等を入れることができます。ただし、制限として、マーカーをグラフの枠外に描画することができませんでした。 今回ソースを少しいじって、枠外の描画も実現させることができましたので紹介します。 == 追加した機能 * -markerclippingarea オプション : plot または graph を設定 plotは従来どおり、graphが枠外描画 == サンプルプログラム 枠外に噴出しをつけるサンプルです。 {{{ package require BLT namespace import blt::* wm title . "マーカーでお絵かき" pack [set g [graph .g -plotbackground black]] $g configure -title "マーカーでお絵かき" $g configure -markerclippingarea graph -rightmargin 150 $g axis configure x -title {X Axis} -min 0 -max 20 $g axis configure y -title {Y Axis} -min 0 -max 20 $g marker create polygon -fill red -coords { 5 5 5 10 10 10 10 5 } $g marker create polygon -fill blue -coords { 10 5 10 10 15 10 15 5 } $g marker create polygon -fill #404080 -coords { 15 5 15 10 20 10 20 5 } $g marker create text -outline white -text {Hello world!} -rotate 10 -coords { 15 20 } $g marker create polygon -fill yellow -coords { 17.5 7.5 19.5 5 40 5 40 2 19 2 19 4.5 } $g marker create text -outline black -text {枠外にふきだし!} -coords { 24 3.5 } after 100 {$g snap -format emf CLIPBOARD} }}}