2

I want to get following fancy broken bar.

enter image description here

Here is my code (adapted from here) which can get top bar. I am trying to achieve bottom one. Any ideas ?

import matplotlib.pylab as plt
x1 = range(0, 100)
x2 = range(1000, 3000)

fig, (ax, ax2) = plt.subplots(1, 2, sharey=True)
ax.barh(0, x1)
ax2.barh(0, x2)
ax.set_xlim(0, 100)
ax2.set_xlim(1000, 4000)
ax.spines['right'].set_visible(False)
ax2.spines['left'].set_visible(False)
ax.yaxis.tick_left()
ax.tick_params(labeltop='off')
ax2.yaxis.tick_right()
plt.subplots_adjust(wspace=0.15)
plt.ylim(-5,5)
plt.show()
Dexter
  • 1,421
  • 3
  • 22
  • 43

0 Answers0