Hi Brett,
It works for me on my linux RedHat machine:
*******************************************
* *
* W E L C O M E to R O O T *
* *
* Version 3.03/08 4 September 2002 *
* *
* You are welcome to visit our Web site *
* http://root.cern.ch *
* *
*******************************************
FreeType Engine v1.x used to render TrueType fonts.
Compiled for linux with thread support.
CINT/ROOT C/C++ Interpreter version 5.15.54, Aug 18 2002
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0]
Processing test2.C...
root [1]
Cheers, Olivier
--
Org: CERN - European Laboratory for Particle Physics.
Mail: 1211 Geneve 23 - Switzerland
E-Mail: Olivier.Couet@cern.ch Phone: +41 22 7676522
WWW: http://cern.ch/Olivier.Couet/ Fax: +41 22 7677155
On Tue, 3 Sep 2002, Brett Viren wrote:
> Hi,
>
> Should the following work?
>
> //-------------------------------
> // test.C
> TCanvas* canvas = 0;
> TGraph* graph = 0;
> TH1F* hist = 0;
>
> void test(void)
> {
> canvas = new TCanvas("test","test",500,500);
> canvas->cd();
>
> double x[2] = { 0.0, 1.0 };
> double y[2] = { 0.0, 1.0 };
> graph = new TGraph(2,x,y);
> graph->Draw("AC");
>
> hist = graph->GetHistogram();
> hist->SetXTitle("#alpha");
> hist->SetYTitle("#beta");
> graph->Draw();
> }
> // end test.C
> //-------------------------------
>
>
> I find that unless I uncoment the "SetYTitle("#beta")" line, or don't
> use ROOT "latex", I get:
>
>
> -------------------------------------
> shell> root test.C
> *******************************************
> * *
> * W E L C O M E to R O O T *
> * *
> * Version 3.03/08 2 September 2002 *
> * *
> * You are welcome to visit our Web site *
> * http://root.cern.ch *
> * *
> *******************************************
>
> FreeType Engine v1.x used to render TrueType fonts.
> Compiled for linux with thread support.
>
> CINT/ROOT C/C++ Interpreter version 5.15.54, Aug 18 2002
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0]
> Processing test.C...
> root [1]
> *** Break *** segmentation violation
> -------------------------------------
>
>
> Debian x86, ROOT from cvs as of yesterday, GCC 2.95.4.
>
>
> -Brett.
>
>
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:06 MET