I think this is not possible in the most general case because the x label of the last data point will most probably overlap with the previous label. These questions come to my mind: What is the x range? Is it fixed, or can it change? Are the x values date/time numbers? Are the x values equally spaced?