Broken clabel manual=True in 1.3.0

Dear all,

manually placing labels when using clabel seems to be broken in Matplotlib 1.3.0.

I'm on OS X 10.8.5 and have Matplotlib installed via macports. Today I updated all installed ports and thereby got the new version of Matplotlib. Now manually placing cline labels creates weird artefacts. I attached a demo script at the bottom and uploaded a screenshot at http://i.imgur.com/u6BLcRB.png . As you can see there is also a depreciation warning. Now I downgraded to Matoplotlib 1.2.1 again (keeping all other updates in place) and the problem is gone. I currently have very little time for bug hunting and therefore will just stay away from updates for a while. Maybe someone can figure out what's going wrong.

Best,
Felix

···

##########################################
# demo.py
##########################################

import numpy as np
from matplotlib import mlab
import pylab as plt

# Broken manual labelling demo
# Adapted from pylab_examples example code: contour_demo.py
delta = 0.025
x = np.arange(-3.0, 3.0, delta)
y = np.arange(-2.0, 2.0, delta)
X, Y = np.meshgrid(x, y)
Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
# difference of Gaussians
Z = 10.0 * (Z2 - Z1)

plt.figure()
CS = plt.contour(X, Y, Z)
plt.clabel(CS, inline=1, fontsize=10)
plt.title('Simplest default with labels')
plt.show()

plt.figure()
CS = plt.contour(X, Y, Z)
plt.clabel(CS, inline=1, fontsize=10, manual=True)
plt.title('Position labels manually')
plt.show()

2013/9/28 Felix Patzelt <felix@...4098...>:

Dear all,

manually placing labels when using clabel seems to be broken in Matplotlib 1.3.0.

I'm on OS X 10.8.5 and have Matplotlib installed via macports. Today I updated all installed ports and thereby got the new version of Matplotlib. Now manually placing cline labels creates weird artefacts. I attached a demo script at the bottom and uploaded a screenshot at http://i.imgur.com/u6BLcRB.png . As you can see there is also a depreciation warning. Now I downgraded to Matoplotlib 1.2.1 again (keeping all other updates in place) and the problem is gone. I currently have very little time for bug hunting and therefore will just stay away from updates for a while. Maybe someone can figure out what's going wrong.

FWIW, I can confirm this issue in Ubuntu Raring with the development
version of matplotlib packaged in ppa:takluyver/matplotlib-daily.

Felix,

Thanks for the report. I have turned it into a Github issue: BUG: manual clabel positioning broke between 1.2 and 1.3 · Issue #2475 · matplotlib/matplotlib · GitHub.

Eric

···

On 2013/09/28 11:15 AM, Felix Patzelt wrote:

Dear all,

manually placing labels when using clabel seems to be broken in Matplotlib 1.3.0.

I'm on OS X 10.8.5 and have Matplotlib installed via macports. Today I updated all installed ports and thereby got the new version of Matplotlib. Now manually placing cline labels creates weird artefacts. I attached a demo script at the bottom and uploaded a screenshot at http://i.imgur.com/u6BLcRB.png . As you can see there is also a depreciation warning. Now I downgraded to Matoplotlib 1.2.1 again (keeping all other updates in place) and the problem is gone. I currently have very little time for bug hunting and therefore will just stay away from updates for a while. Maybe someone can figure out what's going wrong.

Best,
Felix