Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tutorials] Modernisation of graph tutorials #17315

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions documentation/users-guide/Graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ gStyle->SetEndErrorSize(np);
The four parameters of **`TGraphErrors`** are: `X, Y` (as in
**`TGraph`**), `X`-errors, and `Y`-errors - the size of the errors
in the `x` and `y` direction. Next example is
`$ROOTSYS/tutorials/visualisation/graphs/gerrors.C.`
`$ROOTSYS/tutorials/visualisation/graphs/gr002_errors.C.`

``` {.cpp}
{
Expand Down Expand Up @@ -670,7 +670,7 @@ produces the next figure.

A **`TGraph2DErrors`** is a **`TGraph2D`** with errors. It is useful to
perform fits with errors on a 2D graph. An example is the macro
`$ROOTSYS/tutorials/visualisation/graphs/graph2derrorsfit.C`.
`$ROOTSYS/tutorials/visualisation/graphs/gr011_graph2d_errorsfit.C`.

## Fitting a Graph

Expand Down Expand Up @@ -702,7 +702,7 @@ root[] gr5->Draw("ALP")
```

For more graph examples see the scripts: `$ROOTSYS/tutorials` directory
`graph.C`, `gerrors.C`, `zdemo.C`, and `gerrors2.C`.
`gr001_simple.C`, `gr002_errors.C`, `gr303_zdemo.C`, and `gr003_errors2.C`.

![A graph with axis titles](pictures/0300005D.png)

