1

Hello I have plotted data from three different files against time series. I have used different line colours and line points. I have two questions regarding the line points.

  1. In the plot below the frequency of the line points differ in one of the output. I could not figure out the reason for it as I used the same code for all the three outputs.

    set style line1 lc rgb 83b300 lw 4 pt 4 pi500 ps2

enter image description here

The input files for the dark green and light green colour outputs contains the data in time steps of 0.01 seconds whereas the input file for the orange colour output contain the data in time steps of 0.02. Could it be the reason for different frequency of the line points?

  1. Is it possible to get the line points wiht a phase shift? I mean all the line points should not be alligned in the same vertical line and there should be some phase shift. so that it will be easy to distinguish if all the three outputs fall on the same line
  • `plot ... with linespoints` is just a "shorten": when you use it, Gnuplot makes the same plot when you use `plot ... with lines; plot '' with points` (except the color synchronization). So the 'frequency' of the points depends on the data file. – Tom Solid Jun 29 '16 at 15:32

1 Answers1

0

I think you answered your first question already, since you have a different sampling in one of the three files.

For the second part, you could sample the three files with different time steps that are not divisible by one another, then the point would not align. You could also introduce a shift doing

plot "file" using ($1+0.005):2 ... 

but then the plot would not ultimately reflect the underlying data.

As a final comment, why is your y-range so large?

Vinicius Placco
  • 1,683
  • 2
  • 14
  • 24
  • Thanks for your possible solutions. I cannot change the time steps as it some how standard and I cannot even use the second solution as you have said that it might the plot behaviour. I really appreciate your effort in taking time to provide the solution. Is there any way where we can say the gnuplot to skip some instances of dots or to start at particular instance? Regarding your question it is the default yrange given by gnuplot I though of asking it as a next question. It would be nice if you provide some solution to it or else I will raise it as a new query. – chaitanya majjari Jun 30 '16 at 09:21
  • 1
    You can try the `every` option on the plot (see http://gnuplot.sourceforge.net/docs_4.2/node121.html and http://xmodulo.com/how-to-plot-using-specific-rows-of-data-file-with-gnuplot.html). You'd then say `plot "file.txt" every 2 with linespoints` to plot every other line. That should help. For the y-range, you can use `set yrange[70:90]` – Vinicius Placco Jun 30 '16 at 09:53
  • Thanks for your solution regarding the y range but I have many plots where I have different y ranges. Is it possible to limit the y range for all the plots with some code? – chaitanya majjari Jun 30 '16 at 12:12
  • 1
    Yes, for each plot you'd have to do `set yrange[ymin:ymax]` – Vinicius Placco Jun 30 '16 at 12:24
  • Well I have used it earlier but it does not worked. I have followed the followind discussion http://stackoverflow.com/questions/11269877/gnuplot-minimum-and-maximum-boundaries-for-autoscaling but it did not worked. – chaitanya majjari Jun 30 '16 at 14:49
  • That is weird. Can you post the code you're using to generate the plot? – Vinicius Placco Jun 30 '16 at 21:01
  • Well I have resolved that issue some and thanks for your help, The problem is now with the line points using every 2 would result in the line points similar to that of orange line in the plot I have shown. However, I need something like I should say gnuplot to skip the line points for some data from starting and after that it should continue asusal. Then it looks like I have some phase shaft and easy to distinguish the results. I can say that gnuplot to skip some lines in the stating but in that it also does not draw the graph. – chaitanya majjari Jul 01 '16 at 08:49
  • set ytics y_max/ntics I have used the following comand earlier and it is showing undefined variable y_max – chaitanya majjari Jul 01 '16 at 09:31