Home > Back-end >  Broken x and y-axes in matplotlib
Broken x and y-axes in matplotlib

Time:11-20

I am trying to plot broken y and x axis. I wrote a very basic code taking help from previous answered questions. However, I fail to understand why my plot is not taking the left of broken x-axis and down of broken y-axis. I am attaching my data file here for enter image description here

from matplotlib.pyplot import figure
from brokenaxes import brokenaxes
from numpy import logspace

x = logspace(-35,  1, 100)
y = logspace(-32, -3, 100)

fig = figure()
bax = brokenaxes(xlims=((1E-35, 1E-10), (1E-3, 10)),
                 ylims=((0.8E-32, 1E-24), (1E-6, 2e-3)),
                 xscale='log', yscale='log')
bax.loglog(x, y, label='...')
bax.legend(loc=8)
bax.grid(axis='both', which='major', ls='-')
bax.set_xlabel('x')
bax.set_ylabel('y')
fig.show()
  • Related