[Jprogramming] Bar + Line Plot Alignment
Raul Miller
rauldmiller at gmail.com
Wed Jul 7 23:45:46 HKT 2010
On Wed, Jul 7, 2010 at 11:01 AM, Thomas Costigliola <tcostigl at gmail.com> wrote:
> I needed to draw some bar plots with lines over them and noticed that
> if you don't take special care the points of the line do not
> correspond to the centers of the bars. This can be seen in this
> example:
>> load 'plot'
> DATA=. 1 2 3 2.5 4 0.5 1
> pd 'reset'
> pd 'type bar;barwidth 1'
> pd DATA
> pd 'type line marker;color black;'
> pd (1.5"0)DATA
> pd 'show'
Tthe second plot has little to do with the centers of the bars.
Consider, for example:
pd (1.5"0)0,DATA
If you also want dots in the center, you could try:
pd (1.5"0)0,2#DATA
If there was a way of turning off every other
dot, that might get you want you wanted.
But, basically, your first plot ignores "x" values
and your second plot ignores "y" values, and
the plot mechanism itself has a lot of undocumented
aspects, so I usually avoid it when I want precise control.
--
Raul
More information about the Programming
mailing list