In matplotlib, I can set the axis scaling using either pyplot.xscale() or Axes.set_xscale(). Both functions accept three different scales: 'linear' | 'log' | 'symlog'.
What is the difference between 'log' and 'symlog'? In a simple test I did, they both looked exactly the same.
I know the documentation says they accept different parameters, but I still don’t understand the difference between them. Can someone please explain it? The answer will be the best if it has some sample code and graphics! (also: where does the name ‘symlog’ come from?)
I finally found some time to do some experiments in order to understand the difference between them. Here’s what I discovered:
logonly allows positive values, and lets you choose how to handle negative ones (maskorclip).symlogmeans symmetrical log, and allows positive and negative values.symlogallows to set a range around zero within the plot will be linear instead of logarithmic.I think everything will get a lot easier to understand with graphics and examples, so let’s try them:
Just for completeness, I’ve used the following code to save each figure:
Remember you can change the figure size using:
(If you are unsure about me answering my own question, read this)