Plotting graphs with tkrplot

The following example shows how to plot a graph in a Tk window, using the tkrplot package.

The code listed above gives the following graph window:

It is worth noting that tkrplot places the graph on the clipboard (in Windows or X11) before it plots it on the window. This means that once a graph has been plotted, it can easily be pasted into another program. However, if a second graph is plotted, the first graph will be lost from the clipboard, so the software developer may wish to include a Copy to Clipboard button or menu item on the tkrplot graph window, so that the user can come back to it later and copy it to the clipboard. This can be done using the tkrreplot() function as follows:

The code listed above gives the following graph window: