bendichter/brokenaxes

Strange Diagonal Lines in plot

Closed this issue · 6 comments

Hello people, I'm trying to produce a double broken axes figure. I did research online but nothing seems to solve this problem, unless I made some unidentified dumb error. The problem consists of a "buggy" diagonal line in the plot.
fidds1

import matplotlib.pylab as plt
import numpy as np
from brokenaxes import brokenaxes


# DS1
t = np.array([0, 10, 20, 30, 40, 50, 60, 70, 220, 230, 240])

a2 = np.array([28, 61, 65, 67, 77, 78, 81, 80, 87, 87, 88])


fig = plt.figure(figsize=(8, 4))
baxes = brokenaxes(xlims=((-5,80), (200,250)), ylims=((0,5), (24,92)), hspace=.2)
baxes.plot(t, a2, 'r',label='DS1')
baxes.legend(loc=4)
baxes.set_xlabel('time (s)')
baxes.set_ylabel('Data plot')

plt.show()

Thank you.

This is what your code produces for me. Is this what you are going for?

image

yes, absolutely.

So is it a problem of python or matplotlib version incompatibility?

Hard to know. Can you run pip freeze and copy/paste it here?

also, which python version are you using?

sorry for the long time to respond, I created a new anaconda environment, using compatible python and matplotlib versions and everything worked perfectly. Thank you!

great!