Re: Problem with printing hatched histograms

Rene Brun (Rene.Brun@cern.ch)
Tue, 08 Jun 1999 14:05:17 +0000


Hi Marco,
The fill styles in the range 2000->2999 are reserved for a future
implementation. The only fill patterns currently supported are
in the range 3000->3100. These patterns are common to X11 and
Postscript.
The macro below draw these patterns.

Rene Brun

//macro pattern.C
void pattern()
{
TCanvas *c1 = new TCanvas("c1","special fill patterns",600,500);
Int_t nx=5, ny=4;
c1->Divide(nx,ny);
Int_t i,j,pat;
TText t;
t.SetTextAlign(22);
t.SetTextSize(0.3);
t.SetTextColor(kRed);
char textpat[10];
pat = 4;
for (Int_t i=0;i<ny;i++) {
for (Int_t j=0;j<nx;j++) {
pat++;
c1->cd(i*nx +j +1);
gPad->SetFillColor(kBlue);
gPad->SetFillStyle(3000+pat);
sprintf(textpat,"%d",3000+pat);
t.DrawText(0.5,0.5,textpat);
}
}
c1->Print("pattern.ps");
gInterpreter->ProcessLine(".!gv pattern.ps");
}

mvl@nikhef.nl wrote:
>
> Hello rooters,
>
> I'n encountering a little problem using hatched histograms. I'm using a
> TH1F *Graph. Setting the hatched style is easiest by:
> Graph->SetFillStyle(2001); On screen, this is perfect, but when I print
> histogram (i.e. make a ps-file), and view the ps-file with Ghostview, it
> results in the following errors:
>
> Loading NimbusSanL-BoldItal font from C:\Program
> Files\gstools\gs5.50\fonts\n019024l.pfb... 2164950 820745 1369354 82098 1
> done.
> Loading NimbusMonL-Regu font from C:\Program
> Files\gstools\gs5.50\fonts\n022003l.pfb... 2205130 861738 1389444 89134 1
> done.
> Loading NimbusMonL-ReguObli font from C:\Program
> Files\gstools\gs5.50\fonts\n022023l.pfb... 2245310 902212 1389444 92942 1
> done.
> Loading NimbusMonL-Bold font from C:\Program
> Files\gstools\gs5.50\fonts\n022004l.pfb... 2285490 946194 1389444 96650 1
> done.
> Loading NimbusMonL-BoldObli font from C:\Program
> Files\gstools\gs5.50\fonts\n022024l.pfb... 2345760 996030 1389444 100366 1
> done.
> Loading StandardSymL font from C:\Program
> Files\gstools\gs5.50\fonts\s050000l.pfb... 2365850 1030390 1409534 109540 1
> done.
> Unrecoverable error: stackunderflow in image
> Operand stack:
> --nostringval-- --nostringval-- 1 1616
>
> --- Begin offending input ---
>
> --- End offending input ---
> file offset = 10232
> gsdll_execute_cont returns -17
>
> Of course, I haven't got a clue what all this means, but it is quite
> serious, since sending the file to the printer produces no result
> whatsoever. Alternatively, I'm trying to use the FillStyles in the
> 3000-range, but their numbering is quite unclear. From earlier experience I
> know, this can work, but Ghostview messes up the picture pretty badly.
>
> Does anyone have similar experiences using root 2.21/2.22 under Windows NT ?
>
> Regards,
>
> Marco van Leeuwen