#1281 Textcolor variable and linecolor variable inconsistent

closed-accepted
nobody
None
5
2015-03-23
2013-09-10
No

Hi,

the behaviour of lc variable and tc variable is inconsistent, the documentation says:

lc variable tells the program to use the value read from one column of the input data as a linetype index, and use the color belonging to that linetype. This requires a corresponding additional column in the using specifier. Text colors can be set similarly using tc variable.

Now, tc variable always uses a linetype, while lc variable uses a linestyle, if avaible, and the linetype otherwise.

Consider the following example. In the upper plot, both points and labels use the respective linetype. In the lower plot, after defining some linestyles, the points use the linestyles, and the labels still use the linetype:

$db <<EOF
first 1
second 2
third 3
EOF

set offsets 0.5,0.5,0.5,0.5
unset key
set multiplot layout 2,1

plot $db using 2:2:2 with points pt 7 lc variable,\
     $db using 2:2:1:2 with labels offset -1,1 tc variable

set style line 1 lc rgb "aquamarine"
set style line 2 lc rgb "coral"
set style line 3 lc rgb "#eeee00"
replot
unset multiplot

Should tc variable also use the line styles? Or is lc variable buggy and should not use the linestyle? Or should the documentation be adapted accordingly?

I attach the output of the above script, as produced using the current CVS version.

Thanks,
Christoph

1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2013-09-10

    lc variable should increment over line types, as documented, unless the option "set style increment user" is selected. The relevant line of code somehow went missing during pre-4.6 code reorganization. Fixed now in CVS for 4.6 and 4.7

     
  • Christoph Bersch

    Thanks! Do you think it make sense to have textcolor variable also respect the settings of set style increment user in order to be consistent with linecolor variable?
    I tried to figure out, how to apply that in the code, but I guess it would take quite long...

     
  • Ethan Merritt

    Ethan Merritt - 2013-09-11

    Yes, good point.
    I have made that change in store_label() for both 4.6 and 4.7

     
  • Ethan Merritt

    Ethan Merritt - 2013-09-11
    • status: open --> pending-fixed
     
  • Christoph Bersch

    Almost done... It is still missing for the point flag of the labels plotting style. See the following script for testing:

    reset
    set style increment default
    $db <<EOF
    first 1
    second 2
    third 3
    EOF
    
    set style line 1 lc rgb "aquamarine"
    set style line 2 lc rgb "coral"
    set style line 3 lc rgb "#eeee00"
    
    set offsets 0.5,0.5,0.5,0.5
    unset key
    set multiplot layout 2,2
    
    plot $db using 2:2:1:2 with labels tc variable point pt 7 lc variable  offset -1,1
    
    set style increment user
    replot
    
    set style increment default
    plot $db using 2:2:1:2 with labels offset -1,1 tc variable ,\
         $db using 2:2:2 with points lc variable pt 7
    
    set style increment user
    replot
    
    unset multiplot
    

    For this, finally, I could fix it myself. Thanks to diffing your previous changes :-)

    Christoph

     
  • Ethan Merritt

    Ethan Merritt - 2013-10-01
    • status: pending-fixed --> closed-accepted
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks