TABULA/samples/plot test using Function plotline
Jump to navigation
Jump to search
This is SAMPLE (built-in). To work with this sample, enter $
plot test using Function plotline ┌ ┌ ┌ {1} 6 rad angle ├ ┌ │ └>{2} -0.279 / sine ├ ├ └> {3} 0.960 / cosine ├ └> {4} 0.681 / sin+cos └> {5} NO / plot {2}{3}{4} vs {1}
Rationale
This sample shows how to plot a line chart using TABULA.
It is based on a simple t-table, to calculate: (sin a), (cos a) and (sin a + cos a) from a given angle: a (in radians).
There is a more general method, using stept and replot. Extended functionality is provided by menu: File > Plot 0 to (value) and related menu items.
The method described on this page requires a special item (line {5} here), but it offers the end-user a simpler way of displaying a (pre-determined) chart without needing to specify its bounds or format.
Try it out
- Select line {1} then enter 7
Lines {2} {3} and {4} will change to new values. - Select line {5} then enter 1
A line chart will appear, plotting {2} {3} and {4} against item {1} over the range 0 to 7. - Select line {1} then enter 8
Not only will lines {2} {3} and {4} will change to new values, but the line chart will redraw itself to span the range 0 to 8 - Select line {5} then enter 0
The line chart will be frozen, and will no longer redraw itself. - Click the go-away button in the titlebar of the "plot" window to make it disappear.
Build this t-table
- Clear the t-table.
- Edit the title to read: plot test using Function plotline
- Make a new line {1}.
- Convert the quantity of {1} to: 6 rad
- Pick the "sine" function from tab: Functions
At this point you should see:
plot test using Function plotline {1} 6 rad unit ┌ {2} 1 rad a:feeder └>{3} @ 0.841 / sine
- Merge {1} into the feeder line {2} to yield:
plot test using Function plotline ┌ {1} 6 rad unit └>{2} @ -0.279 / sine
- Pick the "cosine" function from tab: Functions
- Once again Merge {1} into the feeder line {3} to yield:
plot test using Function plotline ┌ ┌ {1} 6 rad unit │ └>{2} -0.279 / sine └> {3} @ 0.960 / cosine
- Add {2} and {3} to make a new line {4}
- Rename line {4} sin+cos
- Pick a "plotline" function from tab: Functions. (Pick the line named plot {U} {V} {W} against {X})
At this point you should see:
plot test using Function plotline ┌ ┌ {1} 6 rad unit ┌ │ └>{2} -0.279 / sine ├ └> {3} 0.960 / cosine └> {4} 0.681 / sin+cos ┌ {5} 1 * X:feeder ├ {6} 1 * U:feeder ├ {7} 1 * V:feeder ├ {8} 1 * W:feeder └>{9} 0 * plot {6} {7} {8} against {5}
- As before, merge {1} into the feeder line {5}.
- Likewise merge in-turn {2} {3} {4} into the feeder lines named U:feeder, V:feeder, W:feeder.