[matplotlib-devel] hexbin, mincnt
It looks like mincnt is used only when C is not None. For the default histogram method, I've found it useful to be able to turn off cells with fewer then *mincnt* points. Attached is a diff which implements this. Also, should *marginals* be True by default? It seems that hexbin is an alternative to scatter and since scatter doesn't have it, then hexbin should not have it either. Index: lib/matplotlib/axes.py === --- lib/matplotlib/axes.py (revision 6777) +++ lib/matplotlib/axes.py (working copy) @@ -5395,9 +5395,6 @@ d1 = (x-ix1)**2 + 3.0 * (y-iy1)**2 d2 = (x-ix2-0.5)**2 + 3.0 * (y-iy2-0.5)**2 bdist = (d1-- Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] [Matplotlib-users] fill_between
On Thu, Apr 30, 2009 at 2:29 PM, John Hunter wrote:
>
>
> On Thu, Apr 30, 2009 at 4:14 PM, T J wrote:
>>
>> Fill between is for filling between two y-values over a range of
>> x-values. Is there anything which fills between to x-values over a
>> range of y-values?
>
> Nothing with the ease of use of fill_between, but you can always write your
> own PolyCollection, which is what fill_between does (see the function
> implementation for details) or create a Polygon for a simple region. My use
> cases are typically in the time series world where I have datetime on the
> x-axis and some range of values on the y. If folks think it is sufficiently
> useful to have a fill_betweenx function with a similar interface, you could
> probably fairly easy port fill_between to fill_betweenx.
>
> http://matplotlib.sourceforge.net/faq/howto_faq.html#contributing-howto
>
Done. Attached diff is against rev7075.
Index: lib/matplotlib/pyplot.py
===
--- lib/matplotlib/pyplot.py (revision 7075)
+++ lib/matplotlib/pyplot.py (working copy)
@@ -1185,7 +1185,8 @@
figtext add text in figure coords
figure create or change active figure
fillmake filled polygons
-fill_betweenmake filled polygons
+fill_betweenmake filled polygons between two sets of y-values
+fill_betweenx make filled polygons between two sets of x-values
gca return the current axes
gcf return the current figure
gci get the current image, or None
@@ -1945,6 +1946,28 @@
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
+def fill_betweenx(*args, **kwargs):
+# allow callers to override the hold state by passing hold=True|False
+b = ishold()
+h = kwargs.pop('hold', None)
+if h is not None:
+hold(h)
+try:
+ret = gca().fill_betweenx(*args, **kwargs)
+draw_if_interactive()
+except:
+hold(b)
+raise
+
+hold(b)
+return ret
+if Axes.fill_betweenx.__doc__ is not None:
+fill_betweenx.__doc__ = dedent(Axes.fill_betweenx.__doc__) + """
+
+Additional kwargs: hold = [True|False] overrides default hold state"""
+
+# This function was autogenerated by boilerplate.py. Do not edit as
+# changes will be lost
def hexbin(*args, **kwargs):
# allow callers to override the hold state by passing hold=True|False
b = ishold()
Index: lib/matplotlib/axes.py
===
--- lib/matplotlib/axes.py (revision 7075)
+++ lib/matplotlib/axes.py (working copy)
@@ -5809,10 +5809,10 @@
an N length np array of the x data
*y1*
- an N length scalar or np array of the x data
+ an N length scalar or np array of the y data
*y2*
- an N length scalar or np array of the x data
+ an N length scalar or np array of the y data
*where*
if None, default to fill between everywhere. If not None,
@@ -5827,6 +5827,12 @@
%(PolyCollection)s
.. plot:: mpl_examples/pylab_examples/fill_between.py
+
+.. seealso::
+
+:meth:`fill_betweenx`
+for filling between two sets of x-values
+
"""
# Handle united data, such as dates
self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs)
@@ -5896,6 +5902,113 @@
return collection
fill_between.__doc__ = cbook.dedent(fill_between.__doc__) % martist.kwdocd
+def fill_betweenx(self, y, x1, x2=0, where=None, **kwargs):
+"""
+call signature::
+
+ fill_between(y, x1, x2=0, where=None, **kwargs)
+
+Create a :class:`~matplotlib.collections.PolyCollection`
+filling the regions between *x1* and *x2* where
+``where==True``
+
+*y*
+ an N length np array of the y data
+
+*x1*
+ an N length scalar or np array of the x data
+
+*x2*
+ an N length scalar or np array of the x data
+
+*where*
+ if None, default to fill between everywhere. If not None,
+ it is a a N length numpy boolean array and the fill will
+ only happen over the regions where ``where==True``
+
+*kwargs*
+ keyword args passed on to the :class:`PolyCollection`
+
+kwargs control the Polygon properties:
+
+%(PolyCollection)s
+
+.. plot:: mpl_examples/pylab_examples/fill_betweenx.py
+
+.. seealso::
+
+:meth:`fill_between`
+for filling between two sets of y-values
+
+"""
+# Handle united data, such as dates
+self._process_unit_info(ydata=y, xdata=x1, kwargs=kwargs)
+self._process_unit
Re: [matplotlib-devel] [Matplotlib-users] fill_between
On Thu, Apr 30, 2009 at 3:55 PM, T J wrote: > On Thu, Apr 30, 2009 at 2:29 PM, John Hunter wrote: >> >> >> On Thu, Apr 30, 2009 at 4:14 PM, T J wrote: >>> >>> Fill between is for filling between two y-values over a range of >>> x-values. Is there anything which fills between to x-values over a >>> range of y-values? >> >> Nothing with the ease of use of fill_between, but you can always write your >> own PolyCollection, which is what fill_between does (see the function >> implementation for details) or create a Polygon for a simple region. My use >> cases are typically in the time series world where I have datetime on the >> x-axis and some range of values on the y. If folks think it is sufficiently >> useful to have a fill_betweenx function with a similar interface, you could >> probably fairly easy port fill_between to fill_betweenx. >> >> http://matplotlib.sourceforge.net/faq/howto_faq.html#contributing-howto >> > > Done. Attached diff is against rev7075. > I've added the patch to the tracker. http://sourceforge.net/tracker/?func=detail&aid=2786759&group_id=80706&atid=560722 -- Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] Subclasses Axes
Subclasses of Axes, such as PolarAxes, inherit many functions which make implicit assumptions of rectilinear coordinates. From a design perspective, it seems like most of these functions should not belong to the parent class, and that, perhaps, there should exist a RectilinearAxes(Axes) class. Essentially, Axes should contain only the methods that are generic enough for every type of axis. If I were to create my own subclass of Axes, I'll either have to tell people to not use some of the methods or I'll have to re-implement them all (which is definitely not going to happen quickly). Does this refactoring seem reasonable? -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] [Matplotlib-users] No plots show after update
Sorry, quick clarification: With usetex enabled, GTK will not plot GTKAgg will plot WXAgg will plot - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] [Matplotlib-users] No plots show after update
On Thu, Jun 12, 2008 at 3:50 PM, Darren Dale <[EMAIL PROTECTED]> wrote: > On Thursday 12 June 2008 6:36:16 pm T J wrote: >> Sorry, quick clarification: >> >> With usetex enabled, >>GTK will not plot > > I don't think the gtk backend has ever supported usetex. Only the various Agg > backends, postscript, and pdf backends support ustex. > If that is the case, then perhaps there has been a change. I never specified a backend before, so I was using the default. With this default, I was able to plot with usetex enabled. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] plot3d
I can't seem to get 3d plotting to work from the latest svn. I submitted a bug on this: http://sourceforge.net/tracker/index.php?func=detail&aid=1994049&group_id=80706&atid=560720 but I think the issue is more fundamental than an 'import' issue as I described it. Is this a quick fix or does there need to be a more substantial rewrite to get 3d plotting working again. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] Color Parsing Bug
There seems to be an issue with how arguments are parsed when it comes
to determining the color of a line. Generally, it seems that 'c'
takes precedence over 'color'. However, this precedence seems to
change with the number of passed kwargs.
-
import matplotlib.pyplot as plt
import numpy as np
# 'c' seems to have precedence over 'color'
plt.plot(np.arange(10)-2, c='b', color='r') # line is blue
plt.plot(np.arange(10)-1, color='r', c='b') # line is blue
# But...
x = {'c': 'b',
'color': 'r',
'label': 'blah',
'linestyle': '-',
'linewidth': 3,
'marker': None}
# Some strange parsing error
plt.plot(np.arange(10)+1, **x) # line is red
del x['marker'] # delete any key but 'c' or 'color'
plt.plot(np.arange(10)+2, **x) # line is blue
x['zorder'] = 3 # add back any key
plt.plot(np.arange(10)+3, **x) # line is red
plt.show()
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