Expand Down
4 changes: 2 additions & 2 deletions graf2d/gpad/src/TButton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ void but() {
but3->Draw();

// Create last button with no name. Instead a graph is draw inside the button
// Clicking on this button will invoke the macro $ROOTSYS/tutorials/visualisation/graphs/graph.C
button = new TButton("",".x tutorials/visualisation/graphs/graph.C",0.15,0.15,0.85,0.38);
// Clicking on this button will invoke the macro $ROOTSYS/tutorials/visualisation/graphs/gr001_simple.C
button = new TButton("",".x tutorials/visualisation/graphs/gr001_simple.C",0.15,0.15,0.85,0.38);
button->SetFillColor(42);
button->Draw();
button->SetEditable(kTRUE);
Expand Down
12 changes: 6 additions & 6 deletions graf2d/gpad/src/TControlBar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ will return the name of the last clicked button.
TControlBar bar("vertical");
bar.AddButton("Help to run demos",".x demoshelp.C",
"Explains how to run the demos");
bar.AddButton("framework", ".x graphics/framework.C",
bar.AddButton("framework", ".x visualisation/graphics/framework.C",
"An Example of Object Oriented User Interface");
bar.AddButton("hsimple", ".x hsimple.C",
"An Example Creating Histograms/Ntuples on File");
bar.AddButton("hsum", ".x hist/hsum.C",
"Filling histograms and some graphics options");
bar.AddButton("canvas", ".x graphics/canvas.C",
bar.AddButton("canvas", ".x visualisation/graphics/canvas.C",
"Canvas and Pad Management");
bar.AddButton("formula1", ".x graphics/formula1.C",
bar.AddButton("formula1", ".x visualisation/graphics/formula1.C",
"Simple Formula and Functions");
bar.AddButton("fillrandom", ".x hist/fillrandom.C",
"Histograms with Random Numbers from a Function");
bar.AddButton("fit1", ".x fit/fit1.C",
"A Simple Fitting Example");
bar.AddButton("draw2dopt", ".x hist/draw2dopt.C",
"Drawing Options for 2D Histograms");
bar.AddButton("graph", ".x graphs/graph.C",
bar.AddButton("graph", ".x visualisation/graphs/gr001_simple.C",
"Examples of a simple graph");
bar.AddButton("tornado", ".x graphics/tornado.C",
bar.AddButton("tornado", ".x visualisation/graphics/tornado.C",
"Examples of 3-D PolyMarkers");
bar.AddButton("shapes", ".x geom/shapes.C",
bar.AddButton("shapes", ".x visualisation/geom/shapes.C",
"The Geometry Shapes");
bar.AddButton("file_layout", ".x io/file.C",
"The ROOT file format");
Expand Down
2 changes: 1 addition & 1 deletion graf2d/gviz/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
\ingroup Graphics2D
\brief Interface to the graphing package `graphviz`

- graphstruct.C is an example of the graphviz interface classes usage.
- gr016_struct.C is an example of the graphviz interface classes usage.

2 changes: 1 addition & 1 deletion graf2d/gviz/src/TGraphStruct.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ three classes:
a TGraphStruct.

Begin_Macro(source)
../../../tutorials/visualisation/graphs/graphstruct.C
../../../tutorials/visualisation/graphs/gr016_struct.C
End_Macro

A graph structure can be dumped into a "dot" file using DumpAsDotFile.
Expand Down
2 changes: 1 addition & 1 deletion hist/hist/src/TGraphSmooth.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ClassImp(TGraphSmooth);
/** \class TGraphSmooth
\ingroup Graphs
A helper class to smooth TGraph.
see examples in $ROOTSYS/tutorials/visualisation/graphs/motorcycle.C and approx.C
see examples in $ROOTSYS/tutorials/visualisation/graphs/gr010_approx_smooth.C and $ROOTSYS/tutorials/visualisation/graphs/gr015_smooth.C
*/

TGraphSmooth::TGraphSmooth()
Expand Down
2 changes: 1 addition & 1 deletion hist/hist/src/TGraphTime.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ClassImp(TGraphTime);
TGraphTime is used to draw a set of objects evolving with nsteps in time between tmin and tmax.
Each time step has a new list of objects. This list can be identical to
the list of objects in the previous steps, but with different attributes.
see example of use in $ROOTSYS/tutorials/visualisation/graphs/gtime.C
See example of use in $ROOTSYS/tutorials/visualisation/graphs/gr017_time.C
*/

////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions hist/hist/src/TMultiGraph.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Automatic coloring according to the current palette is available as shown in the
following example:

Begin_Macro(source)
../../../tutorials/visualisation/graphs/multigraphpalettecolor.C
../../../tutorials/visualisation/graphs/gr105_multigraphpalettecolor.C
End_Macro

\anchor MG01f
Expand Down Expand Up @@ -324,7 +324,7 @@ overlap. The following example shows how to make them all visible.


Begin_Macro(source)
../../../tutorials/visualisation/graphs/multigraph.C
../../../tutorials/visualisation/graphs/gr007_multigraph.C
End_Macro

\anchor MG03
Expand Down
2 changes: 1 addition & 1 deletion hist/hist/src/TScatter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ color map and the fourth on the marker size.
The following example demonstrates how it works:

Begin_Macro(source)
../../../tutorials/visualisation/graphs/scatter.C
../../../tutorials/visualisation/graphs/gr006_scatter.C
End_Macro

### TScatter's plotting options
Expand Down
4 changes: 2 additions & 2 deletions hist/histpainter/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
The histograms and graphs plotting options are described in details in the THistPainter and TGraphPainter classes.
Some related tutorials:

- graph.C: Using and drawing a simple TGraph.
- graph2derrorsfit.C: TGraph2D with errors drawing.
- gr001_simple.C: Using and drawing a simple TGraph.
- gr011_graph2d_errorsfit.C: TGraph2D with errors drawing.
- h1draw.C: Drawing Options for 1D Histograms.
- hbars.C: Demo of option bar with histograms.
- hsimple.C: Simple drawing of a 1D Histograms.
Expand Down
12 changes: 6 additions & 6 deletions hist/histpainter/src/TGraphPainter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ case the line width number is interpreted as:
The current fill area attributes are used to draw the hatched zone.

Begin_Macro(source)
../../../tutorials/visualisation/graphs/exclusiongraph.C
../../../tutorials/visualisation/graphs/gr106_exclusiongraph.C
martamaja10 marked this conversation as resolved.
Show resolved Hide resolved
End_Macro

\anchor GrP3
Expand Down Expand Up @@ -530,11 +530,11 @@ is determined according to the number of objects having palette coloring in
the current pad.

Begin_Macro(source)
../../../tutorials/visualisation/graphs/graphpalettecolor.C
../../../tutorials/visualisation/graphs/gr104_palettecolor.C
End_Macro

Begin_Macro(source)
../../../tutorials/visualisation/graphs/multigraphpalettecolor.C
../../../tutorials/visualisation/graphs/gr105_multigraphpalettecolor.C
End_Macro

\anchor GrP6
Expand Down Expand Up @@ -633,18 +633,18 @@ graphically. Point will be highlighted as "point circle" (presented by
marker object). Moreover, any highlight (change of point) emits signal
`TCanvas::Highlighted()` which allows the user to react and call their own
function. For a better understanding please see also the tutorials
`$ROOTSYS/tutorials/visualisation/graphs/hlGraph*.C` files.
`$ROOTSYS/tutorials/visualisation/graphs/gr*_highlight*.C` files.

Highlight mode is switched on/off by `TGraph::SetHighlight()` function
or interactively from `TGraph` context menu. `TGraph::IsHighlight()` to verify
whether the highlight mode enabled or disabled, default it is disabled.

~~~ {.cpp}
root [0] .x $ROOTSYS/tutorials/visualisation/graphs/gerrors2.C
root [0] .x $ROOTSYS/tutorials/visualisation/graphs/gr003_errors2.C
root [1] // try SetHighlight() interactively from TGraph context menu
~~~

\image html hlgerrors2.gif "Highlight mode for graph"
\image html hl_gr003_errors2.gif "Highlight mode for graph"

See how it is used
<a href="classTHistPainter.html#HP30a">highlight mode and user function</a>
Expand Down
20 changes: 10 additions & 10 deletions test/stressGUI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2201,22 +2201,22 @@ void testControlBars()
TControlBar *bar = new TControlBar("vertical", "Demos",10,10);
bar->AddButton("Help Demos",".x demoshelp.C", "Click Here For Help on Running the Demos");
bar->AddButton("browser", "new TBrowser;", "Start the ROOT Browser");
bar->AddButton("framework", ".x graphics/framework.C","An Example of Object Oriented User Interface");
bar->AddButton("first", ".x graphics/first.C", "An Example of Slide with Root");
bar->AddButton("framework", ".x visualisation/graphics/framework.C","An Example of Object Oriented User Interface");
bar->AddButton("first", ".x visualisation/graphics/first.C", "An Example of Slide with Root");
bar->AddButton("hsimple", ".x hsimple.C", "An Example Creating Histograms/Ntuples on File");
bar->AddButton("hsum", ".x hist/hsum.C", "Filling Histograms and Some Graphics Options");
bar->AddButton("formula1", ".x graphics/formula1.C","Simple Formula and Functions");
bar->AddButton("surfaces", ".x graphs/surfaces.C", "Surface Drawing Options");
bar->AddButton("formula1", ".x visualisation/graphics/formula1.C","Simple Formula and Functions");
bar->AddButton("surfaces", ".x visualisation/graphs/surfaces.C", "Surface Drawing Options");
bar->AddButton("fillrandom",".x hist/fillrandom.C", "Histograms with Random Numbers from a Function");
bar->AddButton("fit1", ".x fit/fit1.C", "A Simple Fitting Example");
bar->AddButton("multifit", ".x fit/multifit.C", "Fitting in Subranges of Histograms");
bar->AddButton("h1draw", ".x hist/h1draw.C", "Drawing Options for 1D Histograms");
bar->AddButton("graph", ".x graphs/graph.C", "Example of a Simple Graph");
bar->AddButton("gerrors", ".x graphs/gerrors.C", "Example of a Graph with Error Bars");
bar->AddButton("tornado", ".x graphics/tornado.C", "Examples of 3-D PolyMarkers");
bar->AddButton("shapes", ".x geom/shapes.C", "The Geometry Shapes");
bar->AddButton("geometry", ".x geom/geometry.C", "Creation of the NA49 Geometry File");
bar->AddButton("na49view", ".x geom/na49view.C", "Two Views of the NA49 Detector Geometry");
bar->AddButton("graph", ".x graphs/gr001_graph.C", "Example of a Simple Graph");
bar->AddButton("gerrors", ".x graphs/gr002_errors.C", "Example of a Graph with Error Bars");
bar->AddButton("tornado", ".x visualisation/graphics/tornado.C", "Examples of 3-D PolyMarkers");
bar->AddButton("shapes", ".x visualisation/geom/shapes.C", "The Geometry Shapes");
bar->AddButton("geometry", ".x visualisation/geom/geometry.C", "Creation of the NA49 Geometry File");
bar->AddButton("na49view", ".x visualisation/geom/na49view.C", "Two Views of the NA49 Detector Geometry");
bar->AddButton("file", ".x io/file.C", "The ROOT File Format");
bar->AddButton("fildir", ".x io/fildir.C", "The ROOT File, Directories and Keys");
bar->AddButton("tree", ".x tree/tree.C", "The Tree Data Structure");
Expand Down
10 changes: 5 additions & 5 deletions tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ if (NOT dataframe)
# RDataFrame
list(APPEND dataframe_veto analysis/dataframe/*.C analysis/dataframe/*.py)
# RDataFrame tutorial in graphs
list(APPEND dataframe_veto visualisation/graphs/timeSeriesFromCSV_TDF.C)
list(APPEND dataframe_veto visualisation/graphs/gr109_timeSeriesFromCSV_RDF.C)
# TMVA tutorials dependent on RDataFrame
list(APPEND dataframe_veto machine_learning/tmva*.C)
list(APPEND dataframe_veto machine_learning/TMVA_SOFIE_RDataFrame*.C)
Expand Down Expand Up @@ -244,7 +244,7 @@ if(NOT ROOT_opengl_FOUND)
endif()

if(NOT GRAPHVIZ_FOUND)
set(gviz_veto visualisation/graphs/graphstruct.C)
set(gviz_veto visualisation/graphs/gr016_struct.C)
endif()

if(NOT TBB_FOUND AND NOT builtin_tbb)
Expand Down Expand Up @@ -443,7 +443,7 @@ if(MSVC AND NOT llvm13_broken_tests)
list(APPEND extra_veto
analysis/dataframe/df007_snapshot.C
visualisation/graphics/earth.C
visualisation/graphs/motorcycle.C
visualisation/graphs/gr015_smooth.C
io/ntuple/ntpl001_staff.C)
endif()
endif()
Expand Down Expand Up @@ -511,8 +511,8 @@ set(returncode_1 math/fit/fit2a.C
visualisation/graphics/earth.C
visualisation/graphics/pavetext.C
visualisation/graphics/tmathtext.C visualisation/graphics/tmathtext2.C
visualisation/graphs/exclusiongraph.C
visualisation/graphs/graphstruct.C
visualisation/graphs/gr106_exclusiongraph.C
visualisation/graphs/gr016_struct.C
hist/hist102_TH2_contour_list.C
hist/hist006_TH1_bar_charts.C
hist/hist037_TH2Poly_boxes.C
Expand Down
4 changes: 2 additions & 2 deletions tutorials/demos.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ void demos() {
bar->AddButton("fit1", ".x math/fit/fit1.C", "A Simple Fitting Example");
bar->AddButton("multifit", ".x math/fit/multifit.C", "Fitting in Subranges of Histograms");
bar->AddButton("h1ReadAndDraw", ".x hist/h1ReadAndDraw.C", "Drawing Options for 1D Histograms");
bar->AddButton("graph", ".x visualisation/graphs/graph.C", "Example of a Simple Graph");
bar->AddButton("gerrors", ".x visualisation/graphs/gerrors.C", "Example of a Graph with Error Bars");
bar->AddButton("graph", ".x visualisation/graphs/gr001_simple.C", "Example of a Simple Graph");
bar->AddButton("gerrors", ".x visualisation/graphs/gr002_errors.C", "Example of a Graph with Error Bars");
bar->AddButton("tornado", ".x visualisation/graphics/tornado.C", "Examples of 3-D PolyMarkers");
bar->AddButton("geometry", ".x visualisation/geom/rootgeom.C", "Example of TGeoManager drawing");
bar->AddButton("file", ".x io/file.C", "The ROOT File Format");
Expand Down
12 changes: 6 additions & 6 deletions tutorials/legacy/benchmarks.C
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ void benchmarks() {
summary->AddText(" hist/fillrandom.C");
summary->AddText(" fit/fit1.C");
summary->AddText(" hist/h1ReadAndDraw.C");
summary->AddText(" graphs/graph.C");
summary->AddText(" graphs/gerrors.C");
summary->AddText(" graphs/gr001_simple.C");
summary->AddText(" graphs/gr002_errors.C");
summary->AddText(" graphics/tornado.C");
summary->AddText(" graphs/surfaces.C");
summary->AddText(" graphs/zdemo.C");
summary->AddText(" graphs/gr303_zdemo.C");
summary->AddText(" geom/geometry.C");
summary->AddText(" geom/na49view.C");
summary->AddText(" tree/ntuple1.C");
Expand All @@ -60,11 +60,11 @@ void benchmarks() {
bexec(dir,"hist/fillrandom.C");
bexec(dir,"fit/fit1.C");
bexec(dir,"hist/h1ReadAndDraw.C");
bexec(dir,"graphs/graph.C");
bexec(dir,"graphs/gerrors.C");
bexec(dir,"graphs/gr001_simple.C");
bexec(dir,"graphs/gr002_errors.C");
bexec(dir,"graphics/tornado.C");
bexec(dir,"graphs/surfaces.C");
bexec(dir,"graphs/zdemo.C");
bexec(dir,"graphs/gr303_zdemo.C");
bexec(dir,"geom/geometry.C");
bexec(dir,"geom/na49view.C");
bexec(dir,"tree/ntuple1.C");
Expand Down
86 changes: 0 additions & 86 deletions tutorials/visualisation/graphs/approx.C

This file was deleted.

Loading
Loading