Search code examples
pythonmatplotlibplotaxis-labels

How to use a symlog scale with log scale property of identical distance between labels


The plots below show 1st. a symlog scale (ax.set_xscale("symlog")) and 2nd. a log scale (ax.set_xscale("log") As you can see the 0 does not appear in the logscale but my x values consist of (0, 0.001, 0.01, 0.1, 1, 10, 100). I would like to find a way to have a scale like in the 2nd plot that shows my 0 value as well. A suggested solution is to use symlog. Plot 1 shows the result. 0 is there but the labels around 0 (0,0.001,0.01,0.1) are located all right next to each other. I lost the property of a scale with identical distances between the labels no matter what value they have. Does anyone know how to fix that? Symlog

Log


Solution

  • SOLVED: ax.set_xscale('symlog',linthreshx=0.001)did it while 0.001 is the smallest x value on the axis symlog