dkogan / feedgnuplot

Tool to plot realtime and stored data from the commandline, using gnuplot.
Other
711 stars 37 forks source link

dataid with space #31

Closed setop closed 6 years ago

setop commented 7 years ago

I'd like to be able to plot data separated by tabs, with data id having space in their names. I use command feedgnuplot --domain --dataid --autolegend --lines --points --exit --dump < sample.txt

With data like :

4<tab>"A"<tab>34
4<tab>"B"<tab>8
5<tab>"A"<tab>15
5<tab>"B"<tab>13
6<tab>"A"<tab>23
6<tab>"B"<tab>16

I got :

set style data linespoints
set grid
set boxwidth 1
histbin(x) = 1 * floor(0.5 + x/1)
set xtics
plot '-'   title "A"   , '-'   title "B"   
4 34
5 15
6 23
e
4 8
5 13
6 16
e

as expected.

With data like :

4<tab>"A space"<tab>34
4<tab>"B space"<tab>8
5<tab>"A space"<tab>15
5<tab>"B space"<tab>13
6<tab>"A space"<tab>23
6<tab>"B space"<tab>16

I got

set style data linespoints
set grid
set boxwidth 1
histbin(x) = 1 * floor(0.5 + x/1)
set xtics
plot '-'   title ""A"   , '-'   title ""B"   
4 space"
5 space"
6 space"
e
4 space"
5 space"
6 space"
e

not what I expect.

dkogan commented 7 years ago

Hi. The intent was to keep everything compatible with existing UNIX parsing tools such as awk or cut or perl -F. So given that, the default behavior is what I want. We COULD implement a 'field separator' flag (again, like in awk and perl) to provide this behavior. Do you want to give me a patch?

Oh, and if all you want is to get a nice curve legend with spaces in it, you can use --legend.

dkogan commented 7 years ago

I mean 'perl -a', not 'perl -F'

dkogan commented 6 years ago

Closing this. I don't think it makes sense to implement this.