Am Thu, 29 May 2014 14:14:52 -0700
schrieb Antony Lee :
> Hi,
> When histogramming integer data, is there an easy way to tell
> matplotlib that I want a certain number of bins, and each bin to
> cover an equal number of integers (except possibly the last one)?
> (in order to avoid having some bins
Hey,
I know that you're not supposed to draw a greatcircle with Basemaps
drawgreatcircle() when it will hit the border of the map. But I think
it works pretty well except for the attempt to connect the line (see
horizontal lines in [1]). Is there a way to not get these horizontal
lines?
Does some
Sun, 6 Oct 2013 15:41:07 -0500 Tony Yu :
> The return value for streamplot is a bit hacked together. Its just a
> simple object containing a line collection and an arrow collection.
> Instead of passing the set of collections, just pass one of the
> collections to the colorbar. For example:
>
>
Hey,
I'm trying to plot streamplots into an axesgrid object with something
like:
fig = pl.figure(1, (13, 20))
grid = AxesGrid(fig, 111,
nrows_ncols = (3, 2),
axes_pad = 0.6,
cbar_location = 'top',
cbar_mode = 'each',
Fr, 7 Jun 2013 10:13:26 -0400 Michael Droettboom :
> Have you tried setting ps.usedistiller to False, or xpdf? There have
> been problems using Ghostscript as a distiller with recent versions
> of Ghostscript.
No, I didn't try. Thanks for the hint, I will test that.
> We'll need a minimal exa
I'm having problems recently with printing EPS figures created by
matplotlib. To me this is strange because printing postscript should
just work in my opinion.
My most recent example is a Basemap thing with AxesGrid. Basically the
idea was to have six maps nicely arranged on a DIN A4 paper for
pri
i use something like that:
from datetime import datetime, timedelta
import matplotlib.pyplot as pl
import matplotlib.ticker as ticker
import matplotlib.dates as mdates
dates1 = [datetime(2005,5,11)+n*timedelta(days=1) for n in range(500)]
dates2 = [datetime(...
ax1 = pl.subplot(2,1,1)
ax1.plot(d
following the example [1] i can't get the
colorbar extend colors to show properly.
here is what i did:
import matplotlib.pyplot as plt
import matplotlib.cm as cm
levels = np.linspace(.01,.69,10)
<...>
im = plt.contourf(x, y, z, levels, extend='both', cmap=cm.BuPu)
im.cmap.set_under('yellow')
im.c
+--- Jae-Joon Lee ---+
> This seems to be a bug that need to be fixed.
> Meanwhile, use "locator" parameter as below.
>
> cbar = grid.cbar_axes[0].colorbar(im, locator=ticks)
that works, thank you!
best regards, yoshi
-
does someone knows how to specify ticks for a colorbar
inside axesgrid? the following does not work as expected:
from mpl_toolkits.axes_grid1 import AxesGrid
ticks = [.01, .25, .5, .75, .99]
grid = AxesGrid()
[...]
grid.cbar_axes[i].colorbar(im, ticks=ticks)
i'm thankfull for any pointers,
yoshi
> grid = AxesGrid(fig, 132,
> nrows_ncols = (3, 2),
> axes_pad = 0.1,
> cbar_location = "top",
> cbar_mode="single",
>)
solved by using:
grid = AxesGrid(fig, 111,
...)
best regards, yoshi
--
+- Yoshi Rokuko ---+
> this works in principle, but however i can't increase
> the size of the grid.
>
> even if i try something like:
>
> fig = plt.figure(1, (15,18))
> fig.subplots_adjust(left=0.01, bottom=0.01,
>
+-- Benjamin Root ---+
> Why not something like this:
>
> fig = plt.figure()
> grid = AxesGrid(...)
> bm = Basemap(...)
> for ax in grid :
> x, y = bm(lon, lat)
> ax.scatter(x, y, vmin=globalmin, vmax=globalmax)
>
> I do variations of this all the time.
Th
> is there a way for using Basemap with AxisGrid?
>
> did someone try something like:
>
> grid = AxisGrid()
> for i in range(4):
> grid[i].scatter(with underlying Basemap)
the common thing is probably something like:
fig = pl.figure()
for i in range(4):
fig.add_subplot(2,2,i)
bm = B
is there a way for using Basemap with AxisGrid?
did someone try something like:
grid = AxisGrid()
for i in range(4):
grid[i].scatter(with underlying Basemap)
?
thank you and best regards, yoshi
--
RSA(R) Conference
+--- Jeff Whitaker ---+
> You can use the pad_inches keyword to adjust the amount of space left
> around the map.
>
<...>
> plt.savefig('bboxtight.png', bbox_inches='tight',pad_inches=0.45)
yes that works fine (0.5 inches in my case).
thank you.
if one saves a Basemap plot with savefig option
bbox_inches='tight' geographical coordinates
are cut:
bmap = Basemap(...)
bmap.drawparallels([those,numbers,are,gone],
labels=[1,0,0,0])
bmap.drawmeridians([those,numbers,are,gone],
labels=[0,0,0,1])
plt.contourf
+ Keith Hughitt -+
> Hi all,
>
> Does anyone know of a good way to create a new LinearSegmentedColormap
> based off an existing one?
>
> I have a function which attempts to generate N "optimal" color map
> indices for a given data array. In
you mean something like that?
m.contourf(x, y, var, np.linspace(-100,100,33))
best regards
--
FREE DOWNLOAD - uberSVN with Social Coding for Subversion.
Subversion made easy with a complete admin console. Easy
to use, e
+- Jeff Whitaker ---+
>
> Here's the basic idea:
>
> 1) read the germany.dat file, use it to create a _geoslib Poly instance,
> i.e.
>
> from mpl_toolkits.basemap import _geoslib
> b = np.asarray([lons,lats]).T # lons and lats are lists.
> germany
what are you using right now, something like that?
>>> a = np.random.random(70)
>>> x = np.empty([10,a.shape[0]])
>>> x[:,:] = a
>>> pl.contourf(x)
you might want to suppress ticks on the y-axis.
best regards, yoshi
--
+- Jeff Whitaker ---+
> On 7/14/11 2:25 PM, Yoshi Rokuko wrote:
> > hi, is it possible to restrict a contour plot to a
> > country? if i grid my data to projection coordinates
> > and then make a contour plot i can draw the c
hi, is it possible to restrict a contour plot to a
country? if i grid my data to projection coordinates
and then make a contour plot i can draw the country
borders on top, but since the data plotted outside
the country is a gridding artifact i would rather
not plot it.
to make it more clear what i
23 matches
Mail list logo