I have a function that plots multiples graphs. The x-axis of one particular graph can be linear or logarithmic. But, passing a list as a parameter indicating which graph are logarithmic is not desired. I prefer that to be transparent analysing the data.
x_linear = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
x_log = [1e-2, 1e-3, 1e-4, 1e-5, 1e-6, 1e-7, 1e-8, 1e-9, 1e-10, 1e-11, 1e-12, 1e-13, 1e-14, 1e-15]
Something as islog(x_linear)
returns False
, and islog(x_log)
returns True
.
Not always the x values are exactly linear-ish, nor logarithmic-ish. They could be:
x1 = [10, 20, 50, 100, 200, 500, 1000, 1200, 1500, 1800, 1900, 2000, 2100, 3000]
x2 = [1, 2, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377]
x3 = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 20]
They are some kind of exponential, but not enough to need a logarithmic x-axes.