diff --git a/docs/src/terminals.md b/docs/src/terminals.md index 875cd50..d7893e2 100644 --- a/docs/src/terminals.md +++ b/docs/src/terminals.md @@ -28,7 +28,31 @@ Press the `h` key on the window to display an help message with all available ke ## Plot in a terminal application (`dumb`, `sixel` and `sixelgd`) Gnuplot supports plotting in a terminal application, with no need for X11 or other GUI support, via the `dumb`, `sixel` and `sixelgd` terminals. These are extremely useful when you run Julia on a remote shell through `ssh`, with no X11 forwarding. -The `dumb` terminal uses ASCII characters to draw a plot, while `sixel` and `sixelgd` actually use bitmaps (but require Sixel support to be enabled in the terminal, e.g. `xterm -ti vt340`). A sixel plot on `xterm` looks as follows: +The `dumb` terminal uses ASCII characters to draw a plot, while `sixel` and `sixelgd` actually use bitmaps (but require Sixel support to be enabled in the terminal, e.g. `xterm -ti vt340`). Dumb terminal can be used as follows: + +```jldoctest; setup = :(using Gnuplot; origterm = Gnuplot.options.term) +julia> Gnuplot.options.term = "dumb size 60,15"; + +julia> @gp "plot sin(x)" + + 1 +-------------------------------------------------+ + 0.8 |-+ *+ * + ** ** + * * +-| + 0.6 |-+ * ** * * sin(x) *******-| + 0.4 |*+ * * * * * *+-| + 0.2 |*+ * * * * * *-| + 0 |*+ * * * * * *-| + | * * * * * * *| + -0.2 |-* * * * * * +*| + -0.4 |-+* * * * * * +*| + -0.6 |-+* * * * ** * +-| + -0.8 |-+ * * + ** ** + * * +-| + -1 +-------------------------------------------------+ + -10 -5 0 5 10 + +julia> Gnuplot.options.term = origterm; + +``` +A sixel plot on `xterm` looks as follows: ![](assets/sixelgd.png) The above terminals are available if gnuplot has been compiled with the `--with-bitmap-terminals` option enabled and Libgd (only for `sixelgd`).