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] Move some graph and hist tutorials to better suiting categories #17448

Merged
merged 2 commits into from
Jan 20, 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
2 changes: 1 addition & 1 deletion core/base/src/TColor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ display plots using different palettes on the same pad.
The tutorial multipalette.C illustrates this feature.

Begin_Macro(source)
../../../tutorials/visualisation/graphs/multipalette.C
../../../tutorials/visualisation/graphics/multipalette.C
End_Macro

\since **6.26:**
Expand Down
2 changes: 1 addition & 1 deletion graf2d/gpad/src/TAnnotation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ End_Macro
Another example:

Begin_Macro(source)
../../../tutorials/visualisation/graphs/annotation3d.C
../../../tutorials/visualisation/graphics/annotation3d.C
End_Macro
*/

Expand Down
4 changes: 2 additions & 2 deletions graf2d/graf/src/TGaxis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -675,15 +675,15 @@ and `localtime` give with what gives `TGaxis`. It can be used
as referenced test to check if the time option of `TGaxis` is working properly.

Begin_Macro(source)
../../../tutorials/visualisation/graphs/timeonaxis3.C
../../../tutorials/visualisation/graphics/timeonaxis3.C
End_Macro


The following macro illustrates the use, with histograms axis, of the time mode on the axis
with different time intervals and time formats.

Begin_Macro(source)
../../../tutorials/visualisation/graphs/timeonaxis.C
../../../tutorials/hist/hist061_TH1_timeonaxis.C
End_Macro

