Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug report
Hello, as discussed onmatplotlib-devel, there is a unexpected change in Matplotlib 2.2 when plotting lines and markers (e.g. style 'D-') combined with drawstyle='steps-post' (
steps-pre' and 'steps-mid' as well).
Code for reproduction
importmatplotlib.pyplotaspltimportnumpyasnpx=np.linspace(0,6,7)y=np.sin(x)plt.plot(x,y,'D-',drawstyle='steps-post')
Actual outcome
In Matplotlib 2.2.2, markers are drawn at each "line break".
Running the same script withdrawstyle='steps-mid'
yields markers at half-integer positions (except for those at the end)
Expected outcome
In all previous Matplotlib versions, the marker was placed at the exact x-position of the input data (which is the left of each segment fordrawstyle='steps-post'
). I didn't do the bissection to know when the changed happen, but I suspect it's quite new (2.1 → 2.2 ?).
Matplotlib version
- Matplotlib version: 2.2.2
- Python version: 3.6