Skip to content
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

WIP: Oo interactive; enable interactive mode with Axes and Figure methods #4082

Closed
wants to merge 4 commits into from

Conversation

efiring
Copy link
Member

@efiring efiring commented Feb 8, 2015

This is a sketch illustrating one method of allowing one to use the OO interface in interactive mode. It involves adding three methods to the Figure and Axes classes, and then using a decorator for any method in those classes that should have a draw_if_interactive behavior. Typically this would include all such methods that are wrapped in pyplot. In the initial version of this PR, this is illustrated with Figure.suptitle, Figure.text, Axes.plot, and Axes.errorbar. Print statements are presently left in to show how the system works; in particular, note that even though errorbar calls plot, the drawing operation is executed only once, so there is no significant loss of efficiency compared to the present pyplot function. A simple illustration in ipython is:

%matplotlib
import matplotlib.pyplot as plt
fig = plt.gcf()
fig.text(0.5, 0.5, 'testing')
ax = plt.gca()
ax.plot([1,2,3])
ax.errorbar([1,2.5, 3.5], [2, 3.5, 2], yerr=2)

@efiring efiring added this to the 1.5.0 milestone Feb 8, 2015
@tacaswell
Copy link
Member

closing in favor of #4091

@tacaswell tacaswell closed this Mar 13, 2015
@tacaswell tacaswell reopened this Mar 13, 2015
@tacaswell tacaswell closed this Mar 15, 2015
efiring referenced this pull request Jun 8, 2015
With the repl callback the pyplot function do not need to
call `draw_if_interactive`.
@efiring efiring deleted the oo-interactive branch October 24, 2021 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants