From: sfeam (Ethan Merritt) <eamerritt@gm...>  20121020 18:37:56

On Saturday, 20 October 2012, Daniel J Sebald wrote: > > Scenario: one might think that a series of points connected > > by lines could be drawn as > > P(x1,y1) V(x2,y2) P(x2,y2) V(x3,y3) ... > > But that doesn't work because P(x1,y1) doesn't leave the current > > position at (x1,y1). So instead one needs to do > > P(x1,y1) M(x1,y1) V(x2,y2) P(x2,y2) M(x2,y2) V(x3,y3) ... > > My point is that all the M commands may seem redundant but they are not. > > [NB: This is not the ordering produced by "with linespoints"] > > Might it pay to add another symbol that means both P (draw point) and M > (move)? No. If you wanted to make P(x,y) leave the current position at (x,y) you'd modify the point drawing code in gnuplot_x11. But then you pay the price, admittedly a very small price, of executing an extra move that is unnecessary in virtually all cases. > I'd guess for some plots with many points, the data stream > consists mainly of P/M commands. If the plot contains only points then no move commands are necessary, since the term>point(x, y, pointtype) already contains the coordinates. From what I've seen in working on other terminal types, the most common types of redundancy in order of frequency are (1) successive set_color or linetype commands that do nothing. This happens when the core routines loop over some set of objects expecting each one to require a new lt or color, but then some of them are not actually drawn (out of range, blank text label, both linetype and color are given but the latter supercedes the former, ...) So you get set color for point 1 (oops, no point 1) set color for point 2 (oops, no point 2) set color for point 3 (oops, point 3 has its own color spec) set _real_ color for point 3 draw point 3 (2) a sequence of vector() commands that are effectively duplicates due to the coarse screen resolution. (3) a sequence of line segments drawn independently but nevertheless arranged headtotail: M(x1,y1) V(x2,y2), M(x2,y2) V(x3,y3), ... (4) a sequence of move() commands, of which only the last one is needed I suspect only (1) and (2) are worth worrying about in practice, although you could probably construct some pathological examples of other redundancy. 