-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Labels
Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Milestone
Description
- matplotlib 1.5.3 (pip install)
- python 2.7.6 (apt-get from ubuntu repository)
- ubuntu 14.04
- goal: display 2-line texts which differ by linespacing.
- issue: when the text instances have the same parameters (coordinates, text string, alpha) except for the linespacing, the second one is displayed over the first one. The linespacing of the first instance is used for the second instance as well.
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
def two_2line_texts(x1, y1, spacing1, x2, y2, spacing2):
text_string = 'line1\nline2'
plt.text(x1, y1, text_string, linespacing = spacing1, alpha = 0.5)
plt.text(x2, y2, text_string, linespacing = spacing2, alpha = 0.5)
# fig 1:
two_2line_texts(x1 = .5, y1 = .5, spacing1 = 2,
x2 = .5, y2 = .5, spacing2 = 0.4)
# fig 2:
two_2line_texts(x1 = .5, y1 = .5, spacing1 = 0.4,
x2 = .5, y2 = .5, spacing2 = 2)
# fig 3:
two_2line_texts(x1 = .5, y1 = .5000000001, spacing1 = 0.4,
x2 = .5, y2 = .5, spacing2 = 2) Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues


