dkogan/feedgnuplot

Curvestyle not working for '--domain --dataid' ?

pacc opened this issue · 6 comments

pacc commented

This plots two curves 0 and 1:
seq 100 | awk '{print 2_$1, $1%2, ($1%2+1)_$1}'| feedGnuplot --domain --dataid --autolegend

But when I try to add
--curvestyleall 'with dots'
I only get the first curve shown.

Also, can you provide an example of --curvestyle,
what I want to do is set the pointsize to 4 of curve '1' and maybe make the symbol an x

I can't figure out how to address curve 1 and in what gnuplot syntax it takes style commands.

Hi. First of all, the example you mentioned above works for me with "--curvestyleall 'with dots'". The dots are small and a bit difficult to see. Are you SURE you only get the first curve? Try 'with lines' or 'with points' to be sure (you can also do that simply with --points or --lines).

The current feedGnuplot implementation applies --curvestyle options in order given. So the first --curvestyle applies to curve 0, the second to curve 1 and so on. To get what you want (pointsize 4, crosses on curve 1) you can pass in

--curvestyle '' --curvestyle 'lt 2 lw 4'

Thus no extra curve style on curve 0 and the requested curve style on curve 1. This is awkward and at some I'll change it. For now it works, though.

FYI, I just updated the program to make curvestyle work better. If you use the latest version, to make the above work pass in

--curvestyle 1='lt 2 lw 4'

Let me know if something should be improved

pacc commented

Thanks for your quick reply, I'm back at work to test this;
My example was bad - it worked as you say, though i still need some fix for my dataset where my labels are different for different runs.

a) the implementation seem to assume that 'dataid' is 0,1,2 etc - the style below has no effect unless you add 4 more empty styles:
seq 100 | awk '{print $1, ($1%2)+5, ($1%2+1)*$1}'| feedGnuplot --domain --dataid --autolegend --curvestyle '' --curvestyle 'lt -1 pt 5'
If the internal order of curves is sorted by label anyway you should do the enumeration by that order starting with 0. (if the order depends the first occurence in the stream it could get messy)

b) I don't get adressing to work at all unless the dataid starts at 0. This should work for very high numbers aswell as strings:
seq 100 | awk '{print $1, "a" 100_($1%2)+65000, ($1%2+1)_$1}'| feedGnuplot --domain --dataid --autolegend --curvestyle a65100='lt -1 pt 5'

I don't think you're using the latest code. The older (when you created this bug) code used consecutive numbers starting at 0 for --curvestyle and --legend. This is why you're seeing (a) not work above. Then I changed the behavior in response to your report, so that you can address specific curves (as you're doing in (b)). (b) works here just fine, so I suspect you simply need to get the most recent changes. Do note that the updates are not backwards compatible so --curvestyle access in (a) will not work anymore at all. I'm closing the bug. Please reopen if it still doesn't work for you (or if the documentation is wrong).

pacc commented

Sorry,
installed it multiple times and checked the date but an old version
was lurking in /usr/local/bin
(--version would have solved that problem :) )

I'm always for implicit undocumented behaviour (since feedGnuplot is
in perl you know what its about)
But if I feel an itch to change the second curve without knowing it's
label I'll try to hack it myself.
best regards
Patrik C

2011/4/12 dkogan
reply@reply.github.com:

I don't think you're using the latest code. The older (when you created this bug) code used consecutive numbers starting at 0 for --curvestyle and --legend. This is why you're seeing (a) not work above. Then I changed the behavior in response to your report, so that you can address specific curves (as you're doing in (b)). (b) works here just fine, so I suspect you simply need to get the most recent changes. Do note that the updates are not backwards compatible so --curvestyle access in (a) will not work anymore at all. I'm closing the bug. Please reopen if it still doesn't work for you (or if the documentation is wrong).

Reply to this email directly or view it on GitHub:
#4 (comment)

Hi. FYI, I just slightly changed the syntax of --legend and --curvestyle again. The new syntax forgoes the '=', so the style discussed above would be set with

--curvestyle 1 'lt 2 lw 4'

This works better because the curves stay in the order specified on the cmdline (due to some internal implementation details)