Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3676c5

Browse files
author
Steve Chaplin
committed
'SC'
svn path=/trunk/matplotlib/; revision=1564
1 parent 557f28d commit c3676c5

4 files changed

Lines changed: 31 additions & 8 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
New entries should be added at the top
22

3+
2005-07-26 backend_gtk.py: allow 'f' key to toggle window fullscreen mode
4+
35
2005-07-26 backend_svg.py: write "<.../>" elements all on one line and remove
46
surplus spaces - SC
57

lib/matplotlib/axis.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
Classes for the ticks and x and y axis
33
"""
44
from __future__ import division
5-
import sys, math, re, copy
5+
import copy
6+
import math
7+
import re
8+
import sys
9+
610
from numerix import arange, array, asarray, ones, zeros, \
711
nonzero, take, Float, log10, logical_and, \
812
dot, sin, cos, tan, pi, sqrt
@@ -22,8 +26,7 @@
2226
from text import Text, TextWithDash, _process_text_args
2327
from patches import bbox_artist
2428

25-
import pdb
26-
import sys
29+
#import pdb
2730

2831

2932
class Tick(Artist):
@@ -140,10 +143,10 @@ def draw(self, renderer):
140143
renderer.open_group(self.__name__)
141144
midPoint = self.get_view_interval().contains_open( self.get_loc() )
142145

143-
if midPoint and self.gridOn: self.gridline.draw(renderer)
144-
if midPoint and self.tick1On: self.tick1line.draw(renderer)
145-
if midPoint and self.tick2On: self.tick2line.draw(renderer)
146-
146+
if midPoint:
147+
if self.gridOn: self.gridline.draw(renderer)
148+
if self.tick1On: self.tick1line.draw(renderer)
149+
if self.tick2On: self.tick2line.draw(renderer)
147150

148151
if self.label1On: self.label1.draw(renderer)
149152
if self.label2On: self.label2.draw(renderer)

lib/matplotlib/backend_bases.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,14 +852,21 @@ def __init__(self, canvas, num):
852852
def destroy(self):
853853
pass
854854

855+
def full_screen_toggle (self):
856+
pass
857+
855858
def key_press(self, event):
856859

857860
# these bindings happen whether you are over an axes or not
858861
#if event.key == 'q':
859862
# self.destroy() # how cruel to have to destroy oneself!
860863
# return
861864

862-
if event.inaxes is None: return
865+
if event.key == 'f':
866+
self.full_screen_toggle()
867+
868+
if event.inaxes is None:
869+
return
863870

864871
# the mouse has to be over an axes to trigger these
865872
if event.key == 'g':

lib/matplotlib/backends/backend_gtk.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,17 @@ def destroy(self, *args):
449449
if Gcf.get_num_fig_managers()==0 and not matplotlib.is_interactive():
450450
gtk.main_quit()
451451

452+
453+
def full_screen_toggle (self):
454+
if gtk.pygtk_version >= (2,2,0):
455+
self._full_screen_flag = not self._full_screen_flag
456+
if self._full_screen_flag:
457+
self.window.fullscreen()
458+
else:
459+
self.window.unfullscreen()
460+
_full_screen_flag = False
461+
462+
452463
def _get_toolbar(self, canvas):
453464
# must be inited after the window, drawingArea and figure
454465
# attrs are set

0 commit comments

Comments
 (0)