Log scale x-axis problem


I have some minor problems with using the log scale on x-axis. I have a small script which is part of a bigger one but it visualizes the problem for me.

I have the x-axis going from 0 to 1 without the use of gpad->SetLogx(); If I use this setting in the script which is commented the range goes not from 0 to 1 instead from 10^-4 to 1. What is wrong?

I have data which I want to fill inside and some of the data are with x values smaller then 10^-4. Without the log scale the data points are plotted, but as soon I use the log-scale the data below 10^-4 vanish, or are not plotted.

If you reguest the data points let me know and I can put another script with these inside.

problem.C (386 Bytes)

Because Log(0) is undefined, the axis starts from a small value equal to a fraction of the maximum (0.001*max I think). Make sure your axis minimum is > 0 and you will get what you want.

1 Like

Yes this is clear, I wrote it a little bad :blush:

But I would like to control the start value in some sense. You mean that it is always 0.001*max ? Lets say I want to start with 10^-5 as first. What is the easiest way to procced with that?


start your axis at 10^5 … not at zero

The problem is solved but using


To force the correct start value I want to have.

Yes that’s what I meant … you should start with a proper value. Zero is not correct for log scale…