[Matplotlib-users] Colormap norm (vmin, vmax) based on visible part of figure

2012-12-16 Thread David Huard
Hi all, I'm wondering if anyone knows how to compute colorbar limits (vmin, vmax) based only on the visible portion of the figure. My use-case is a pcolormesh(x, y, z) drawn over a Basemap instance. The coordinates x and y cover the entire globe, but I'm only mapping the Arctic. What happens is th

Re: [Matplotlib-users] Fetching a data slab with NetCDFFile

2009-09-07 Thread David Huard
', 'before', 'after', 'nearest', that should help with your use case. If this does not fix the problem you are seeing, I'd appreciate having a copy of the file and code to reproduce the problem and find a solution. HTH, David Huard On Mon, Sep 7,

Re: [Matplotlib-users] xticklabels printed twice when using twinx

2009-02-27 Thread David Huard
I'd also be interested in a workaround. I tried to remove the tick labels from the second axe, but it also removed the labels from the first axe. Thanks, David On Sun, Feb 8, 2009 at 9:14 AM, Christoffer Aberg < christoffer.ab...@fkem1.lu.se> wrote: > Hi all, > > I have noticed a funny behaviou

Re: [Matplotlib-users] preventing extra whitespace around figure

2008-02-29 Thread David Huard
Have you tried pdfcrop ? It computes margin automatically, you could then transfer the file back to eps. David PDFCROP 1.5, 2004/06/24 - Copyright (c) 2002, 2004 by Heiko Oberdiek. Syntax: pdfcrop [options] [output file] Function: Margins are calculated and removed for each page in the file. O

Re: [Matplotlib-users] bug or problem in my configuration

2007-10-31 Thread David Huard
I'd like to thank all those who participated in fixing this bug. It's much appreciated. David 2007/10/29, John Hunter <[EMAIL PROTECTED]>: > > On 10/29/07, Michael Droettboom <[EMAIL PROTECTED]> wrote: > > > I submitted a fix for this in matplotlib SVN r4047. Freetype takes a > > FT_LOAD_FORCE_A

Re: [Matplotlib-users] plot cdf

2007-09-27 Thread David Huard
Hi Alan, There is an empiricalcdf function in scipy/sandbox/dhuard/stats.py It's not fancy but it might do what you want. David 2007/9/26, Alan Isaac <[EMAIL PROTECTED]>: > > Is there a standard function or practice for > plotting the CDF of a series? (I am aware > of the output of hist.) > > T

Re: [Matplotlib-users] matplotlib - representation of nan values in 2D

2007-09-26 Thread David Huard
Hi Dirk, If you haven't already done so, look at the numpy.ma module. It provides a masked array object that deals gracefully with missing values. To the best of my knowledge, most matplotlib functions understand masked arrays and deal with it accordingly, exception made of those requiring a full

Re: [Matplotlib-users] No undershoot in hist

2007-03-15 Thread David Huard
Hi Peter, this is also the behavior of the numpy histogram function. I personally don't like it, but I think it's kept for compatibility's sake with Numeric. You could use def histogram(a, bins): n = sort(a).searchsorted(bins) n = concatenate([n, [len(a)]]) count = concatenate([[n[0]],

Re: [Matplotlib-users] DIscretization of colorbar

2007-02-07 Thread David Huard
You can also take a look at the wiki http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations There you'll find the code I had about colormap discretization. Maybe it does the same thing Eric discussed, however. Cheers, David 2007/2/6, Eric Firing <[EMAIL PROTECTED]>: Claas Teichmann

Re: [Matplotlib-users] Subplot order

2007-01-15 Thread David Huard
Salut Nicolas, You can get by with something like: a = arange(nrow*ncol)+1 indices = hstack(a.reshape(nrow, ncol).T) for i in indices: subplot(nrow, ncol, i) ... David 2007/1/15, Nicolas Bigaouette <[EMAIL PROTECTED]>: Hi, I want to compare data and I am doing so with subplots. Ideal

[Matplotlib-users] Limit on the number of plot calls

2006-10-25 Thread David Huard
Hi, is there a limit to the number of times one can call ax.plot(x,y) ?Thanks,David - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your

Re: [Matplotlib-users] Controling the tick thickness

2006-10-05 Thread David Huard
configuration file... sorry 2006/10/5, François Beaubert <[EMAIL PROTECTED]>: Hi all,I have look in the doc and examples but was unable to find a way to controlthe thickness of the major and minor tick on the axis.Forgive me for this very basic question but if you now a way to do that... Thanks a l

Re: [Matplotlib-users] Controling the tick thickness

