blt graph element element - add points to a line



Hello,

I'm already trying since a few hours to simple add point, which I
first defined by pen how they should look like to a graph. I
encountered two problems.

1) I'm not sure about the correct parameter arguments "-weight"
seems to expect Integers, but on the below described document they use
"y"?

2) when I'm trying to explicitly pass the x,y coordinates I get
"float value expected" exception

My code looks like the following and I stole it from
http://www.ing.iac.es/~docs/external/tcl/BLT/handouts.pdf ;)

package require Tk
package require BLT
# prepare graph and data
set ::X [ blt::vector #auto ]
$::X seq 0 15 1
set data1 [ blt::vector #auto ]
$data1 set "0.1 2.0 3.3 4.0 4.3 2.4 6.8 5.0 4.6 3.0 2.0 2.0 3.0 3.2
4.0"
set g [blt::graph .g]
$g element create line1 -xdata $::X -ydata $data1 -symbol none -
color blue
pack $g
# add some point at position 2.0 3.3
set x 2.0
set y 3.3
$g pen create pen1 -color red -symbol circle -outline black
$g element configure line1 -weights y -styles { {pen1 $x $y} }


Regards,
Toby
.



Relevant Pages

  • Re: Plot Widget for CPAN
    ... dictionary and I see that "graph" is a much better word. ... general name which might be well used by a more general package. ... interfaces into plot packages. ...
    (comp.lang.perl.tk)
  • Re: ULN2803 current limit
    ... Does that really mean that the whole package can ... The second data sheet is more descriptive. ... This is because of power dissipation ... Look at the graph on page 6. ...
    (sci.electronics.basics)
  • Re: Plot Widget for CPAN
    ... My package does a line graph not a bar graph (bar chart, histogram) or circle graph (pie chart). ...
    (comp.lang.perl.tk)
  • CTAN has a new package: GraphConv
    ... A new package has been installed on tug.ctan.org and will soon make ... Convert Graph files to PSTricks ... GraphConv a small Windows program to convert Graph ... files to PStricks code. ...
    (comp.text.tex)
  • Re: BLT zoomed symbol size
    ... Blt_ZoomStack .graph ... so I can automatically zoom with mouse. ... package require BLT ...
    (comp.lang.tcl)