Message-ID: <d2a90d32d2bcc2ad4a6a84a6031f05b3@ruby-forum.com>
I've done that...can you tell me how to add tick marks and coordinate
values and possibly even coordinate labels?
FYI
0----10----20----30----40---...
Label: this is the x-axis...
a similar thing for the y-axis...
Do you want to use this from Ruby?
vvvv
<http://perl.codefetch.com/example/da/mptk-code14/Tk/CanvasPlot.pm>
It seems that the package is constructed with standard canvas items only.
Why don't you translate it to Ruby/Tk? 
Anyway, translation is not so difficult, if you can read the Perl source.
For example,
----<Perl/Tk>--------------------------------------------------
if ($y_axis) {
$self->createText(
$x1-$tl, $y2-$x, -text => $l,
%args, -fill => $tcolor,
-font => $lfont, -anchor => $an,
);
} else {
$self->createText(
$x+$x1, $y1+$tl, -text => $l,
%args, -fill => $tcolor,
-font => $tfont, -anchor => $an,
);
}
···
From: Patrick Lynch <lynchnco@patmedia.net>
Subject: Re: CanvasPlot, createPlotAxis and createLinePlot.
Date: Fri, 29 Sep 2006 04:51:28 +0900
---------------------------------------------------------------
----<Ruby/Tk>--------------------------------------------------
if (y_axis) {
TkcText.new(self, x1-tl, y2-x,
args.merge(:text=>l, :fill=>tcolor,
:font=>lfont, :anchor=>an)
)
} else {
TkcText.new(self, x+x1, y1+tl,
args.merge(:text=>l, :fill=>tcolor,
:font=>tfont, :anchor=>an)
)
}
---------------------------------------------------------------
However, if you want to create beautiful graphs,
I recommend you to use BLT ( or Tcllib(Tklib) ) extension.
Current Ruby/Tk has a binding for BLT ( and Tcllib(Tklib) ).
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)