-1

I'm having a very difficult time getting "with lines" to work with gnuplot 4.6. I have a the following styles

set style line 2  lc 7 lt 1 pt 7 lw 1.5
set style line 3  lc 1 lt 1 lw 4.0

and I use the following plot command

plot '-' using 1:2 w lp ls 2 title 'test1','-' using 1:3 w lp ls 3 title 'test2'

NOTE lp in second plot

everything works fine, but I want to remove the data points from the second plot, so I've tried the following command

plot '-' using 1:2 w lp ls 2 title 'test1','-' using 1:3 w l ls 3 title 'test2'

NOTE l in second plot

but it fails to plot anything. The legend indicates that the style was picked up correctly, but there is no plot.

What am I doing wrong? Is there a way to use "linepoints" and shut off the points? I just want a line in the second plot.

ThatsRightJack
  • 721
  • 6
  • 29
  • OK, so it seems to work fine if i write to a file instead of giving the input on the command line. I'm not sure why "linepoints" works and "lines" doesn't from the command line input. – ThatsRightJack Feb 15 '16 at 05:10
  • 1
    You are going to need to provide some sample data for plotting. Your commands are reading in their data interactively from stdin. We have no way of knowing what the data you are trying to plot looks like. – Matthew Feb 15 '16 at 06:31
  • The data doesn't matter. I'm using integer numbers generated in a for loop, say from 1:5. I pass the gnuplot commands above via pipe within a C program. As I said, everything works for "linepoints" but not for "lines". If I write the data to a file it works with "lines" as I hoped for, but I'd like to avoid having to write a bunch of temporary files. – ThatsRightJack Feb 15 '16 at 08:11
  • Basically, I have a for loop that pipes data from an array to gnuplot. It pipes 3 values for each pass in the loop. I'm trying to plot 1:2 with "linepoints" and 1:3 with "lines". If I use "linepoints" for 1:3 it works, but not for "lines" – ThatsRightJack Feb 15 '16 at 08:16
  • Are you pushing the data through twice? With two plot commands reading from stdin, it is necessary to push the data through twice (once for each plot specification). gnuplot will not "remember" the data from the earlier run. – Matthew Feb 15 '16 at 08:26
  • Yes. I tried that. I pipe the 2 plot commands as shown above, then run through the loop once. I then follow up with a pipe "e" to end the data entry, then run through the loop again, and end with "e". – ThatsRightJack Feb 15 '16 at 08:31
  • I don't have the code in front of me. I will post it tomorrow for more investigation if it's something that needs more insight. – ThatsRightJack Feb 15 '16 at 08:33
  • Can you try to use the `'+'` special file? e.g. something like `plot '+' using 1:($1) w lp ls 2 title 'test1', '+' using 1:(2*$1) w lp ls 3 title 'test2'` ? – bibi Feb 15 '16 at 08:54
  • I figured it out. I was passing one to many "\n" characters to pipe. It's interesting that it worked with both commands being "linepoints" but when one was changed to "lines" it did not work. Thanks for the input though. – ThatsRightJack Feb 15 '16 at 21:10
  • Which question is the one we are talking about, on meta. You have 2 with no answers. Recently. – Drew Mar 13 '16 at 00:52
  • @Drew I found out what I was doing wrong with this question. The one I'm stuck on is this one (http://stackoverflow.com/questions/35952998/optimize-symbolic-integral-expression-with-matlab) – ThatsRightJack Mar 13 '16 at 00:57
  • cuz I know two matlab guys. you all set ? Plus it has to age 2 days first. That one is 22hrs old (too early for a bounty). Unlike this one where the bounty link is live – Drew Mar 13 '16 at 00:57
  • @Drew OK. I guess I'll let that simmer for another day. I was unaware that there is a 2 day ageing period. – ThatsRightJack Mar 13 '16 at 01:04

1 Answers1

1

I figured it out. I was passing one to many "\n" characters to pipe. It's interesting that it worked with both commands being "linepoints" but when one was changed to "lines" it did not work. Thanks for the input though.

ThatsRightJack
  • 721
  • 6
  • 29