Problem with axis labels

Hi,
I have some problems with the axes labels when i am trying to draw some histograms, graphs or functions. In the figure i linked here i am trying to fit a spectra with an mt exponential. As you see, the X axis labels are reversed, and also follow some strange drawing logic (its not linear or logarithmic). Another thing is that actually the data points and function are represented correctly, is just the X axis labels which are wrong.
This is not the only example i have. I observed this feature whenever i am trying to plot a function with a bit more iregular behaviour (meaning functions relatively calm on some intervals and very steep in other intervals).
It will be nice if i can get some help on this.
Thanks,
Ionut

http://folk.uio.no/ionutca/strange_axes.gif

Can you send a small, running, example macro showing the problem ?

Hi,

The plot i showed before is generated with a more complicated macro which uses some experimental data and probably it will be difficult to use it as a test for the problem. So i wrote this simple macro to point out the problem:

const Double_t gMassPion = 0.13957;
const Double_t gSqrtS = 200.0; // GeV
void example()
{
TF1* constYFunc1 = new TF1("", “sinh([0])2.0sqrt(xx+[1][1])/[2]”, 0., 6.);
constYFunc1->SetParameters(2.5, gMassPion, gSqrtS);
constYFunc1->Draw();
}

The result of this macro is the following picture:
http://folk.uio.no/ionutca/example.gif
As you can see, here the axis labels are not reversed anymore, but still, the Y axis, close to zero is not uniform. I don’t understand this behaviour.

P.S. I am using a bit old root version (5.06), but i am installing the newest one and check if the problem persists.

I see the same with the newest version. I will investigate.

Hi,

Thanks. I hope it can be solved because is bugging me for some time.

I forgot to mention something which might help.
So, i have 2 macros, “macro1.C” and “macro2.C”, where “macro1.C” manifests the problem pointed out above.
“macro2.C” does not show this problem if i will execute it in a separate session. But if i will execute “macro2.C” in the same session with “macro1.C” (after executing “macro1.C”), then the problem appears in “macro2.C” also :slight_smile:
I hope i explained myself well.

Ionut

You should name your function. Do:

   TF1* constYFunc1 = new TF1("f", "sinh([0])*2.0*sqrt(x*x+[1]*[1])/[2]", 0.,6.);

The first parameter should not be an empty string.

HI,

Thanks again. I never made the connection between the first argument and the fact that the axes get crazy. How can this happen?

    Cheers,
         Ionut

Axis can be labeled using a function.