Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Tabbed gtk3 figuremanager#2465
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Closed
Uh oh!
There was an error while loading.Please reload this page.
Closed
Changes fromall commits
Commits
Show all changes
20 commits Select commitHold shift + click to select a range
01b0e78 refactoring FigureManagerBase to include include self in all calls to…
farizaec262ad Modified to use container for figure managers and for toolbars
fariza4e1d8c4 Adding standaone savefiguredialog
farizaa7e9968 Subplot tool and save as external clasess, working on weakref to keep…
fariza6c13b83 Added external buttons, trying to figure out how to keep track of them
fariza61d8427 Cleanup, commit to show what can be done
farizab9204e5 Forgot to include external button
fariza0f6023e Placing stuff in backend_bases.py and renaming rc param to single_window
farizab48e903 renaming rcparam in demo
farizaa7ab976 adding remove_tool and move_tool
farizaa582aeb Adding passthought **kwargs to add_tool, default value for buttons no…
fariza375f32e adding tool for lineproperties
fariza5ec539f adding saveall images from http://openiconlibrary.sourceforge.net/gal…
farizaecd3c91 Adding image to saveall tool, changing order to have saveall side to …
fariza0f3abfe Fixing new buttons not showing after toolbar init
farizaa6bc104 Saveall image uses same original filesave, the colors and motive match
fariza2c06a64 rebase for review
farizacf80c97 pep8 correction
fariza7033c46 removing backedn_gtk3cairo.py from test_coding_standards
fariza84a1911 splitting toolbar and figuremanager examples
farizaFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
56 changes: 56 additions & 0 deletionsexamples/user_interfaces/multifigure_backend_gtk3.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import matplotlib | ||
| matplotlib.use('GTK3Agg') | ||
| matplotlib.rcParams['backend.single_window'] = True | ||
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
| x = np.arange(100) | ||
| #Create 4 figures | ||
| fig1 = plt.figure() | ||
| ax1 = fig1.add_subplot(111) | ||
| ax1.plot(x, x) | ||
| fig2 = plt.figure() | ||
| ax2 = fig2.add_subplot(111) | ||
| ax2.plot(x, np.sqrt(x)) | ||
| fig3 = plt.figure() | ||
| ax3 = fig3.add_subplot(111) | ||
| ax3.plot(x, x ** 2) | ||
| fig4 = plt.figure() | ||
| ax4 = fig4.add_subplot(111) | ||
| ax4.plot(x, x ** 3) | ||
| ################### | ||
| #Figure management | ||
| #Change the figure1 tab label | ||
| fig1.canvas.manager.set_window_title('Just a line') | ||
| #Change the figure manager window title | ||
| fig1.canvas.manager.set_mainwindow_title('The powerful window manager') | ||
| #Detach figure3 from the rest | ||
| fig3.canvas.manager.detach() | ||
| #Put the figure4 in the same manager as fig3 | ||
| fig4.canvas.manager.reparent(fig3) | ||
| #Control the parent from the figure instantiation with the parent argument | ||
| #To place it in the same parent as fig1 we have several options | ||
| #parent=fig1 | ||
| #parent=fig1.canvas.manager | ||
| #parent=fig2.canvas.manager.parent | ||
| fig5 = plt.figure(parent=fig1) | ||
| ax5 = fig5.add_subplot(111) | ||
| ax5.plot(x, x**4) | ||
| #if we want it in a separate window | ||
| #parent=False | ||
| plt.show() |
38 changes: 38 additions & 0 deletionsexamples/user_interfaces/reconfigurable_toolbar_gtk3.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import matplotlib | ||
| matplotlib.use('GTK3Agg') | ||
| matplotlib.rcParams['backend.single_window'] = True | ||
| import matplotlib.pyplot as plt | ||
| from matplotlib.backend_bases import ToolBase | ||
| import numpy as np | ||
| x = np.arange(100) | ||
| #Create 4 figures | ||
| fig1 = plt.figure() | ||
| ax1 = fig1.add_subplot(111) | ||
| ax1.plot(x, x) | ||
| ################### | ||
| #Toolbar management | ||
| #Lets reorder the buttons in the fig3-fig4 toolbar | ||
| #Back? who needs back? my mom always told me, don't look back, | ||
| fig1.canvas.manager.toolbar.remove_tool(1) | ||
| #Move home somewhere nicer | ||
| fig1.canvas.manager.toolbar.move_tool(0, 8) | ||
| class SampleNonGuiTool(ToolBase): | ||
| text = 'Stats' | ||
| def set_figures(self, *figures): | ||
| #stupid routine that says how many axes are in each figure | ||
| for figure in figures: | ||
| title = figure.canvas.get_window_title() | ||
| print('Figure "%s": Has %d axes' % (title, len(figure.axes))) | ||
| #Add simple SampleNonGuiTool to the toolbar of fig1-fig2 | ||
| fig1.canvas.manager.toolbar.add_tool(SampleNonGuiTool) | ||
| plt.show() |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.