RE: [ROOT} Anomalous drawing of TGraph and TGraphErrors

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Thu, 18 Dec 2008 16:09:07 +0100


Hi,

I think that the way you use the editor is very confusing for the editor itself.

  1. you draw the graph "tg" using the option "L" (.x test.C)
  2. in the editor you remove the line option. So the editor think there is no Line option for "tg".
  3. you redraw the same graph "tg" in the same window with other points using again the option "L" but the editor still think this graph is drawn with option "L" (see 2) ). That is why you cannot remove it because the editor thinks it is not there ...

I guess that is from where all the confusion comes from ...

That very confusing way to use the editor. I do not understand why you need something so complicated.

May be redo a new TCanvas each time.. or at least clear le old one ...

Cheers, Olivier

-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Tom Roberts
Sent: Wednesday, December 17, 2008 7:11 PM To: 'ROOT Talk'
Subject: [ROOT] [ROOT} Anomalous drawing of TGraph and TGraphErrors

I often re-scan a plot after it has been displayed, and often want it displayed with "No Line" selected. This screws up, and it is impossible to remove the lines after a re-scan.

     [By re-scan I mean clearing the plot, re-reading a TNtuple
      with new cuts while re-filling the plot, then re-displaying
      it. The attached test.C omits the TNtuple and uses hard-coded
      data for simplicity.]

Save the attached test.C somewhere and do
	root test.C

Use the style editor to select "No Line" and a big Marker (this works). Then type

        scan(true)
Observe that the axis scales changed (as desired), but the points are connected by "Simple Lines" which cannot be removed -- try changing Shape to "Smooth Line" or anything else, and the Simple lines remain.

Exit root and do

        root test.C
Use the style editor to select a big Marker, leaving the Shape as "Simple Line". Then type

        scan(true)
Observe that the axis scales changed (as desired), and the Shape selector now works as desired.

It's somewhat more complicated -- in the first case after scan(true) select "No Line" and then un-check "Show Marker". Before the scan(true) one could not do this (NoLine and ShowMarker disable each other properly), but after it one can (they no longer disable each other correctly). Indeed, two radio buttons can be selected at once -- this may be the root of the problem.

Removing the "L" from the Draw options does not fully solve the problem.

This applies to TGraphErrors as well, for Root 5.12 thru Root 5.20, on Mac, Linux, and Windows.

Can this be fixed?

Tom Roberts Received on Thu Dec 18 2008 - 16:15:58 CET

This archive was generated by hypermail 2.2.0 : Fri Dec 19 2008 - 17:50:02 CET