1

Consider this minimal example

julia> using Plots
julia> pyplot()
julia> x = -100:0.01:100
julia> y = x
julia> plot(x, y, xscale = :log10)

This raises the following error: DomainError: log10 will only return a complex result if called with a complex argument. Try log10(complex(x)).

Of course, this is because the logarithm of negative numbers is not well defined. However, in python you can overcome this problem using the command plt.xscale('symlog'). Is there an equivalent command for Plots.jl?

dapias
  • 2,512
  • 3
  • 15
  • 23
  • I can't test it, but is replacing `plot` by [`semilogx`](https://stackoverflow.com/questions/43434958/how-do-i-plot-a-semilog-plot-in-python) an option? – phipsgabler Dec 08 '18 at 14:45
  • @phg it seems `semilogx` is not a valid command name – dapias Dec 10 '18 at 18:37
  • 1
    There is some mentions to `symlog` (symmetric log scale), but no implementation has be done yet. You should file an issue. See https://github.com/JuliaPlots/Plots.jl/issues?utf8=%E2%9C%93&q=is%3Aissue+symlog – Felipe Lema Dec 11 '18 at 13:12

0 Answers0