pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rotating chart axis labels


From: Ben Pfaff
Subject: Re: Rotating chart axis labels
Date: Tue, 08 May 2012 09:45:09 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

John Darrington <address@hidden> writes:

> On Tue, May 08, 2012 at 06:45:59AM -0700, Ben Pfaff wrote:
>      John Darrington <address@hidden> writes:
>      
>      > I'm trying to further improve the appearance of histograms and other
>      > charts.  One of the problems we still have is the x-axis labels 
> clashing
>      > with one another.
>      >
>      > I think a good solution would be to have them orientated at 45 deg 
> when there
>      > are lots of bins.  This is  what other software does
>      >  (http://www.tulane.edu/~panda2/Analysis2/one-way/histog1.jpg)
>      >
>      > Pango/Cairo makes it quite easy to do this.  But I'm not sure how it 
> would fit
>      > in with our existing code.  For example xrchart_label in 
> src/output/cairo-chart.c
>      > looks like:
>      >
>      > void xrchart_label (cairo_t *, int horz_justify, int vert_justify,
>      >                     double font_size, const char *);
>      >
>      > How do we express rotated text in terms of horizontal and vertical 
> justification?
>      > Maybe  we should generalize this interface?
>      
>      I guess we'd add a new interface that includes a rotation?
>
> You mean just a new argument giving the number of degrees to rotate?  Or do 
> you want to 
> replace the existing interface?  Would the rotation occur before or after 
> "justification"?
> About which point does it get rotated?

I was actually thinking of a new function with the same prototype
as the existing one except for an added "rotation" argument.  The
old function would turn into a simple wrapper around the new one
that passes a rotation of 0.  (If the old function has few
callers, then maybe just changing that function would be OK, but
my guess is that few of the callers will want to rotate text.)

Rotation would occur after justification, around the point of
origin of the text.  For example, if the text is left and bottom
justified, with a rotation of 0 degrees clockwise the text's
baseline would be directly to the right of the current point when
the function is called.  With a rotation of 45 degrees, the
text's baseline would have a slope of -1, below and to the right
of the current point when the function is called.

Other definitions are possible too, but that is one that occurs
to me quickly as a sensible one.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]