Hello all,
does someone know how to draw a TPave without a shadow?
Thanks a lot
Rene
Hello all,
does someone know how to draw a TPave without a shadow?
Thanks a lot
Rene
One possible way:
TPaveText *pt = new TPaveText(0.01,0.9,0.4,0.9,“blNDC”);
pt->SetBorderSize(1);
Olivier
[quote=“couet”]One possible way:
TPaveText *pt = new TPaveText(0.01,0.9,0.4,0.9,“blNDC”);
pt->SetBorderSize(1);
Olivier[/quote]
I tried this, but doesn’t seem to work. I still get a shadow in the box.
I get no shadow with this:
{
//=========Macro generated from canvas: c1/c1
//========= (Fri Mar 17 15:21:20 2006) by ROOT version5.11/01
TCanvas *c1 = new TCanvas("c1", "c1",15,47,700,500);
c1->Range(0,0,1,1);
c1->SetFillColor(0);
c1->SetBorderSize(2);
c1->SetFrameBorderMode(0);
TPaveText *pt = new TPaveText(0.274425,0.351695,0.768678,0.709746,"blNDC");
pt->SetBorderSize(1);
pt->SetFillColor(19);
pt->Draw();
c1->Modified();
c1->cd();
c1->SetSelected(c1);
}
hi olivier,
I am using commands in my rootlogon.C so that my canvas conforms to my experiment’s standard, so I am not sure if I want to make the changes you suggest to the canvas.
However, I tried pt->SetFillColor(19), but it doesn’t work. The box still has a shadow.
I do the following in my macro,
TCanvas c1;
c1.Divide(2,2);
gStyle->SetOptStat(0);
histA->Draw(“e”);
TPaveStats *pt=new TPaveStats(0.7,0.75,0.8,0.85,“blNDC”);
pt->AddText("(a)");
pt->SetBorderSize(1);
pt->SetFillColor(19);
pt->Draw();
c1_2.cd();
…
Also, the text (a) comes out boldfaced. How do I make it regular font?
vivek
The following macro gives me the attached plot which, seems to me, is what you are requesting.
{
TCanvas c1;
c1.Divide(2,2);
gStyle->SetOptStat(0);
hpx->Draw("e");
TPaveStats *pt=new TPaveStats(0.7,0.75,0.8,0.85,"blNDC");
pt->SetTextFont(40);
pt->AddText("(a)");
pt->SetBorderSize(1);
pt->Draw();
}
ah, sorry, I used wrong terminology.
I want to get rid of the gray background in the box.
also, I want to make the (a) not boldface.
lastly, can I get rid of the boundary around (a).
So, basically, I just want (a) sitting in one corner of the plot.
vivek
pt->SetFillStyle(0);
the font is choosen thanks to:
pt->SetTextFont(40);
it is not bold. It is helvetica. Helvetica bold is 60
// 10 : times-medium-i-normal timesi.ttf
// 20 : times-bold-r-normal timesbd.ttf
// 30 : times-bold-i-normal timesi.ttf
// 40 : helvetica-medium-r-normal arial.ttf
// 50 : helvetica-medium-o-normal ariali.ttf
// 60 : helvetica-bold-r-normal arialbd.ttf
// 70 : helvetica-bold-o-normal arialbi.ttf
// 80 : courier-medium-r-normal cour.ttf
// 90 : courier-medium-o-normal couri.ttf
// 100 : courier-bold-r-normal courbd.ttf
// 110 : courier-bold-o-normal courbi.ttf
// 120 : symbol-medium-r-normal symbol.ttf
// 130 : times-medium-r-normal times.ttf
// 140 : wingding.ttf
thanks.
Is it possible to remove the boundary around (a)? I looked at functions like SetLineWidth(0), but they don’t seem to do anything.
pt->SetLineColor(0)
thanks for your help. it works now.
vivek
Note that with all these settings you end up drawing a simple text … May be it would be more logical and efficient to simply draw a TText or a TLatex. But you surely have very good reasons to proceed so.
duh! of course, you are right
I started with TPave because I took it from another macro I have, and never thought of doing a simple TText or TLatex…