Re: [Matplotlib-users] aligning plot width with imshow/contour width

2014-11-19 Thread zhangtao
I use matolotlib 1.3.1 on windows, the code works fine here. what version of matolotlib are you using? Or, set space to 0, see what happens. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/aligning-pl

Re: [Matplotlib-users] aligning plot width with imshow/contour width

2014-11-19 Thread Ken Mankoff
Hi Zhangtao, When I run that code I do not see the 2nd subplot. If I add "fig.canvas.draw()" to the bottom, it appears, but it is not the same width as the upper subplot. On Tue, Nov 18, 2014 at 10:15 AM, zhangtao wrote: > from matplotlib.pylab import * > fig = plt.figure(1) > fig.clf() > data

Re: [Matplotlib-users] Create image with higher resolution basemap

2014-11-19 Thread jorma
Thanks Ben! That helped. I ended up using this method instead… map.arcgisimage(service='ESRI_Imagery_World_2D', xpixels = 1500, verbose= True) Works great! - Jorma -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Create-image-with-higher-resolution-basemap-tp44428p44

Re: [Matplotlib-users] Single color transparent colormap

2014-11-19 Thread Benjamin Root
What you are seeing is the fact that the adjacent cells share the same coordinates, so neighboring cells overlap by one pixel. This is only visible when alpha != 1. This is a tricky issue to solve, but I could have sworn we made some progress on that front by setting "snap" to False somewhere. Ther

Re: [Matplotlib-users] Single color transparent colormap

2014-11-19 Thread Loïc Estève
Thanks for the suggestions, I have tried the easiest one for now, namely pcolormesh, see attached plot. The alpha colormap look great but I can't seem to figure out how to prevent the edges of the cells from being visible. I tried using edgecolors='none' to no avail. I guess retrospectively tha

Re: [Matplotlib-users] Single color transparent colormap

2014-11-19 Thread Jody Klymak
Did you try pcolormesh? Cheers, Jody > On Nov 19, 2014, at 7:23 AM, Gael Varoquaux > wrote: > > On Wed, Nov 19, 2014 at 10:20:23AM -0500, Benjamin Root wrote: >> Notice that the colormap looks fine for the colorbar because it >> isn't using imshow() under the hood. > > As a short-term worka

Re: [Matplotlib-users] Single color transparent colormap

2014-11-19 Thread Benjamin Root
The underlying mechanism is a pcolormesh(). The key thing to remember when going back and forth between imshow and pcolors is that coordinates for imshow refer to the center of the pixel, while coordinates for pcolors refer to the corners, IIRC (I might have that backwards). Cheers! Ben Root On W

Re: [Matplotlib-users] Single color transparent colormap

2014-11-19 Thread Gael Varoquaux
On Wed, Nov 19, 2014 at 10:20:23AM -0500, Benjamin Root wrote: > Notice that the colormap looks fine for the colorbar because it > isn't using imshow() under the hood. As a short-term workaround (I work with Loic, and I it would help me a lot if his problem was solved with a hack), can we leverage

Re: [Matplotlib-users] Single color transparent colormap

2014-11-19 Thread Benjamin Root
Confirmed. I am going to wager that this might be related to some of the work that is being done right now in master to improve alpha handling, particularly with images. Notice that the colormap looks fine for the colorbar because it isn't using imshow() under the hood. First, if you could try usi

[Matplotlib-users] Single color transparent colormap

2014-11-19 Thread Loic Esteve
Dear all, I am trying to create a colormap with a single color (red in the example below) where the alpha varies from 0 to 1. It does look like I am getting some grayish color near the low alpha values (around alpha = 0.2). Is that expected somehow? The plot I get is here: https://cloud.gith