Why isn't my code producing a graph with a log scale in C++?

  • Context: C/C++ 
  • Thread starter Thread starter lavster
  • Start date Start date
  • Tags Tags
    C++ Scale
Click For Summary

Discussion Overview

The discussion revolves around a coding issue related to generating a graph with a logarithmic scale in C++ using the ROOT framework. Participants explore the problem of the graph not displaying as intended despite attempts to implement a log scale.

Discussion Character

  • Technical explanation, Debate/contested, Meta-discussion

Main Points Raised

  • One participant shares their code snippet and describes the issue of not achieving a log scale in the graph despite using the SetLogy function.
  • Another participant inquires about the library or package being used, noting that the functions mentioned are not part of standard C++.
  • A third participant clarifies that the code is related to the ROOT package from CERN, suggesting that the original poster consult the ROOT documentation or forums for further assistance.
  • The original poster acknowledges the clarification and expresses intent to explore the suggested resources.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the specific cause of the issue, and the discussion remains unresolved regarding the implementation of the log scale in the graph.

Contextual Notes

There is a lack of clarity regarding the specific functions and their expected behavior within the ROOT framework, as well as the original poster's familiarity with the coding environment.

Who May Find This Useful

Individuals working with the ROOT framework for data visualization in C++ and those encountering similar issues with graph scaling may find this discussion relevant.

lavster
Messages
213
Reaction score
0
can someone tell me what is wrong with my code. i get the graph that i want but not with the log scale... i have tried multiple methods. this is the last one i tried (its part of a canvas which is split into quadrants)

TH1F* h3 = (TH1F*) inputfile3 -> Get("pdg");
c->cd(3);
h3->GetXaxis()->SetTitle("pdg code (high)");
h3->Draw();

c->Modified();
c->Update();
c->SetLogy(1);
c->Modified();

and then onto other quadrant...

thanks :)
 
Technology news on Phys.org
Which library or package are these from? They're not part of the standard C++ language.
 
sorry i don't quite understand your question (my understanding of comp is very limited). ROOT? and I've called them the histograms from another .C macros thing

thanks
 
I did a Google search for some of the function names. You're using the ROOT package from CERN. They have a whole website about ROOT:

http://root.cern.ch/drupal/

It includes a forum, where you might try asking your question if you can't find your answer in the documentation or a FAQ:

http://root.cern.ch/phpBB3/
 
Last edited:
ill have a look - cheers!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
11K
Replies
9
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K