Skip to content

BUG: manual clabel positioning broke between 1.2 and 1.3 #2475

Closed
@efiring

Description

@efiring

The bug is reported to the matplotlib-users list by Felix Patzelt on Sept. 28:
http://matplotlib.1069221.n5.nabble.com/Broken-clabel-manual-True-in-1-3-0-td42124.html.

Below is a slightly edited version of the script he provided to make it easy to reproduce the problem. I have verified that the error occurs in master.

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, manual=True)
plt.title('Position labels manually')
plt.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions