1
votes

If I set a specific yrange and plot in a pdf terminal with this plot command:

plot "data.dat" u 1:4:5:6 w yerrorbars pt 6 ps 0.5 t "R_t"

errorbars that belong to data points outside the yrange, but end inside the yrange are not shown. How do I force gnuplot to draw those. I already tried "set clip one/two"

3
You can't, and it doesn't make sense if you don't know where the data point is which this part of an errorbar belongs to.Christoph
Thanks for the information. If it makes sense or not depends on the situation. I can't show all data points, because the interesting portion of the graph would become to small, but it would make sense to have visible error bars to indicate the existence of measurements outside the plotting range.MaVo159

3 Answers

1
votes

The only workaround I found is to plot the data 3 times, once for the central point and once for each side of the error bar. Use "-" as symbol for the errorbars and use their own "errorbars" to draw a line to the central point.

0
votes

You could use multiplot to achieve this.

Set your plot to have zero margins, so the axes are on the border of the canvas, and switch of all tics and borders for the first plot.

Switch on the axes, tics etc. again, and do an empty plot that you set at the correct position using set size and set origin. You'll have to do some math to calculate the exact position.

-1
votes

You could modify your data file: Because the central value of the data point is outside the plot range you could set it equal to the errorbar's end point that would be still visible in your plot.

Example:

plot range: set yrange[-2:2]

data point: 1, -3, -1, -4 (x, y, ylow, yhigh)

set data point to: 1, -1, -1, -4

Attention: Since you have to edit your data file you should

  1. Make a copy of the original data file

  2. Be very careful when editing the file

  3. Keep in mind, that when changing the plot range such that the central value of the data point becomes visible you have to use the original data point. Otherwise you will see the correct error bar but there will be no central value plotted. (this is equivalent to setting 'point type' to 0)