Re: draw TF1 without axes

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Sat, 14 Mar 2009 17:31:31 +0100

Roger,

1-Your function has always values in y > 1, so you cannot see it in your canvas range.
2-You should draw the function with option "csame" instead of "ac"

Rene Brun

Roger Mason wrote:
> Hello,
>
> I'd like to draw a TF1 without any axes or frame on a canvas on which I
> have sketched axes as arrows. I saved the canvas with the sketched
> arrows and added the TF1 in a editor.
>
> {
> //=========Macro generated from canvas: canv/pdv
> //========= (Sat Mar 14 10:45:27 2009) by ROOT version5.20/00
> TCanvas *canv = new TCanvas("canv", "pdv",25,74,1024,818);
> canv->ToggleEventStatus();
> canv->Range(0,0,1,1);
> canv->SetBorderSize(0);
> canv->SetFrameFillColor(0);
>
> TArrow *arrow = new TArrow(0.1,0.15,0.1,0.9,0.03,"|>");
> arrow->SetFillColor(1);
> arrow->SetFillStyle(1001);
> arrow->SetLineWidth(2);
> arrow->SetAngle(30);
> arrow->Draw();
>
> arrow = new TArrow(0.1,0.15,0.9,0.15,0.03,"|>");
> arrow->SetFillColor(1);
> arrow->SetFillStyle(1001);
> arrow->SetLineWidth(2);
> arrow->SetAngle(30);
> arrow->Draw();
>
> TF1* f1 = new TF1("f1","1/x", 0.3,0.7);
> f1->Draw("AC");
>
> canv->Modified();
> canv->cd();
> canv->SetSelected(canv);
> canv->ToggleToolBar();
> }
>
> This draws the TF1 with a frame and hides the drwan arrows. How can I
> hide the frame and display the arrows?
>
> Thanks,
> Roger
>
>
Received on Sat Mar 14 2009 - 17:31:40 CET

This archive was generated by hypermail 2.2.0 : Mon Mar 16 2009 - 05:50:02 CET