Hi there,
When plotting a lego2 and saving it into pdf, it appears to be slightly transparent.
canvas_pal01_contour50.pdf (16.2 KB)
{
gStyle->SetLineScalePS(1) ;
TH2D * histo = new TH2D ("histo","", 3,-3.,3., 3,-3.,3.) ;
histo->SetBinContent(2,2,1.) ;
histo->SetStats(kFALSE) ;
histo->SetLineColor(kBlack) ;
histo->SetLineStyle(1) ;
histo->SetLineWidth(1) ;
Int_t pal=1 ;
Int_t contour=99 ;
gStyle->SetPalette(pal) ;
gStyle->SetNumberContours(contour) ;
TCanvas * canvas = new TCanvas ("canvas","canvas",0,0,800,800) ;
histo->Draw("lego2,fb") ;
canvas->SaveAs(TString::Format("canvas_pal%02d_contour%02d.pdf",pal,contour)) ;
}
This effect is directly related to the number of contours used.
canvas_pal01_contour99.pdf (17.7 KB)canvas_pal01_contour20.pdf (15.1 KB)Actually the problem lies at the interface between 2 faces of different colors.
It does not seem related to the way the pdf file is read or created. I’ve tried several pdf readers and convert tools in vain.
Playing with gStyle->SetLineScalePS() does not help.
This is also not due to the new alpha parameter in TStyle::SetPalette() which by default is 1 (i.e. full opacity). See the plots below obtained with previous versions of Root (I work with the trunk release).
canvas_5.32.00.pdf (19.2 KB)canvas_5.27.04.pdf (19.3 KB)
Any ideas on how to avoid this?
If need be, could it please be fixed?
Cheers,
Z