8000 Added a TextBox widget by keflavich · Pull Request #1983 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Added a TextBox widget #1983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10000
Prev Previous commit
Next Next commit
inherit/use AxesWidget
  • Loading branch information
Matt Terry committed Jun 4, 2013
commit 8ed729be8e3ad297d519a62362e3834887335042
15 changes: 6 additions & 9 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1693,27 +1693,24 @@ def __init__(self, ax, s='', horizontalalignment='left',
fontsize : int
Font size for text box
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I'm not familiar with the numpydoc format but we should conform to that for the sake of consistency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in my branch.

AxesWidget.__init__(self, ax)

self.value = float(s)

self.canvas = ax.figure.canvas
self.text = ax.text(0.025, 0.2, s,
self.text = self.ax.text(0.025, 0.2, s,
fontsize=fontsize,
verticalalignment='baseline',
horizontalalignment=horizontalalignment,
transform=ax.transAxes)
self.ax = ax
ax.set_yticks([])
ax.set_xticks([])
transform=self.ax.transAxes)
self.ax.set_yticks([])
self.ax.set_xticks([])

ax.set_navigate(False)
self.ax.set_navigate(False)
self.canvas.draw()

self._cursor = None
self._cursorpos = len(self.text.get_text())

self.active = False

self.redraw()
self._cid = None

Expand Down
0