0

I have plot that I need to,

  1. invert the y axis,
  2. then remove the xticks,
  3. and finally bring the x axis to the top of the plot where x axis will meet Y axis at y=0

I managed to invert the y axis and remove xticks but I can not figure out how to bring the x axis to top. Any help is appreciated.

from matplotlib import pyplot as plt
import numpy as np
from brokenaxes import brokenaxes

a = np.loadtxt('path_to_file/PLOT_KD,KDWT-log10.txt', skiprows=1)
fig = plt.figure(figsize=(20,15))
bax = brokenaxes(xlims=((0,1793), (1794,6053),(6054,7362),(7363,8622),(8623,11236)))

bax.plot(np.arange(a.shape[0]), a[:,0], color ='blue')
bax.plot(np.arange(a.shape[0]), a[:,1], color ='magenta')
bax.invert_yaxis()
bax.set_xticks([])

I have attached an image of the current plot.

Thank you

Kash
  • 1
  • 1
  • Does this answer your question? [Moving x-axis to the top of a plot in matplotlib](https://stackoverflow.com/questions/14406214/moving-x-axis-to-the-top-of-a-plot-in-matplotlib) – MagnusO_O Oct 12 '22 at 16:33

0 Answers0