*/
Expand Down
2 changes: 1 addition & 1 deletion test/stressGUI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2206,7 +2206,7 @@ void testControlBars()
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 visualisation/graphics/formula1.C","Simple Formula and Functions");
bar->AddButton("surfaces", ".x visualisation/graphs/surfaces.C", "Surface Drawing Options");
bar->AddButton("surfaces", ".x visualisation/graphics/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");
Expand Down
2 changes: 1 addition & 1 deletion tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ set(returncode_1 math/fit/fit2a.C
hist/hist102_TH2_contour_list.C
hist/hist006_TH1_bar_charts.C
hist/hist037_TH2Poly_boxes.C
hist/hist060_TH1_Stats.C
hist/hist060_TH1_stats.C
hist/hist014_TH1_cumulative.C
hist/hist004_TH1_labels.C
hist/hist036_TH2_labels.C
Expand Down
2 changes: 1 addition & 1 deletion tutorials/demos.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void demos() {
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 visualisation/graphics/formula1.C", "Simple Formula and Functions");
bar->AddButton("surfaces", ".x visualisation/graphs/surfaces.C", "Surface Drawing Options");
bar->AddButton("surfaces", ".x visualisation/graphics/surfaces.C", "Surface Drawing Options");
bar->AddButton("fillrandom", ".x hist/fillrandom.C", "Histograms with Random Numbers from a Function");
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");
Expand Down
2 changes: 1 addition & 1 deletion tutorials/demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
bar.AddButton( 'hsimple', r'TPython::Exec( "' + to_run.format('hsimple.py') + '" );', 'Creating histograms/Ntuples on file', "button" )
bar.AddButton( 'hsum', r'TPython::Exec( "' + to_run.format('hist/hsum.py') + '" );', 'Filling Histograms and Some Graphics Options' )
bar.AddButton( 'formula1', r'TPython::Exec( "' + to_run.format('visualisation/graphics/formula1.py') + '" );', 'Simple Formula and Functions' )
bar.AddButton( 'surfaces', r'TPython::Exec( "' + to_run.format('visualisation/graphs/surfaces.py') + '" );', 'Surface Drawing Options' )
bar.AddButton( 'surfaces', r'TPython::Exec( "' + to_run.format('visualisation/graphics/surfaces.py') + '" );', 'Surface Drawing Options' )
bar.AddButton( 'fillrandom', r'TPython::Exec( "' + to_run.format('hist/fillrandom.py') + '" );','Histograms with Random Numbers from a Function' )
bar.AddButton( 'fit1', r'TPython::Exec( "' + to_run.format('math/fit/fit1.py') + '" );', 'A Simple Fitting Example' )
bar.AddButton( 'multifit', r'TPython::Exec( "' + to_run.format('math/fit/multifit.py') + '" );', 'Fitting in Subranges of Histograms' )
Expand Down
3 changes: 3 additions & 0 deletions tutorials/hist/hist004_TH1_labels.C
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ TCanvas *hist004_TH1_labels()
pt->SetFillColor(18);
pt->SetTextAlign(12);
pt->AddText("Use the axis Context Menu LabelsOption");
pt->AddText(" \"a\" to sort by alphabetic order");
pt->AddText(" \">\" to sort by decreasing values");
pt->AddText(" \"<\" to sort by increasing values");
pt->Draw();

return c1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/// \date August 2016
/// \author Olivier Couet

TCanvas *hist060_TH1_Stats()
TCanvas *hist060_TH1_stats()
{
// Create and plot a test histogram with stats
TCanvas *se = new TCanvas;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_graphs
/// \ingroup tutorial_hist
/// \notebook -js
/// This macro illustrates the use of the time mode on the axis
/// with different time intervals and time formats.
Expand All @@ -23,7 +23,7 @@

#include <time.h>

void timeonaxis()
void hist061_TH1_timeonaxis()
{

time_t script_time;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_graphs
/// \ingroup tutorial_hist
/// \notebook
/// Define the time offset as 2003, January 1st.
///
Expand All @@ -8,7 +8,7 @@
///
/// \author Olivier Couet

void timeonaxis2()
void hist062_TH1_timeonaxis2()
{
auto ct2 = new TCanvas("ct2", "ct2", 10, 10, 700, 500);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_graphs
/// \ingroup tutorial_hist
/// \notebook -js
/// Strip chart example.
///
Expand All @@ -17,7 +17,7 @@
#include "TRandom.h"
#include <cstdio>

void seism()
void hist063_TH1_seism()
{

TStopwatch sw;
Expand Down
7 changes: 4 additions & 3 deletions tutorials/hist/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ These examples shows some of the ratioplots
|hist015_TH1_read_and_draw.C|hist015_TH1_read_and_draw.py|Read a 1D histogram from a ROOT File and draw it.|
|hist016_TH1_different_scales_canvas.C||Draw two histograms on one canva using different y-axis scales.|
|hist017_TH1_smooth.C||Histogram smoothing.|
|hist060_TH1_Stats.C||Edit statistics box.|
|hist060_TH1_stats.C||Edit statistics box.|
|hist061_TH1_timeonaxis.C||Use a time axis as an x axis.|
|hist062_TH1_timeonaxis2.C||Use a time axis as an x axis and use a time offset.|
|hist063_TH1_seism.C||Use a time axis as an x axis to show sine signal as a strip chart.|
|hist101_TH1_autobinning.C||Fill multiple histograms with different functions and automatic binning.|

\anchor th2
Expand Down Expand Up @@ -164,8 +167,6 @@ These examples shows some of the ratioplots
|hist051_Graphics_candle_plot_stack.C|Create a THStack with candle plot option.|
|hist052_Graphics_candle_plot_whiskers.C|Create a candle plot showing the whiskers definition.|
|hist053_Graphics_candle_scaled.C|Illustrate what scaling effects on candle and violin charts.|
|hist054_Graphics_logscales.C|Draw parametric functions with log scales.|
|hist055_Graphics_xyplot.C|Draw a curve in an orthogonal axis system.|

\anchor texec

Expand Down
4 changes: 2 additions & 2 deletions tutorials/legacy/benchmarks.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void benchmarks() {
summary->AddText(" graphs/gr001_simple.C");
summary->AddText(" graphs/gr002_errors.C");
summary->AddText(" graphics/tornado.C");
summary->AddText(" graphs/surfaces.C");
summary->AddText(" graphics/surfaces.C");
summary->AddText(" graphs/gr303_zdemo.C");
summary->AddText(" geom/geometry.C");
summary->AddText(" geom/na49view.C");
Expand All @@ -63,7 +63,7 @@ void benchmarks() {
bexec(dir,"graphs/gr001_simple.C");
bexec(dir,"graphs/gr002_errors.C");
bexec(dir,"graphics/tornado.C");
bexec(dir,"graphs/surfaces.C");
bexec(dir,"graphics/surfaces.C");
bexec(dir,"graphs/gr303_zdemo.C");
bexec(dir,"geom/geometry.C");
bexec(dir,"geom/na49view.C");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_graphs
/// \ingroup tutorial_graphics
/// \notebook
/// This example show how to put some annotation on a 3D plot using 3D
/// polylines. It also demonstrates how the axis labels can be modified.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_hist
/// \ingroup tutorial_graphics
/// \notebook
/// Draw parametric functions with log scales.
///
Expand All @@ -9,7 +9,7 @@
/// \date July 2016
/// \author Olivier Couet

void hist054_Graphics_logscales()
void logscales()
{
TCanvas *c1 = new TCanvas("c1", "Various options on LOG scales plots", 0, 0, 700, 900);
c1->SetFillColor(30);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_graphs
/// \ingroup tutorial_graphics
/// \notebook
/// Draw color plots using different color palettes.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_graphs
/// \ingroup tutorial_graphics
/// \notebook
/// Examples of use of the spline classes.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_graphs
/// \ingroup tutorial_graphics
/// \notebook
/// Draw 2-Dim functions.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## \file
## \ingroup tutorial_graphs
## \ingroup tutorial_graphics
## \notebook
## Surfaces example
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_graphs
/// \ingroup tutorial_graphics
/// \notebook
/// This example compares what the system time function gmtime and localtime give
/// with what gives TGaxis. It can be used as referenced test to check if TGaxis
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_hist
/// \ingroup tutorial_graphics
/// \notebook
/// Example showing how to produce a plot with an orthogonal axis system
/// centered at (0,0).
Expand All @@ -10,7 +10,7 @@
/// \date January 2017
/// \author Olivier Couet

void hist055_Graphics_xyplot()
void xyplot()
{
TCanvas *c = new TCanvas("c", "XY plot", 200, 10, 700, 500);

Expand Down
11 changes: 5 additions & 6 deletions tutorials/visualisation/graphs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ These examples are slightly more advanced so will be most useful for more advanc

| **Tutorial** || **Description** |
|------|--------|-----------------|
| gr201_waves.C | | Draw spherical waves interference, using closed and filled TGraphs to hide other plot elements. |
| gr202_textmarkers.C | | Draw a graph with text attached to each point. Uses a [TExec](https://root.cern/doc/master/classTExec.html) function to attach the text to the points. |
| | | |
| gr201_waves.C | Draw spherical waves interference, using closed and filled TGraphs to hide other plot elements. |
| gr202_textmarkers.C | Draw a graph with text attached to each point. Uses a [TExec](https://root.cern/doc/master/classTExec.html) function to attach the text to the points. |


\anchor other
Expand All @@ -97,9 +96,9 @@ These examples show the most complex usage of the graphs functionality.

| **Tutorial** || **Description** |
|------|--------|-----------------|
| gr301_highlight1.C | | How to use the interactive highlight mode on graph, thanks to the TCanvas [HighlightConnect](https://root.cern/doc/master/classTCanvas.html#a462b8dc286a2d29152fefa9b31f89920) method. |
| gr302_highlight2.C | | How to use the interactive highlight mode on graph, thanks to the TCanvas [HighlightConnect](https://root.cern/doc/master/classTCanvas.html#a462b8dc286a2d29152fefa9b31f89920) method. |
| gr303_zdemo.C | | Example of graphs in log scales with annotations and other advanced plot formatting. |
| gr301_highlight1.C | How to use the interactive highlight mode on graph, thanks to the TCanvas [HighlightConnect](https://root.cern/doc/master/classTCanvas.html#a462b8dc286a2d29152fefa9b31f89920) method. |
| gr302_highlight2.C | How to use the interactive highlight mode on graph, thanks to the TCanvas [HighlightConnect](https://root.cern/doc/master/classTCanvas.html#a462b8dc286a2d29152fefa9b31f89920) method. |
| gr303_zdemo.C | Example of graphs in log scales with annotations and other advanced plot formatting. |


\anchor alltutorials
Expand Down
37 changes: 0 additions & 37 deletions tutorials/visualisation/graphs/labels1.C

This file was deleted.

44 changes: 0 additions & 44 deletions tutorials/visualisation/graphs/labels2.C

This file was deleted.

Loading