Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I view candlestick charts over SSH ?

109 views
Skip to first unread message

Héctor A. Abreu

unread,
Oct 20, 2017, 9:01:33 AM10/20/17
to
Hi,

I need to view some candlestick charts over SSH, so I installed
gnuplot-nox on my Linux server distro (Devuan) and modified the example
shown at:

http://timmurphy.org/2013/03/10/creating-candlestick-charts-with-gnuplot

So my candlestick.gnuplot looks like this:

set terminal dumb
set xdata time
set timefmt"%Y-%m-%d"
set xrange ["2013-02-14":"2013-02-27"]
set yrange [*:*]
set datafile separator ","
plot 'bhp.dat' using 1:2:4:3:5 notitle with candlesticks

Even though I know this ASCII view won't look "pretty", I thought that
at least it would be readable, but the chart is displayed with star (*)
characters, which makes it impossible to read.

Is there any workaround to make a candlestick chart viewable and
readable over SSH ? Perhaps by changing the star (*) character to a
different one in order to do the plotting? If the latter is possible,
how can I change the plotting character? Or do I need to change the
terminal type to something other than dumb?

Sorry if this is a silly question, I am new to gnuplot and I haven't
found an answer in the manuals or the web.

Thank you in advance for any hint or help, even if the recommendation is
to look at another application, I hope not. I like what I have read
about Gnuplot.

Regards,
--
Héctor A. Abreu

Héctor A. Abreu

unread,
Nov 5, 2017, 8:16:49 AM11/5/17
to
I did my research, so I'm sharing what I found to make it work on a
remote terminal (ASCII, via SSH) and in a local terminal (real graph, no
ASCII, displayed inside a terminal, using Gnuplot with Sixel graphics
support).

I. On remote terminal (ASCII, via SSH)

1) On a Debian (Devuan) remote server, instead of installing gnuplot-nox
I installed gnuplot5-nox.

2) The ASCII view can be improved by changing the "size" of the output.
For example, I changed the line "set terminal dumb" to:

set terminal dumb size 150,85

And you can play around with the values. In case the graph won't fit in
your screen, you can still scroll up and down if you pipe the output to
be viewed with the "less" command:

gnuplot candlestick.gnuplot | less

II. On a local terminal (real graph, no ASCII, displayed inside a
terminal). IMPORTANT: the line with "set terminal" will need to look
like this:

set terminal sixelgd

1) Inside a terminal emulator in Xorg:

1.1) You will need Gnuplot version 5 or higher.

1.2) You will need a terminal emulator that supports Sixel graphics. For
example, mlterm can do it out of the box. Xterm can do it if compiled
with "--enable-sixel-graphics". More options can be found at the
libsixel site (see 1.3).

1.3) You will need libsixel. You can get it from:

https://github.com/saitoha/libsixel

I had to get gd first:

sudo aptitude install libgd-dev

And then I compiled libsixel like this:

./configure --with-gd --enable-tests
make
make check
sudo make install

2) With no Xorg, inside the Framebuffer:

2.1) You will need access to the framebuffer (/dev/fb0, /dev/fb1, etc.).
I didn't need to do anything special to have access to that, my Linux
box already had it by default, but I know that some systems need to
create /dev/fb0 and things like that.

2.2) You will need a Framebuffer terminal, like Yaft:

github.com/uobikiemukot/yaft

Once you install it, just get into your TTY (no X) and type:

yaft

To quit, just type "exit".

I hope it helps someone with the same problem I had.

--
Héctor Abreu

Gavin Buxton

unread,
Nov 5, 2017, 9:57:37 AM11/5/17
to
When I ssh I usually allow x forwarding (-X) so that the xterminal just pops up over ssh.

Ethan A Merritt

unread,
Nov 7, 2017, 12:03:43 AM11/7/17
to
Héctor A. Abreu wrote:

>
> I did my research, so I'm sharing what I found to make it work on a
> remote terminal (ASCII, via SSH) and in a local terminal (real graph,
> no ASCII, displayed inside a terminal, using Gnuplot with Sixel
> graphics support).

Those are all good options.
For completeness I point out that there is also a new (version 5) terminal

set terminal dom

To use this you must gnuplot in a domterm terminal emulator
(http://domterm.org). It plots back to the terminal in SVG graphics,
which the terminal catches and displays. This is similar in concept
to running with "set term sixel" inside a vt340-emulating xterm,
except that SVG gets you vector graphics rather than pixel graphics.

Ethan
0 new messages