Hi Steffen,
specify your font with precision 3 where font size is given in pixels.
Like:
. graph1->GetXaxis()->SetTitleFont(23);
graph1->GetXaxis()->SetTitleSize(10);
See description of class TAttText.
Cheers, Fons.
On Thu, 2002-03-21 at 13:08, Steffen Grohmann wrote:
> Hello,
>
> Setting TTF size of titles and axis labels in histograms and graphs, I
> have to enter relative values according to the NDC:
>
> e.g. graph1->GetXaxis()->SetTitleFont(22);
> graph1->GetXaxis()->SetTitleSize(0.04);
>
> Now, if I have two graphs in one canvas, which do not have the same
> size, the same values of SetTitleSize() result in different text sizes
> in the two graphs due to the different NDCs.
> Trying to find a conversion factor I noticed that the ratio of the
> diagonals (in pixel dimensions) seems to work quite well:
>
> e.g. d1 = sqrt(deltax1^2 + deltay1^2) {measured by hand from a plot}
> d2 = sqrt(deltax2^2 + deltay2^2) { -"- }
> graph1->GetXaxis()->SetTitleFont(22);
> graph1->GetXaxis()->SetTitleSize(0.04);
> graph2->GetXaxis()->SetTitleFont(22);
> graph2->GetXaxis()->SetTitleSize(0.04*d1/d2);
>
> This is a rather awkward procedure, where I didn't manage to
> automatically retrieve the deltax and deltay values.
>
> Is there any method to define the text size of TTF as an absolute size
> in order to have consistent text scaling in a canvas of multiple graphs?
>
> I noticed a difference for using TPaveLabels and TPaveText as well. For
> TPaveText the scaling seems to follow the scaling of the graph, whereas
> the text scaling in TPaveLabels seems to depend on the height of the
> label.
>
> I think it would be handy to be able to scale the text with the size of
> the entire canvas to have the same sizes in all sub-pads.
>
> Regards, Steffen
--
Org: CERN, European Laboratory for Particle Physics.
Mail: 1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch Phone: +41 22 7679248
WWW: http://root.cern.ch/~rdm/ Fax: +41 22 7679480
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:46 MET