Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
01b0e78
refactoring FigureManagerBase to include include self in all calls to…
fariza Sep 12, 2013
ec262ad
Modified to use container for figure managers and for toolbars
fariza Sep 13, 2013
4e1d8c4
Adding standaone savefiguredialog
fariza Sep 15, 2013
a7e9968
Subplot tool and save as external clasess, working on weakref to keep…
fariza Sep 15, 2013
6c13b83
Added external buttons, trying to figure out how to keep track of them
fariza Sep 16, 2013
61d8427
Cleanup, commit to show what can be done
fariza Sep 17, 2013
b9204e5
Forgot to include external button
fariza Sep 17, 2013
0f6023e
Placing stuff in backend_bases.py and renaming rc param to single_window
fariza Sep 18, 2013
b48e903
renaming rcparam in demo
fariza Sep 18, 2013
a7ab976
adding remove_tool and move_tool
fariza Sep 18, 2013
a582aeb
Adding passthought **kwargs to add_tool, default value for buttons no…
fariza Sep 19, 2013
375f32e
adding tool for lineproperties
fariza Sep 20, 2013
5ec539f
adding saveall images from http://openiconlibrary.sourceforge.net/gal…
fariza Sep 24, 2013
ecd3c91
Adding image to saveall tool, changing order to have saveall side to …
fariza Sep 25, 2013
0f3abfe
Fixing new buttons not showing after toolbar init
fariza Sep 26, 2013
a6bc104
Saveall image uses same original filesave, the colors and motive match
fariza Sep 26, 2013
2c06a64
rebase for review
fariza Oct 23, 2013
cf80c97
pep8 correction
fariza Oct 23, 2013
7033c46
removing backedn_gtk3cairo.py from test_coding_standards
fariza Oct 23, 2013
84a1911
splitting toolbar and figuremanager examples
fariza Oct 28, 2013
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
Prev Previous commit
Next Next commit
pep8 correction
  • Loading branch information
fariza committed Oct 23, 2013
commit cf80c97ffa2b10037c0505e436748a815ce96c72
14 changes: 8 additions & 6 deletions examples/user_interfaces/multifigure_backend_gtk3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
fig1 = plt.figure()
ax1 = fig1.add_subplot(111)
ax1.plot(x, x ** 2, marker='o', label='hey', picker=5)
ax1.legend(loc = 'lower left')
ax1.legend(loc='lower left')

fig2 = plt.figure()
ax2 = fig2.add_subplot(111)
ax2.plot(x , np.sqrt(x))
ax2.plot(x, np.sqrt(x))
ax2.set_xlabel('x')
ax2.set_ylabel('y')
#In the axes control tool, there is a second axes for this subplot, check it out :)
#In the axes control tool,
#there is a second axes for this subplot, check it out :)
ax22 = ax2.twinx()
ax22.plot(x, -np.sqrt(x), picker=5, marker='x', label='in second axis')
ax22.set_ylabel('Minus x')

d=5
d = 5
fig3 = plt.figure()
ax3 = fig3.add_subplot(111)
ax3.plot(x[::d], (x ** 3)[::d], 'ro-', label='Line label')
Expand Down Expand Up @@ -56,7 +57,7 @@
#parent=fig2.canvas.manager.parent
fig5 = plt.figure(parent=fig1)
ax5 = fig5.add_subplot(111)
ax5.plot(x , x**4)
ax5.plot(x, x**4)
#if we want it in a separate window
#parent=False

Expand All @@ -65,6 +66,7 @@
#Toolbar management
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:
Expand All @@ -81,4 +83,4 @@ def set_figures(self, *figures):
#Move home somewhere nicer, I always wanted to live close to a rainbow
fig3.canvas.manager.toolbar.move_tool(0, 8)

plt.show()
plt.show()
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_gtk3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)
unicode_literals)

import six

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_gtk3agg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)
unicode_literals)

import six

Expand Down
9 changes: 5 additions & 4 deletions lib/matplotlib/backends/backend_gtk3cairo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)
unicode_literals)

import six

Expand All @@ -24,8 +24,8 @@ def _renderer_init(self):
self._renderer = RendererGTK3Cairo(self.figure.dpi)

def _render_figure(self, width, height):
self._renderer.set_width_height (width, height)
self.figure.draw (self._renderer)
self._renderer.set_width_height(width, height)
self.figure.draw(self._renderer)

def on_draw_event(self, widget, ctx):
""" GtkDrawable draw event, like expose_event in GTK 2.X
Expand All @@ -35,7 +35,8 @@ def on_draw_event(self, widget, ctx):
#if self._need_redraw:
self._renderer.set_context(ctx)
allocation = self.get_allocation()
x, y, w, h = allocation.x, allocation.y, allocation.width, allocation.height
x, y = allocation.x, allocation.y
w, h = allocation.width, allocation.height
self._render_figure(w, h)
#self._need_redraw = False

Expand Down