1
votes

Now I installed the gnuplot version 4.6 and want to draw some histogram chart using the tkcanvas terminal, but find some commands don't work:

  1. set style fill solid 1.0

    But the bar is still empty inside

  2. title

    Maybe it is related to the first issue. but in the legend part, beside the title text no bar placed beside to show which color it denotes.

  3. set xtics rotate by -45

    The labels along x axis has no rotation

Here is a short example:

set term tk
set style data histograms
set style histogram clustered
set style fill solid 1.0 border lt -1
set xtics rotate by -45
plot for [col=2:5] "histogramdata.txt" using col:xticlabels(1) title columnheader(col)

OK, based on my study I find what the issue. yes, when use tkcanvas as the terminal, the set style fill solid and set xtics rotate both failed. Them can work well for x11 terminals

so the name for this post should be tkcanvas cann't support gnuplot command like: set style fill....

Any idea?

1
forget to post my code. Sorry for that. - Chris Bao
I've never worked with the tkcanvas terminal, can't help you here. - Christoph
yes,currently the default terminal is unknown for gnuplot. I checked X11,but not install yet. so directly use tk to contain what is produced by gnuplot. - Chris Bao
Ok, based on my study. I find a workaround. Use gif terminal in gnuplot to generate a gif file,which supports fill solid setting for bar charting. And then use tk image command to read in the gif file, which is also supported by default tk package. - Chris Bao
You should consider using the pngcairo terminal which generates higher-quality images than the gif terminal. - Christoph

1 Answers

1
votes

You are doing nothing wrong, the tkcanvas terminal simply doesn't support filled polygons and rotated text, as the test command also tells you:

To see this, use the simple script

set terminal tkcanvas
set output 'test.file'
test

And then, after invoking wish, execute the following Tcl/Tk commands:

source test.file
canvas .c
pack .c
gnuplot .c

which on my system gives

Output of the <code>test</code> command with the <code>tkcanvas</code> terminal