Hi. I just hit an issue that's identical to the one in bug 1709. The test case in 1709 works ok, but this new data is still problematic. To reproduce I have this tst.gp script:
plot '-' using 1:2:3:4 notitle with vectors ,'-' using 1:2:3:4 notitle with vectors ,'-' using 1:2:3:4 notitle with vectors ,'-' using 1:2:3:4 notitle with vectors ,'-' using 1:2:3:4 notitle with vectors
0.095 -0.581 0.332110639476 0.943079108763
0.095 -0.581 -0.00579643957202 -0.016462057844
0.095 -0.581 0.943222775771 -0.332161219236
e
0.119105016471 0.420544462544 0.332012099611 0.943180562645
0.119105016471 0.420544462544 -0.00759522547312 -0.0114971202323
0.119105016471 0.420544462544 0.943244697075 -0.332082102458
e
0.095 -0.567 -0.3090944652 0.95095203906
0.095 -0.567 -0.00452367945605 -0.0143157022401
0.095 -0.567 0.95101974974 0.309004363344
e
0.0792652681939 0.42916557448 -0.315191119053 0.948993084282
0.0792652681939 0.42916557448 -0.00372523495315 -0.00973898724515
0.0792652681939 0.42916557448 0.949020072276 0.315143926804
e
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
0.0 0.0 0.0 0.0
e
Plotting this works OK, but on a replot, the axis extents a recalculated, and much of the plot becomes obscured.
I forgot to mention: this is from the bleeding edge gnuplot from the repo.
Gnuplot does not do a full recalculation of the data ranges on "replot" in the example because the data came from '-' and is not re-readable. One work-around is to explicitly save the ranges orgiinally calculated:
set xrange [:] writeback
set yrange [:] writeback
plot ... complicated inline data ...
set xrange restore
set yrange restore
replot # should now work
Hi. Thanks for the reply. You were correct: the inline nature of this data is
what was tickling this bug. Two questions:
Bug 1709 was very similar, but somebody (you?) ended up fixing it without
requiring the workaround. Could a similar fix be applied here?
I didn't know about the writeback functionality. This sounds like a good,
general method that should be utilized more by default. How about this logic:
when plotting:
if( we have only inline data)
{
save writeback
}
when replotting:
if( we have only inline data &&
current plot ranges are those
computed from the autoranging )
{
restore writeback
}
If a plot command contains only inline data, then we know the replot is
getting the exact same data as before, so the original computed ranges are known
to be correct. Unless the user has touched something by zooming around, in which
case we should probably leave it alone.
This wouldn't affect plots containing no inline data at all, and mixed plots
would still be broken, but that's probably not a very common use case.
This particular example of the problem is due mostly to the fact that the simplified autoscale for volatile data did not take into account the coordinates of vector heads, only the vector tails. I have fixed that in cvs for 5.2 and 5.3.
But the general case problem remains. For example your example in Bug #1948 using splot rather than plot triggers some other error that I do not recognize, separate from the issue of heads vs tails. It is an interesting idea to use the "autoscale writeback" mechanism every time there is volatile data. I will think about that.