Menu

#2648 spiderplot sampe in gnuplot.doc and null lines in the key box

None
closed
nobody
None
2025-04-21
2023-09-02
No

The sample in a document gnuplot.doc may be incorrect for figure_spiderplot.
I think the last line
plot for [i=1:5] $DATA using i:key(1)
shoud be
plot for [i=2:6] $DATA every ::1 using i:key(1)
, or
set datafile columnheaders
plot for [i=2:6] $DATA using i:key(1)

In fact, the script plotstyles.gnu uses the latter one.

Moreover, spiderplot may make null line in key box for the plot title.
For example, in the same sample above, I modified the last line to
set key box
plot for [i=2:6] $DATA using i:key(1) title columnheader
Then the result is attached file. The keybox includes null lines
corresponding plot titles.

1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2023-09-04

    This was a weird one. The problem was actually in creation of the previous figure in the demo. The spiderplot key is incorrect because the previous plot command used data from '+', and the internal flag indicating use of pseudodata was not properly reset. Fixed now (and fix back-ported to version 5.4.9).

     
  • Ethan Merritt

    Ethan Merritt - 2023-09-04
    • status: open --> closed-fixed
    • Group: -->
    • Priority: -->
     
  • Shigeharu TAKENO

    The Bug #2648 is not fixed in the current version (git 6.1, and
    gnuplot-6.0.2).

    (1) The sample in current help document may not be correct.

    $DATA << EOD
             A      B      C      D      E      F
    George  15     75     20     43     90     50
    Harriet 40     40     40     60     30     50
    EOD
    set spiderplot
    set style spiderplot fs transparent solid 0.2 border
    set for [p=1:5] paxis p range [0:100]
    set for [p=2:5] paxis p tics format ""
    set             paxis 1 tics font ",9"
    set for [p=1:5] paxis p label sprintf("Score %d",p)
    set grid spiderplot
    plot for [i=1:5] $DATA using i:key(1)
    

    Gnuplot says

    line 14: warning: Skipping data file with no valid points

    The last "plot" line should be

    plot for [i=2:6] $DATA using i:key(1)
    

    Then gnuplot draw the graph correctly, but the key appear only for
    "George" (see spiderplot1.png with "set key box").

    (2) To make the axis label, we can use "title columnheader". But
    blank keys are made for spiderplot.

    plot for [i=2:6] $DATA using i title columnheader
    

    See spiderplot2.png. The blank key prevens to make correct keys by
    keyentrys. Can we remove blank keys for them in the case using
    "title columnheader" ?

     
  • Shigeharu TAKENO

    spiderplot2.png

     
  • Ethan Merritt

    Ethan Merritt - 2025-04-03
    • status: closed-fixed --> open
     
  • Shigeharu TAKENO

    Sorry, the problem (1) was solved in my first report. Please modify gnuplot.doc to add the line

    set datafile columnheaders

    and from "[i=1:5]" to "[i=2:6]".

    I don't know how to fix the problem (2).

     
  • Shigeharu TAKENO

    I did some tests. I modified the function find_maxl_keys() in boundary.c from
    L1175 ; /* Nothing */
    to
    L1175 continue;

    Then, commands
    (1) plot for [i=2:6] $DATA using i:key(1)
    (2) plot for [i=2:6] $DATA using i title columnheader(i-1)
    (3) plot for [i=2:6] $DATA using i title columnheader(i-1), keyentry with l lt 1 title "George", keyentry with l lt 2 title "Harriet"

    make good results and no blank line appears in the key. But, for the command
    (4) plot for [i=2:6] $DATA using i:key(1) title columnheader(i-1)
    the key may not be correct (spiderplot3.png).

     
  • Ethan Merritt

    Ethan Merritt - 2025-04-07

    Thank you for the report and the analysis.
    I will correct the example script in the documentation.

    The use of "title" does not work for this type of plot. That is exactly why "key" is provided as an alternative.

     
  • Shigeharu TAKENO

    Thank you for the response.
    I think it is not bad feature that axis labels of spiderplot are taken from columnheader strings of data, and now we can use it in the current version of spiderplot by "title columnheader()".
    If it is not appropriate the keyword name "title" for spiderplot, can we use another new name to label axises by columnheader strings for spiderplot (and for parallelplot) ?

     
  • Ethan Merritt

    Ethan Merritt - 2025-04-08

    I fixed the bug the using "title" in a spiderplot produced an extra blank line in the plot key.

     
  • Shigeharu TAKENO

    Thanks. That woks.

     
  • Ethan Merritt

    Ethan Merritt - 2025-04-21
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB