[yade] 01/03: Fix warning in newer matplotlib.
Anton Gladky
gladk at moszumanska.debian.org
Sun Feb 14 10:39:57 UTC 2016
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository yade.
commit 5fb4ec868f69a8b54788f19d9b5891b7b5197e1f
Author: Anton Gladky <gladk at debian.org>
Date: Sun Feb 14 11:37:54 2016 +0100
Fix warning in newer matplotlib.
---
debian/patches/series | 1 +
doc/sphinx/templates/layout.html | 13 -------------
py/plot.py | 12 ++++++------
3 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/debian/patches/series b/debian/patches/series
index b4e6505..6568acd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
01_remove_google_analytics.patch
+02_FixMatplotLibWarning.patch
diff --git a/doc/sphinx/templates/layout.html b/doc/sphinx/templates/layout.html
index 01b1a2e..20c3bab 100644
--- a/doc/sphinx/templates/layout.html
+++ b/doc/sphinx/templates/layout.html
@@ -16,19 +16,6 @@
{% endblock %}
-{% block footer %}
-{{ super() }}
-<script type="text/javascript">
- (function() {
- var ga = document.createElement('script');
- ga.src = ('https:' == document.location.protocol ?
- 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- ga.setAttribute('async', 'true');
- document.documentElement.firstChild.appendChild(ga);
- })();
-</script>
- {% endblock %}
-
{% block rootrellink %}
<li><a href="{{ pathto('index') }}">Yade</a> | </li>
<li><a href="{{ pathto('index-toctree') }}">Documentation</a>
diff --git a/py/plot.py b/py/plot.py
index b51e3fe..538c59d 100644
--- a/py/plot.py
+++ b/py/plot.py
@@ -352,7 +352,7 @@ class LineRef:
# dx,dy=[numpy.average(numpy.diff(dta[current-window:current])) for dta in self.xdata,self.ydata]
#except IndexError: pass
# there must be an easier way to find on-screen derivative angle, ask on the matplotlib mailing list
- axes=self.line.get_axes()
+ axes=self.line.axes()
p=axes.patch; xx,yy=p.get_verts()[:,0],p.get_verts()[:,1]; size=max(xx)-min(xx),max(yy)-min(yy)
aspect=(size[1]/size[0])*(1./axes.get_data_ratio())
angle=math.atan(aspect*dy/dx)
@@ -435,7 +435,7 @@ def createPlots(subPlots=True,scatterSize=60,wider=False):
# if current value is NaN, use zero instead
scatter=pylab.scatter(scatterPt[0] if not math.isnan(scatterPt[0]) else 0,scatterPt[1] if not math.isnan(scatterPt[1]) else 0,s=scatterSize,color=line.get_color(),**scatterMarkerKw)
currLineRefs.append(LineRef(line,scatter,line2,data[pStrip],data[d[0]]))
- axes=line.get_axes()
+ axes=line.axes
labelLoc=(legendLoc[0 if isY1 else 1] if y2Exists>0 else 'best')
l=pylab.legend(loc=labelLoc)
if hasattr(l,'draggable'): l.draggable(True)
@@ -472,7 +472,7 @@ def liveUpdate(timestamp):
for l in currLineRefs:
l.update()
figs.add(l.line.get_figure())
- axes.add(l.line.get_axes())
+ axes.add(l.line.axes)
linesData.add(id(l.ydata))
# find callables in y specifiers, create new lines if necessary
for ax in axes:
@@ -591,7 +591,7 @@ def plot(noShow=False,subPlots=True):
"""
createPlots(subPlots=subPlots)
global currLineRefs
- figs=set([l.line.get_axes().get_figure() for l in currLineRefs])
+ figs=set([l.line.axes.get_figure() for l in currLineRefs])
if not hasattr(list(figs)[0],'show') and not noShow:
import warnings
warnings.warn('plot.plot not showing figure (matplotlib using headless backend?)')
@@ -612,10 +612,10 @@ def plot(noShow=False,subPlots=True):
ff=event.canvas.figure
# remove closed axes from our update list
global currLineRefs
- currLineRefs=[l for l in currLineRefs if l.line.get_axes().get_figure()!=ff]
+ currLineRefs=[l for l in currLineRefs if l.line.axes.get_figure()!=ff]
f.canvas.mpl_connect('close_event',closeFigureCallback)
else:
- figs=list(set([l.line.get_axes().get_figure() for l in currLineRefs]))
+ figs=list(set([l.line.get_figure() for l in currLineRefs]))
if len(figs)==1: return figs[0]
else: return figs
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/yade.git
More information about the debian-science-commits
mailing list