ROOT
v6-36
Reference Guide
Loading...
Searching...
No Matches
gr004_errors_asym.py
Go to the documentation of this file.
1
## \file
2
## \ingroup tutorial_graphs
3
## \notebook
4
## \preview This tutorial demonstrates the use of TGraphAsymmErrors to plot a graph with asymmetrical errors on both the x and y axes.
5
## The errors for the x values are divided into low (left side of the marker) and high (right side of the marker) errors.
6
## Similarly, for the y values, there are low (lower side of the marker) and high (upper side of the marker) errors.
7
##
8
## \macro_image
9
## \macro_code
10
##
11
## \author Miro Helbich, Jamie Gooding
12
13
import
numpy
as
np
14
import
ROOT
15
16
c2 =
ROOT.TCanvas
(
"c2"
,
""
, 700, 500)
17
18
c2.SetGrid
()
19
npoints = 3
20
xaxis =
np.array
([1.0, 2.0, 3.0])
21
yaxis =
np.array
([10.0, 20.0, 30.0])
22
23
exl =
np.array
([0.5, 0.2, 0.1])
# Lower x errors
24
exh =
np.array
([0.5, 0.3, 0.4])
# Higher x errors
25
eyl =
np.array
([3.0, 5.0, 4.0])
# Lower y errors
26
eyh =
np.array
([3.0, 5.0, 4.0])
# Higher y errors
27
28
gr =
ROOT.TGraphAsymmErrors
(
29
npoints, xaxis, yaxis, exl, exh, eyl, eyh
30
)
# Create the TGraphAsymmErrors object with data and asymmetrical errors
31
32
gr.SetTitle
(
"A simple graph with asymmetrical errors"
)
33
gr.Draw
(
"A*"
)
# "A" = draw axes and "*" = draw markers at the points with error bars
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
tutorials
visualisation
graphs
gr004_errors_asym.py
ROOT v6-36 - Reference Guide Generated on Thu Aug 21 2025 04:30:48 (GVA Time) using Doxygen 1.10.0