[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Tue Oct 30 11:36:11 PDT 2012
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/56ad3efb61c3/
changeset: 56ad3efb61c3
branch: yt
user: chiffre
date: 2012-10-30 10:39:04
summary: Changed the prefix to np and added plot_args for more control
affected #: 1 file
diff -r 4180878cc840a3443148bd9a5e755ad17643f722 -r 56ad3efb61c308414e791fc4575db3f6c6ffa469 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -374,13 +374,9 @@
class StreamlineCallback(PlotCallback):
_type_name = "streamlines"
- def __init__(self, field_x, field_y, factor = 16,
- density = 1, arrowsize = 1, arrowstyle = None,
- color = None, normalize = False):
+ def __init__(self, field_x, field_y, factor = 16, density = 1, plot_args=None):
"""
- annotate_streamlines(field_x, field_y, factor = 16, density = 1,
- arrowsize = 1, arrowstyle = None,
- color = None, normalize = False):
+ annotate_streamlines(field_x, field_y, factor = 16, plot_args=None):
Add streamlines to any plot, using the *field_x* and *field_y*
from the associated data, skipping every *factor* datapoints like
@@ -392,12 +388,8 @@
self.bv_x = self.bv_y = 0
self.factor = factor
self.dens = density
- self.arrowsize = arrowsize
- if arrowstyle is None : arrowstyle='-|>'
- self.arrowstyle = arrowstyle
- if color is None : color = "#000000"
- self.color = color
- self.normalize = normalize
+ if plot_args is None: plot_args = {}
+ self.plot_args = plot_args
def __call__(self, plot):
x0, x1 = plot.xlim
@@ -421,15 +413,10 @@
plot.data[self.field_y] - self.bv_y,
int(nx), int(ny),
(x0, x1, y0, y1),).transpose()
- X,Y = (na.linspace(xx0,xx1,nx,endpoint=True),
- na.linspace(yy0,yy1,ny,endpoint=True))
- if self.normalize:
- nn = na.sqrt(pixX**2 + pixY**2)
- pixX /= nn
- pixY /= nn
- plot._axes.streamplot(X,Y, pixX, pixY, density=self.dens,
- arrowsize=self.arrowsize, arrowstyle=self.arrowstyle,
- color=self.color, norm=self.normalize)
+ X,Y = (np.linspace(xx0,xx1,nx,endpoint=True),
+ np.linspace(yy0,yy1,ny,endpoint=True))
+ plot._axes.streamplot(X,Y, pixX, pixY, density = self.dens,
+ **self.plot_args)
plot._axes.set_xlim(xx0,xx1)
plot._axes.set_ylim(yy0,yy1)
plot._axes.hold(False)
https://bitbucket.org/yt_analysis/yt/changeset/5736bc9e7f29/
changeset: 5736bc9e7f29
branch: yt
user: chiffre
date: 2012-10-30 10:48:03
summary: Fixed the docu
affected #: 1 file
diff -r 56ad3efb61c308414e791fc4575db3f6c6ffa469 -r 5736bc9e7f29ccc6b997a4e18a9bb8aac55d46c7 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -374,9 +374,11 @@
class StreamlineCallback(PlotCallback):
_type_name = "streamlines"
- def __init__(self, field_x, field_y, factor = 16, density = 1, plot_args=None):
+ def __init__(self, field_x, field_y, factor = 16,
+ density = 1, plot_args=None):
"""
- annotate_streamlines(field_x, field_y, factor = 16, plot_args=None):
+ annotate_streamlines(field_x, field_y, factor = 16,
+ density = 1, plot_args=None):
Add streamlines to any plot, using the *field_x* and *field_y*
from the associated data, skipping every *factor* datapoints like
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list