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

Skip to content

Commit 4fcaeac

Browse files
committed
experimenting with log toggle
svn path=/trunk/matplotlib/; revision=5257
1 parent ff09ef4 commit 4fcaeac

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

lib/matplotlib/backend_bases.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
from __future__ import division
7-
import os
7+
import os, warnings
88

99
import numpy as np
1010
import matplotlib.cbook as cbook
@@ -1201,8 +1201,17 @@ def key_press(self, event):
12011201
event.inaxes.grid()
12021202
self.canvas.draw()
12031203
elif event.key == 'l':
1204-
event.inaxes.toggle_log_lineary()
1205-
self.canvas.draw()
1204+
warnings.warn('log scale toggling under construction')
1205+
if 0:
1206+
ax = event.inaxes
1207+
scale = ax.get_yscale()
1208+
if scale=='log':
1209+
ax.set_yscale('linear')
1210+
ax.figure.canvas.draw()
1211+
elif scale=='linear':
1212+
ax.set_yscale('log')
1213+
ax.figure.canvas.draw()
1214+
12061215
elif event.key is not None and (event.key.isdigit() and event.key!='0') or event.key=='a':
12071216
# 'a' enables all axes
12081217
if event.key!='a':

0 commit comments

Comments
 (0)