2006-10-05 Thread David Huard
François, These options can be found in the matplotlibrc configuration figure, or can be set at runtime using the rc command. David2006/10/5, François Beaubert < [EMAIL PROTECTED]>: Hi all,I have look in the doc and examples but was unable to find a way to controlthe thickness of the major and mino

Re: [Matplotlib-users] "Stacked" subplots

2006-09-14 Thread David Huard
Hi,To remove the ticklabels, you could do it with something like[ax.xaxis.set_ticklabels([]) for ax in f.axes[:-1]]David2006/9/14, Jose Gomez-Dans < [EMAIL PROTECTED]>:Hi!I am coding a little application that shows a number of subplots (of the 511, 512...515 type) stacked up. They all have the same

[Matplotlib-users] Default dpi for savefig

2006-09-12 Thread David Huard
Hi, I'm a little bit lost with respect to setting the resolution of images saved in png.The  matplotlibrc file sets the dpi to 80, but the default keyword argument of savefig is set to 150. Thus, changing the rc setting to dpi=300 does not modify savefig's default behaviour.  Is there a way to set

[Matplotlib-users] vertical alignment of text

2006-09-04 Thread David Huard
Hi all, Is there a way to align text vertically so that the characters sit on a continuous line ? When I dotext(.5, .5, 'abc', verticalalignment='center')text(.6, .5, 'pqr', verticalalignment='center') both words are not aligned since the bars of p and q push the text upwards. I get similar problem

Re: [Matplotlib-users] How do a simple poit plots?

2006-09-01 Thread David Huard
Hi, It's pretty hard to figure out exactly what your problem is without more info. Did you check that the scaling was identical in gnuplot and matplotlib ? matplotlib will set the axes so that all data are included in the figure, so if you have large outliers, the scaling will be too large and its

Re: [Matplotlib-users] Combining figures

2006-08-01 Thread David Huard
There is a nice little trick where you can make two axes share the same xaxis.  Then when you pan or zoom on one, the other isautomagically changed toax1 = subplot(211)ax2 = subplot(212, sharex=ax1)But that's not retroactive, or is it ? i.e. if ax2 has a wider x range than ax1, it won't show up. f

Re: [Matplotlib-users] Combining figures

2006-07-31 Thread David Huard
Hi John, Thanks for taking the time to answer a badly formulated question. With your indications, I have been able to get an example working.The point was that I had a function with a number of arguments that returned a subplot(111) instance. Inside this function there are thousands of  calls to pl

[Matplotlib-users] Combining figures

2006-07-31 Thread David Huard
Hi, I have a function fig(x) that returns a subplot instance,and I'd like to make a new figure by calling this function twice.  For example:def fig(x):    s = subplot(111)    return s.plot(x) and i wan't to do something like:fig = figure(figsize = (6,12))fig.add_axes(fig(x1))fig.add_axes(fig(x2))ax

Re: [Matplotlib-users] color bar with non-linear spacing

2006-06-29 Thread David Huard
m a continuous range.    Example :    >>> _palette_data = cpt2seg('palette.cpt')    >>> palette = matplotlib.colors.LinearSegmentedColormap ('palette',_palette_data, 100)    >>> imshow(X, cmap=palette)    Licence: MIT    Author: David Huard, 2006    "&

Re: [Matplotlib-users] showing an image on log axes?

2006-06-15 Thread David Huard
Hi, Numpy has a logspace function, so it may be a bad idea to create a function in pylab with the same name that does something slightly different.def logspace(start,stop,num=50,endpoint=True,base=10.0):    """Evenly spaced numbers on a logarithmic scale.     Computes int(num) evenly spaced exponen

Re: [Matplotlib-users] line labels?

2006-06-08 Thread David Huard
Hi, I'd do it the quick way:str = [...] # list of strings for the labels.x[:] # abcisse vectory[i][:] # list of ordinate vector (y[i][:] contains the data for the ith line)for i in range(10):     text(x[-1], y[i][-1], str[i], horizontalalignement='left')David2006/6/7, Webb Sprague <[EMAIL PROTECTED

Re: [Matplotlib-users] histogram

2006-06-02 Thread David Huard
array (Nbin + 1)    normed: Normalization factor. Setting it to True will normed the density to 1.    weighted  : Boolean indicating whether or not the data is weighted.     """ # License: MIT # Author: David Huard # Changes log # 2006, June 2: Completed object interface # May : S

Re: [Matplotlib-users] histogram

2006-05-29 Thread David Huard
Hum, I did, but it is still pretty rough. I did some changes to it a while ago to use objects and it still isn't complete. I'll try to get the class in working order by the weekend. Cheers, David