Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update mpl_toolkits.gtktools.#6554

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

Merged
tacaswell merged 1 commit intomatplotlib:masterfromanntzer:fix-gtktools
Jun 20, 2016
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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
4 changes: 4 additions & 0 deletionslib/mpl_toolkits/exceltools.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,10 @@
import matplotlib.mlab as mlab


cbook.warn_deprecated("2.0", name="mpl_toolkits.exceltools",
alternative="openpyxl", obj_type="module")


def xlformat_factory(format):
"""
copy the format, perform any overrides, and attach an xlstyle instance
Expand Down
19 changes: 8 additions & 11 deletionslib/mpl_toolkits/gtktools.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,11 +39,15 @@

import copy
import gtk, gobject
import numpy asnpy
import numpy asnp
import matplotlib.cbook as cbook
from matplotlib.cbook import warn_deprecated
import matplotlib.mlab as mlab


warn_deprecated("2.0", name="mpl_toolkits.gtktools", obj_type="module")


def error_message(msg, parent=None, title=None):
"""
create an error message dialog with string msg. Optionally set
Expand DownExpand Up@@ -164,7 +168,7 @@ def __call__(self, column):
val = model.get_value(thisiter, self.i)
try: val = float(val.strip().rstrip('%'))
except ValueError: pass
if mlab.safe_isnan(val): val =npy.inf # force nan to sort uniquely
if mlab.safe_isnan(val): val =np.inf # force nan to sort uniquely
dsu.append((val, rownum))
dsu.sort()
if not self.num%2: dsu.reverse()
Expand DownExpand Up@@ -326,19 +330,15 @@ def rec2gtk(r, formatd=None, rownum=0, autowin=True):
format = formatd.get(name)
if format is None:
format = mlab.defaultformatd.get(dt.type, mlab.FormatObj())
#print 'gtk fmt factory', i, name, format, type(format)
format = gtkformat_factory(format, i)
formatd[name] = format


colheaders = r.dtype.names
scroll = SortedStringsScrolledWindow(colheaders, formatd)

ind = npy.arange(len(r.dtype.names))
for row in r:
scroll.add_row(row)


if autowin:
win = gtk.Window()
win.set_default_size(800,600)
Expand DownExpand Up@@ -387,7 +387,7 @@ def __init__(self, r, formatd=None, stringd=None):
formatd = mlab.get_formatd(r)

self.stringd = stringd
self.callbacks = cbook.CallbackRegistry(['cell_changed'])
self.callbacks = cbook.CallbackRegistry()

self.r = r

Expand DownExpand Up@@ -586,9 +586,6 @@ def edit_recarray(r, formatd=None, stringd=None, constant=None, autowin=True):
if __name__=='__main__':

import datetime
import gtk
import numpy as np
import matplotlib.mlab as mlab
N = 10
today = datetime.date.today()
dates = [today+datetime.timedelta(days=i) for i in range(N)] # datetimes
Expand All@@ -599,7 +596,7 @@ def edit_recarray(r, formatd=None, stringd=None, constant=None, autowin=True):
clientid = list(xrange(N)) # ints

r = np.rec.fromarrays([clientid, dates, weekdays, gains, prices, up],
names='clientid,date,weekdays,gains,prices,up')
names=str('clientid,date,weekdays,gains,prices,up'))

# some custom formatters
formatd = mlab.get_formatd(r)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp