#### Topic: Log scale F1D

Hi,

I'm having trouble displaying F1D functions on log scale plots showing many decades. the line is cut in the lower values region.
Here is a simple exemple:

``````from jhplot import F1D
from jhplot import HPlotJa

x = [0.1, 10]
y = [0.00001, 10]

f = F1D("1-(2*e**(-x))", x[0], x[1])
f.setPoints(10000)

c1 = HPlotJa("Canvas")
c1.visible()
c1.setLogScale(0, True)
c1.setLogScale(1, True)
c1.setRangeX(x[0], x[1])
c1.setRangeY(y[0], y[1])
c1.draw(f)
c1.export("f.png")``````

and the output figure:

One solution to partially fixe this is to increase the numbers of points used to display the function, but using 100000 points creates really heavy files and is a lot memory consuming. In addition it is sometime not even sufficient to display all the required decades.
I tested with both HPlotJa and HPlot with the same result.

I suppose the problem comes from the way how F1D are drawn, which is probaly more adapted to linear scales. Would it be possible to make more evenly displayed points for log scales ?

Many thanks
Marc-Antoine

#### Re: Log scale F1D

Thanks for the info.

Indeed at this moment the only solution is to increase the number of divisions using setPoints(int bins).

In this case the points are  evaluated   in the linear scale between Min and Max, but HPlot and HPlotJa
show the points  in the log  scale (both have exactly the same implementation).

I think at this moment the best solution is to use not "function", but "ln(function)" and plot it on the linear scale

Sergei

``````from jhplot import F1D
from jhplot import HPlotJa

x = [0.1, 10]
y = [-10, 5]

f = F1D("log(1-(2*e**(-x)))", x[0], x[1])
# f.setPoints(10000)

c1 = HPlotJa("Canvas")
c1.visible()
c1.setAutoRange()
c1.setRangeX(x[0], x[1])
c1.setRangeY(y[0], y[1])
c1.draw(f)
c1.export("f.png")``````