You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
| 2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
| 2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
| 2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
| 2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
| 2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
| 2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
| 2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
| 2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
| 2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
| 2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
| 2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
| 2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
| 2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
(19) |
2
(28) |
3
(8) |
|
4
(15) |
5
(20) |
6
(23) |
7
(12) |
8
(11) |
9
(13) |
10
(4) |
|
11
(9) |
12
(34) |
13
(33) |
14
(24) |
15
(15) |
16
(12) |
17
(8) |
|
18
(5) |
19
(5) |
20
(6) |
21
(10) |
22
(9) |
23
(18) |
24
(10) |
|
25
(7) |
26
(13) |
27
(18) |
28
(29) |
29
(4) |
30
(5) |
31
(2) |
|
From: Chengkun H. <hu...@gm...> - 2009-10-07 23:39:38
|
Hi all,
I am just started to use matplotlib and have a question about
using blit method to animate plots. I wrote something like this to
show the initial plot (other part of the code not shown):
....
l1, = p1.plot(lineout, animated=True)
p1.set_xlabel(xlabel)
p1.axis(data_range)
plt.draw()
background = canvas.copy_from_bbox(p1.bbox)
p1.draw_artist(l1)
canvas.blit(p1.bbox)
...
This works and showes the first plot, however, zooming and panning
using the toolbar will make plot disappear (only empty background
left). So I wonder if there is a way to make zooming and panning work
with the blit method.
Thank you!
Chengkun
|
|
From: John [H2O] <was...@gm...> - 2009-10-07 23:10:21
|
Jeff,
Here's a quick snippet. I've looked at the test.py file provided with the
basemap examples. What I am unclear on are the different ways in which nx
and ny are defined. I would like to have this 'automatically' defined, based
solely on variables from my input object.. say for example a netcdf file
that has len and lon dimensions defined.
Below is my crude stab at it, but I am clearly having some problems. I guess
the point is, maybe it's not possible to have a Basemap instance with
extents beyond the imshow object. Then perhaps I need to make sure that when
I set up the Basemap instance, I pass the H.outlon0 to llcrnrlon for
example. But is that necessary?
Thanks!
#!/usr/bin/env python
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
def plot_imshow_custom(H,transform=True ):
"""
function to automagically plot an mxn array of arbitrary lats/lons
"""
data = H.data
print data.shape
m =
Basemap(projection='npstere',boundinglat=10,lon_0=270,resolution='l')
fig = plt.figure()
ax = fig.gca()
print "Preparing to plot %s with dimensions:" % H.name
print "lon0, numx, dx:"
print H.outlon0, H.numxgrid, H.dxout
print "lat0, numy, dy:"
print H.outlat0, H.numygrid, H.dyout
## set up transformations for the data array
## THIS IS WHERE I NEED SOME HELP:
if m.projection not in ['cyl','merc','mill']:
lats = np.arange( H.outlat0, ( H.outlat0 + ( H.numygrid*H.dyout ) ),
H.dyout )[:-1]
lons = np.arange( H.outlon0, ( H.outlon0 + ( H.numxgrid*H.dxout ) ),
H.dxout )[:-1]
data = data[:-1,:-1]
else:
lats = np.arange( H.outlat0, ( H.outlat0 + ( H.numygrid*H.dyout ) ),
H.dyout )
lons = np.arange( H.outlon0, ( H.outlon0 + ( H.numxgrid*H.dxout ) ),
H.dxout )
print data.shape
## transform to nx x ny regularly spaced native projection grid
if transform:
if m.projection not in ['cyl','merc','mill']:
dx = 2.*np.pi*m.rmajor/len(lons)
dy = 2.*np.pi*m.rminor/len(lats)
else:
dx = len(lons)
dy = len(lats)
nx = int((m.xmax-m.xmin)/dx)+1;
ny = int((m.ymax-m.ymin)/dy)+1
print nx
if nx is 1:
topodat = data
else:
topodat = m.transform_scalar(data,lons,lats,nx,ny)
else:
topodat = data
## Get the current axes, and properties for use later
pos = ax.get_position()
l, b, w, h = pos.bounds
## Set up the IMAGE
colmap = plt.get_cmap('gist_ncar')
im = m.imshow(topodat,cmap=colmap)
m.drawcoastlines()
return fig
class SuperDict(dict):
"""just so I can use . notation"""
def __getattr__(self, attr):
return self[attr]
def __setattr__(self, attr, value):
self[attr] = value
if __name__ == "__main__":
H = SuperDict()
H.name = 'working example'
H.outlat0 = -90
H.numygrid = 180
H.dyout = 1.
H.outlon0 = -179
H.numxgrid = 360
H.dxout = 1.0
H.data = np.random.rand(H.numygrid,H.numxgrid)
print H.data.shape
fig = plot_imshow_custom(H,transform=True)
plt.show()
print 'it worked'
try:
H.name = 'Not working example'
H.outlat0 = 40
H.numygrid = 100
H.dyout = 0.5
H.outlon0 = -179
H.numxgrid = 110
H.dxout = 0.5
H.data = np.random.rand(H.numygrid,H.numxgrid)
fig = plot_imshow_custom(H)
print 'huh?'
plt.show()
except:
print "As I said, it's not working..."
Jeff Whitaker wrote:
>
> John [H2O] wrote:
>> I'm trying to 'automate' a few components within basemap. I have a pretty
>> complicated, and assuredly poorly written, set of functions that allow me
>> to
>> 'dynamically' plot a grid of data (lon,lat).
>>
>> Here is one section where I try to deal with transforming the data based
>> on
>> the projection. 'data' is a grid, often of size 720x360 or 720x180,
>> representing full globe or hemisphere at 0.5 degree resolution.
>> 'outlon0',
>> outlat0', and 'd*out' are the llcrnr coordinates and step. 'transform' is
>> an
>> option, that is set to True by default:
>>
>> 1680 ## set up transformations for the data array
>> 1681 if m.projection not in ['cyl','merc','mill']:
>> 1682 lats = np.arange( outlat0, ( outlat0 + ( numygrid*dyout ) ),
>> dyout )[:-1]
>> 1683 lons = np.arange( outlon0, ( outlon0 + ( numxgrid*dxout ) ),
>> dxout )[:-1]
>> 1684 data = data[:-1,:-1]
>> 1685 else:
>> 1686 lats = np.arange( outlat0, ( outlat0 + ( numygrid*dyout ) ),
>> dyout )
>> 1687 lons = np.arange( outlon0, ( outlon0 + ( numxgrid*dxout ) ),
>> dxout )
>> 1688
>> 1689 ## transform to nx x ny regularly spaced native projection grid
>> 1690 if transform:
>> 1691 dx = 2.*np.pi*m.rmajor/len(lons)
>> 1692 nx = int((m.xmax-m.xmin)/dx)+1; ny =
>> int((m.ymax-m.ymin)/dx)+1
>> 1693 if nx is 1:
>> 1694 topodat = data
>> 1695 else:
>> 1696 topodat = m.transform_scalar(data,lons,lats,nx,ny)
>> 1697 else:
>> 1698 topodat = data
>>
>> The problem is, when I use the approach with a 'cyl' grid, then
>> subsequently
>> try to draw the lsmask, I get a failure. Is this approach incorrect? I
>> had
>> to use the if nx is 1 statement because it was crashing with zero
>> division
>> error in some cases.
>>
>> Thanks.
>>
> John: Please supply us with a self-contained example triggering the
> error that we can run.
>
> -Jeff
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register
> now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
View this message in context: http://www.nabble.com/basemap%2C-transform_scalar-question-tp25649437p25795985.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Ann N. <Ann...@no...> - 2009-10-07 17:13:42
|
Thanks, Matthias, Your code suggestion works. I was aware of xlim but must not have used it correctly, before contacting matplotlib-users. I think I tried set_xlim, but did not use the get_xlim function. With your code added, the minor tick mark locations line up correctly too. Thanks again, Ann Matthias Michler wrote: > Hi Ann, > > I'm not sure I understood correctly, but maybe it is useful to change the > xlimits slightly, e.g. datetime(1998,4,20,0) instead of (the default value in > this case) datetime(1998,4,20,1): > > ax.set_xlim( date2num(datetime(1998,4,20,0)), ax.get_xlim()[1] ) > > >> Also the minor tick marks do not look right, especially the ones just to >> the right of each x-axis label. >> > I cannot see these unexpected behaviour of the tick marks (as in your png) > with current svn, but I'm not sure this is the reason. > > Kind regards, > Matthias > > On Tuesday 06 October 2009 22:15:25 Ann Newman wrote: > >> I am plotting time-series 1-minute cadence data for specific >> multiple-day validation periods. >> >> Sometimes the data have a gap between the start of the validation period >> and the start of the data. Attached is a stand-alone Python script that >> demonstrates the problem, along with the plot that the script produces. >> >> April 20 is the start of the validation period. I want 04-20 to appear >> at the plot origin. This does not happen unless either the model or >> observed dictionary contain a key/value pair for 1998,4,20,0. >> I tried adding datetime(1998,4,20,0):None to one or both >> dictionaries, but it is ignored. >> >> Also the minor tick marks do not look right, especially the ones just to >> the right of each x-axis label. >> >> Do you have any suggestions? >> >> Thanks, >> Ann >> >> I am working on a Windows PC; O/S is Windows XP Professional, Version >> 2002, Service Pack 3. >> I am running matplotlib, version '0.99.0' which I obtained from the >> matplotlib Sourceforge site. >> I have not customized matplotlibrc. >> I am running python version 2.6.2. >> Attached is output.txt, the result of running my script with a >> verbose-helpful >> > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-07 17:05:27
|
As far as I know, there is no easy way to do that with mpl (especially when image is involved). You may manually add ticks and ticklabels (but without using set_ticks, etc). If you're using 0.99 and later, you may use axes_grid toolkit, but it has some cons. So, if you're going to use it, please read through the documentation. from mpl_toolkits.axes_grid.parasite_axes import SubplotHost import matplotlib.pyplot as plt import matplotlib.transforms as mtransforms fig = plt.figure(1, (4,3)) ax = SubplotHost(fig, 111) fig.add_subplot(ax) ax.imshow([[1,2],[3,4]], origin="lower") # transform from arcsecond to pixel tr = mtransforms.Affine2D().translate(+1,+1).scale(2., 2.) ax2 = ax.twin(tr) plt.show() Regards, -JJ On Wed, Oct 7, 2009 at 6:14 AM, Pim Schellart <p.s...@gm...> wrote: > Hi Everyone, > > after trying every example I could find in the documentation, gallery > and online I thought let's give the mailing list a try. > I have an image displayed with imshow. > I would like to display the pixel coordinates on the left y and bottom > x axis and the physical coordinates (in arcseconds) on the right y and > top x axis. > I tried it with twinx & twiny but then only a part of the image is > shown (image is in pixel coordinates), I also tried creating a new > axes object with ax2=plt.subplot(1,1,1, frameon=False) but then the > image is no longer shown (this might be a bug). > Is this possible with the current version (0.99) of matplotlib? > > Kind regards, > > Pim Schellart > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-07 16:33:52
|
Text instances have "get_window_extent" method. However, it requires a renderer instance (because the size of the text depends on the backend), i.e., the size of the text is only known during the drawing time. The easiest ways is to call get_window_extent without any argument, but after figure is already drawn. However, it depends on why you need the size of the text. Regards, -JJ On Tue, Oct 6, 2009 at 9:54 AM, Donovan Parks <don...@gm...> wrote: > Hello, > > I'm new to matplotlib, but have made great progress in using it over > the past few days (thanks in no small part to this list). However, I > am stuck on trying to determine the width of a y tick label (either in > inches or figure space). I know I can get 'Text instances' of the tick > labels using 'get_yticklabels'. However, a Text object doesn't appear > to have a width field. Now, it would make sense that the width of a > label depends on the rendered so I expect I need to take my text > string and pass it through an appropriate transformation using > something like 'get_yaxis_text1_transform'. Can anyone point me to an > example of obtaining the width of a label and/or some code indicating > how this can be done? > > I realize I can approximate the width of a label simply by considering > how many characters it contains, the font size, and the DPI of the > figure, but this will be rather crude as I am not using a fixed-width > font. > > Much thanks. > > Cheers, > Donovan > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Jason S. <jas...@gm...> - 2009-10-07 16:31:28
|
On Wed, Oct 7, 2009 at 12:12 PM, Jae-Joon Lee <lee...@gm...> wrote: > Jason, > > This is now fixed in the svn. > Meanwhile, you may use the following workaround. Great! Thanks for the help! Jason |
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-07 16:20:06
|
moving around artists form one axes to the other can be very tricky
due to the underlying design of mpl. So, it is generally better idea
to create artists for each axes, instead of reusing them.
For a simple case as yours, adding the following line after
line.remove() will work.
line._transformSet = False
Regards,
-JJ
On Mon, Oct 5, 2009 at 12:37 PM, TP <par...@fr...> wrote:
> Hi everybody,
>
> I try to move an instance of matplotlib.lines.Line2D from one subplot to
> another. How to do that? I have tried the following code, but the Line2D
> does not appear on the second subplot.
>
> Thanks in advance,
>
> Julien
>
> ###############
> from pylab import *
>
> ion()
> f = figure()
> s = f.add_subplot("211")
> line = matplotlib.lines.Line2D([0,1],[0,1],color='m')
> s.add_line( line )
> s2 = f.add_subplot("212")
>
> draw()
>
> raw_input( 'press a key to remove the line and try to add it to second
> subplot' )
>
> line.remove()
> s2.add_line( line )
> draw()
>
> raw_input('press a key to quit')
> #####################
>
> --
> python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\
> 9&1+,\'Z4(55l4('])"
>
> "When a distinguished but elderly scientist states that something is
> possible, he is almost certainly right. When he states that something is
> impossible, he is very probably wrong." (first law of AC Clarke)
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-10-07 16:13:20
|
Jason, This is now fixed in the svn. http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/patches.py?r1=7840&r2=7857 Meanwhile, you may use the following workaround. import matplotlib import pylab from matplotlib.path import Path if __name__ == '__main__': pylab.clf() ax = pylab.axes([0,0,1,1]) ax.add_line(matplotlib.lines.Line2D((2, 5), (0.75, 6))) arc = matplotlib.patches.Arc((2, 0), 1.5, 1.5, 0.0, 0, 180.0, fill=False) arc._path = Path.arc(arc.theta1, arc.theta2) ax.add_patch(arc) ax.axis('equal') Note that the current pathces.Arc may update its _path during draw(). So, you may need to do arc._path = Path.arc(arc.theta1, arc.theta2) whenever correct extent of the arc is required (i.e., before calling axis). Regards, -JJ On Sun, Oct 4, 2009 at 11:51 PM, Jason Sewall <jas...@gm...> wrote: > On Sun, Oct 4, 2009 at 11:45 PM, Eric Firing <ef...@ha...> wrote: >> Use the Axes.set_aspect() method for full control of the aspect ratio, and >> of what gets changed to preserve that aspect ratio. > > Thanks, that works great! Any ideas about Arc's effect on the 'tight' bounds? > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: <mar...@aq...> - 2009-10-07 14:15:13
|
Hi, I am quite new to python and matplotlib!! When plotting a simple graph using python and matplotlib my plot appears however the area (background) where my x.label and y.label and axes limits lie is grey, does anyone know how to set this to another color ie. white???? Thanks Maria -- View this message in context: http://www.nabble.com/Background-colours-tp25787444p25787444.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Matthew C. <mat...@gm...> - 2009-10-07 11:08:38
|
Hi all, What would be really useful for me, is to be able to hatch the area filled using the fill_between() method, instead of using solid color. Does anybody know if this is possible? Thanks in advance, Matt |
|
From: Pim S. <p.s...@gm...> - 2009-10-07 10:14:48
|
Hi Everyone, after trying every example I could find in the documentation, gallery and online I thought let's give the mailing list a try. I have an image displayed with imshow. I would like to display the pixel coordinates on the left y and bottom x axis and the physical coordinates (in arcseconds) on the right y and top x axis. I tried it with twinx & twiny but then only a part of the image is shown (image is in pixel coordinates), I also tried creating a new axes object with ax2=plt.subplot(1,1,1, frameon=False) but then the image is no longer shown (this might be a bug). Is this possible with the current version (0.99) of matplotlib? Kind regards, Pim Schellart |