[ROOT} Anomalous drawing of TGraph and TGraphErrors

From: Tom Roberts <tjrob_at_fnal.gov>
Date: Wed, 17 Dec 2008 12:11:11 -0600


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 Wed Dec 17 2008 - 19:11:17 CET

This archive was generated by hypermail 2.2.0 : Thu Dec 18 2008 - 17:50:01 CET