Hi Rene, I know gPad->SetEditable() but that's not a good solution. Perhaps it would be wise to have an "active" or "editable" option bit for every object. Then you can allow to edit one TPaveText but lock another one on the same pad. Best, Anton -----Original Message----- From: Rene Brun [mailto:brun@pcbrun.cern.ch] Sent: Saturday, March 04, 2000 4:28 PM To: Anton Fokin Cc: Rene Brun; roottalk@pcroot.cern.ch Subject: Re: Another TGraph question Hi Anton, You can set the pad not editable via gPad->setEditable(kFALSE); You can still locate, use the context menu, but the functions ExecuteEvent return immediatly. One could imagine a TGraph::SetEditable function or like for histograms a switch to enable/disable the editing of a graph. Rene Brun On Fri, 3 Mar 2000, Anton Fokin wrote: > Hi Rene and others, > > Just a question ... If I have a graph with a lot of points, it is not easy > to pick with mouse something in-between of them to move the whole graph up > and down. Also it is a bit confusing for a user when he/she clicks on a > graph, then a number of points becomes shown at once, then he/she drags and > drops a point and then you know what happens, but she/he doesn't -> panic > and run away. Is it possible to turn off this functionality in some > applications? > > Best regards, > Anton > > -----Original Message----- > From: brun@pcbrun.cern.ch [mailto:brun@pcbrun.cern.ch]On Behalf Of Rene > Brun > Sent: Friday, March 03, 2000 11:49 AM > To: Anton Fokin > Cc: Rene Brun; roottalk@pcroot.cern.ch > Subject: Re: TGraph drawing options > > > Hi Anton, > You will get may be some more inspiration from the macro below. > This macro exploits the power of the list of functions > associated with a TH1 object. The list of objects there > is obviously persistent. Just check it after having run the macro, > you can start a new session with > Root > TFile f("anton.root"); > Root > hgr->Draw("p"); > > Also in the macro, note the way to specify clipping to the frame > boundary > in a pad (this applies to markers, polymarkers, lines and graphs). > > I am reluctant to add this kind of functionality to TGraph. > I would like this class to be a light weight class (already too big). > If I implement an additional member as you suggest to support > color for each marker, the next client will request another array > to specify different marker styles and why not marker colors. > This is so simple to implement with TMarker. > > Rene Brun > > { > gROOT->Reset(); > gStyle->SetPalette(1); > gStyle->SetOptStat(0); > c1 = new TCanvas("c1"); > c1->SetBit(TGraph::kClipFrame); > > TFile *f = new TFile("anton.root","recreate"); > const Int_t n = 20; > TH1F *hgr = new TH1F("hgr","a simple graph",n,0.5,n+0.5); > hgr->SetMarkerStyle(21); > hgr->SetXTitle("X title"); > hgr->SetYTitle("Y title"); > for (Int_t i=1;i<=n;i++) { > hgr->SetBinContent(i,10*sin(0.1*i)); > TMarker *m = new TMarker(hgr->GetBinCenter(i), > 0.5*hgr->GetBinContent(i),22); > m->SetMarkerColor(2*i+60); > hgr->GetListOfFunctions()->Add(m); > } > TPaveLabel *pl = new TPaveLabel(6,1,20,2.2, > "To show GetListOfFunctions persistency"); > hgr->GetListOfFunctions()->Add(pl); > hgr->Draw("p"); > hgr->Write(); > } > > > Anton Fokin wrote: > > > > Hi Rene, > > > > this is not exactly a solution I want to have. A set of markers is not a > > graph, isn't it? Apart from not be able to handle it as a single object > > (i.e. read, write, send, change attributes for each point at once), you > have > > some problems with drawing, for example with clipping (on zoom you get > > points painted outside the histogram). > > > > Best, > > Anton > > > > -----Original Message----- > > From: Rene Brun [mailto:brun@pcbrun.cern.ch] > > Sent: Thursday, March 02, 2000 11:06 PM > > To: Anton Fokin > > Cc: Rene Brun; roottalk@pcroot.cern.ch > > Subject: Re: TGraph drawing options > > > > Hi Anton, > > What you want is already implemented. I show two methods > > in the example below> I hope it is clear enough. > > > > Rene Brun > > > > { > > gROOT->Reset(); > > gStyle->SetPalette(1); > > gStyle->SetOptStat(0); > > c1 = new TCanvas("c1"); > > c1->SetGrid(); > > > > const Int_t n = 20; > > TH1F *hgr = new TH1F("hgr","a simple graph",n,0.5,n+0.5); > > for (Int_t i=1;i<=n;i++) hgr->SetBinContent(i,10*sin(0.1*i)); > > hgr->SetMarkerStyle(21); > > hgr->SetXTitle("X title"); > > hgr->SetYTitle("Y title"); > > hgr->Draw("p"); > > for (Int_t j=1;j<=n;j++) { > > TMarker *m = new TMarker(hgr->GetBinCenter(j), > > 0.5*hgr->GetBinContent(j),22); > > m->SetMarkerColor(j); > > m->Draw(); > > } > > } > > > > On Thu, 2 Mar 2000, Anton Fokin wrote: > > > > > Hi rooters! > > > > > > I think it would be nice to have a mode in which point number is drawn > as > > a > > > marker for TGraph. It is very useful if you want to plot, for example, > > > points from an event generator running with different sets of initial > > > conditions, i.e. 1,2,3,4,5 and you want to see a correspondence between > > set > > > number and a point on the graph. > > > > > > It would be nice of course to have an opportunity to set different > > > colors/attributes for every graph point, but it is not easy to > implement. > > > Well, it is easy if Rene adds a "fZ" array with point colors and then > > > changes a bit Paint function :) > > > > > > Best regards, > > > Anton > > > >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:20 MET