coordinate system

The PPlot plot engine uses in all calls to the Painter class "screen
coordinates". The screen coordinate system is relative to the widget. The
top-left position of the widget corresponds to (x=0,y=0) and the bottom-right
to (x=widget-width, y=widget-height).

basic functions

Once you understand the coordinate system, the first three functions, DrawLine,
FillRect and SetClipRect are self explanatory.

Geometry functions

The next two functions, GetWidth and GetHeight, should
return, as you might have guessed, the Width and the Height of the widget.

Color

Colors are specified by RGB tuples, so that (0,0,0) = black, and
(255,255,255) = white. The function SetLineColor should set the
color for lines and text, and SetFillColor should set the color
used in FillRect.

Text functions

In order to align texts, PPlot needs to know how large a string will be
when it is drawn in the particular font that you are using. That is the purpose
of the function GetTextDrawSize: it should return the draw width
of the string. The function GetFontHeight should return the Height
of the particular font that you use. The function DrawText should
draw a text relative to the position (x,y), pointing to the bottom-left of
the text. Then there is the inevitable DrawRotatedText. The idea
is that you pin down the horizontal text at position (x,y), pointing again
to the bottom-left of the text. Next you rotate the required nr. of
degrees about this point. (Because the y coordinate runs up on going down
on the screen the sign of the angle is reversed.) You can check the implementations
with the "PainterTester" plot that
features a horizontal and vertical text bordered by an "ascent" line and
a "descent" line.