Home | News | Documentation | Download

How to make the X-axis to "log"

Please read tips for efficient and successful posting and posting code

I have a txt file which the format is like as following: 123.txt (203 字节)
Now, I want to make the format of datum like:
X-axis -------- “log0.01 log 0.1 log1 …”
Y-axis -------- counts
The only thing I know is to use
" TF2 *f2 = new TF2(“f2”,“xygaus + xygaus(5)”,-4,4,-4,4); "
But the bin is “uniform” not “log”
Would you please help me? Thank you very much for your kind help

Best wishes

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Hi @sdevip1

Can you provide more info that you want to do with points from 123.txt file?
You can check zdemo.C example to see how arbitrary points can be plot on log scale, using TGraph class


Does this give some inspiration, maybe?

TF2 *f2 = new TF2("f2","xygaus + xygaus(5)",-4,4,-4,4);
for (int i = 0; i < f2->GetNpar(); ++i) f2->SetParameter(i, 1.);

The example you offered was very detailed :grin:

Thank you very much for helping me
Wish you have a nice day :grimacing:

That is a excellent inspiration :grimacing:Thank you very much for your kind help. Wish you have a nice day :100:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.