From: Juhász P. <pet...@gm...> - 2018-07-28 20:35:17
|
Hello, I wanted to create a graph where tics on the colorbox are dynamically generated from data. I vaguely recalled that there was a feature for that, and it seemed logical that if there is {x|y}[2]ticlabels() to place tics on the main axes, there should be a cbticlabels to do the same for the colorbox. It seems that this is valid syntax, as the parser accepts it, and I've found the code responsible for it in the source, but it appears to be undocumented, and there are no demos for it either. It also appears to be either half-finished or buggy. A straightforward invocation of `plot fn u 1:2:3:cbticlabels(4)` doesn't work, all tics are placed at position 0 (so in effect there is only one tic label, the last placed). I have to write `plot fn u 1:2:3:3:cbticlabels(4)`, because the tic positions come from the 4th column specification. I see in the source that this is hardcoded with a FIXME comment. This behavior is problematic because it's confusing and goes against expectations, and it produces incorrect results when there are multiple variable specifications in the plot command (`ps var pt var lc pal`), or with plot styles that reserve the fourth column for something else already. See the attached data file and gnuplot script for a self-contained example. The fix, at least from the user's perspective, seems simple: make cbticlabels use the same column that is used for the color data itself. >From the developer's perspective, I realize that this might be hard, because we don't yet know which column to use at the time of parsing the using spec, because an unknown number of `xxx variable` statements may come later. Or - `help pointsize variable` states that variable color is alwasy taken from the last additional column. That we do know. Best regards, Peter Juhasz |