How to set Axis titles for Tgraph?
See original GitHub issueHey,
Is there a way to name x and y axis? I’ve found this closed issue that was supposed to add the functionality in 5.2, but haven’t found anything in the changelog. There’s nothing about in the JSROOT documentation and fXaxis
and fYaxis
are both undefined for TGraph
objects.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Setting titles for TGraphs - ROOT Forum
Try: graph->SetTitle(“global title;X axis title;Y axis title;Z axis title”);. This works while the ...
Read more >TGaxis Class Reference - ROOT
After an axis has been created, TGaxis::ChangeLabel allows to define new text attributes for a given label. A fine tuning of the labels...
Read more >Re: How to define the x and y axies label on TMultigraph - ROOT
>>> Does anyone help me how to make x and y axis label on TMultigraph? >>> or can anyone guide me to find...
Read more >TGraph Class Reference - ROOT
A TGraph has the default title and name "Graph". To change the default title and name SetTitle and SetName should be called on...
Read more >RootTalk: Re: [ROOT] Setting text size of title of TGraph - CERN
By title i mean the box in upper > left that is set by TCanvas::SetTitle(), not the titles of the axes. I >...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://root.cern/js/latest/api.htm#custom_html_tlegend
Here is example of
TMultiGraph
with customfHistogram
to draw labels instead of numbers. And this is source:https://github.com/root-project/jsroot/blob/master/demo/multigraph_legend.htm
If you have problems, try to create reproducer using web site like https://jsfiddle.net/
Hi,
fXaxis
andfYaxis
objects are not existing inTGraph
- they belong to histogram object, which stored infHistogram
data member. Like in example from #126 you can create histogram object and assigned it to the TGraph:This functionality should be working since jsroot 5.2 - with some adjustments done for 6.0 release.
Regards, Sergey