SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
(1)
2
(12)
3
(12)
4
(19)
5
(7)
6
(6)
7
(2)
8
(2)
9
(11)
10
(15)
11
(27)
12
(27)
13
(18)
14
(3)
15
(3)
16
(25)
17
(9)
18
(3)
19
(4)
20
(2)
21
(4)
22
(9)
23
(28)
24
(18)
25
(16)
26
(9)
27
(4)
28
(13)
29
(15)
30
(33)





Showing results of 346

<< < 1 .. 10 11 12 13 14 > >> (Page 12 of 14)
From: Brent P. <bpe...@gm...> - 2009年11月09日 23:28:27
On Mon, Nov 9, 2009 at 3:18 PM, Jae-Joon Lee <lee...@gm...> wrote:
> On Mon, Nov 9, 2009 at 6:03 PM, Brent Pedersen <bpe...@gm...> wrote:
>> how can i have the divider account for the room needed
>> for the
>> labels and ticks?
>
> Doing this automatically is not straight forward. So you need to
> manually adjust the area occupied by the axes.
> Note that rect is [left, bottom, width, height] in normalized figure
> coordinate. Try something like rect=[0., 0.1, 1., 0.8], or simply use
> subplot.
that does it. thanks, i forgot it was height, not ymax.
-brent
>
> Regards,
>
> -JJ
>
From: Jae-Joon L. <lee...@gm...> - 2009年11月09日 23:18:49
On Mon, Nov 9, 2009 at 6:03 PM, Brent Pedersen <bpe...@gm...> wrote:
> how can i have the divider account for the room needed
> for the
> labels and ticks?
Doing this automatically is not straight forward. So you need to
manually adjust the area occupied by the axes.
Note that rect is [left, bottom, width, height] in normalized figure
coordinate. Try something like rect=[0., 0.1, 1., 0.8], or simply use
subplot.
Regards,
-JJ
From: Brent P. <bpe...@gm...> - 2009年11月09日 23:04:10
hi, i'd like to use the divider stuff in axes_grid to plot a figure
with 2 axes, with xticks on the bottom axis.
in the script pasted below, if i use 0.07 as the min for the y-axis,
then it chops off the top of the plot. if i use 0 as the min, then
it doesn't chop of the top, but it doesnt show the x-axis
ticks/labels. how can i have the divider account for the room needed
for the
labels and ticks?
i've also tried:
hori = [Size.AxesX(axes[0])]
vert = [Size.Scaled(0.3), Size.Scaled(0.7)]
d = Divider(f, rect, hori, vert)
with same problem.
thanks,
-brent
===========================================
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid import make_axes_locatable
import numpy as np
plt.close()
f = plt.figure()
rect = (0, 0.07, 1, 1)
#rect = (0, 0, 1, 1)
ax = f.add_axes(rect, autoscale_on=False, aspect="auto")
divider = make_axes_locatable(ax)
ax2 = divider.new_vertical(size="30%", pad=0.0)
f.add_axes(ax2)
axes = [ax, ax2]
for ax in axes:
 ax.plot(np.sin(np.linspace(0, 10, 1600)))
 ax.set_xlim(0, 1600)
 ax.set_ylim(-1, 1)
axes[1].set_xticks([])
plt.show()
From: Tim B. <Tim...@no...> - 2009年11月09日 22:58:31
On 10/11/2009, at 3:37 AM, Christopher Barker wrote:
> Tim Burgess wrote:
>> So....decided to go down the MacPorts path. Many automated 
>> downloads later, I now have a successful Basemap install (yay!)
>> Many thanks to the folks who have contributed to MacPorts and 
>> interestingly geos 3.1.1 is installed.
>
> Is it 64 bit now. If so...
>
>
>> Only present worry is that wxWidgets port is not building on 10.6 - 
>> yet to resolve that.
>
> wxWidgets/wxPython can not be built (for the Mac) 64 bit. It is 
> built on Carbon, which Apple has not and will not port to 64 bit. 
> There is a Cocoa version of wxMac, but it's not done yet, and has 
> not been wrapped for Python.
>
> You may be able to get a 64bit GTK/X11 wxPython working with 
> MacPorts -- I've never tried that.
>
>
>> And FYI, to check whether you have a 64bit Python install:
>> >>> import sys; print sys.maxint
>> 9223372036854775807
>
> So it looks like you are running 64 bit -- what a pain this all is.
>
> -Chris
Yes, I'm running all 64bit now. Can't say I'm seeing dramatic 
performance improvements as I haven't done much in basemap in 32bit to 
compare.
I did find a couple of problems with the current MacPort basemap. I 
could create a Basemap object with a resolution of 'c' but specifying 
a resolution of 'i' caused a program failure.
And the example 'warpimage.py' failed to run as well.
The error wasn't obvious to my eye so I simply did an svn checkout and 
built the code into an .egg and then did an /opt/local/bin/ 
easy_install-2.6 basemap-0.99.5-py2.6-macosx-10.6-i386.egg
I can now use the higher resolution option and warpimage.py all runs 
fine.
As for wxWidgets, there is some pain there. Pierre GM (thanks!) made 
the suggestion of simply using the MacOSX matplotlib backend and so 
problem neatly side-stepped (for me at least).
~~~~~~~~~~~~~~
Tim Burgess
Software Engineer - Coral Reef Watch
Satellite Applications and Research - NESDIS
National Oceanic and Atmospheric Administration
http://www.coralreefwatch.noaa.gov
675 Ross River Rd, Kirwan QLD Australia 4817
tim...@no...
Ph +61-7-47551811
Fax +61-7-47551822
From: Robert K. <rob...@gm...> - 2009年11月09日 20:28:45
On 2009年11月09日 11:46 AM, Chloe Lewis wrote:
> ... and for dessert, is there a circular colormap that would work for
> the colorblind?
Almost certainly not, at least not without compromising other desirable features 
for circular colormaps. You could do a circle roughly perpendicular to the lines 
of confusion, but this would mean going up and down in lightness, which 
perceptually overemphasizes the light half.
On the other hand, this may not be a bad thing if 0 degrees and/or 180 degrees 
are special as might be the case with phase measurements and other complex 
number-related things.
> My department is practicing presenting-science-for-the-general-public,
> and the problems 'heat maps' have for the colorblind keep coming up.
As a deuteronopic, I heartily thank you for paying attention to these issues.
I've written an application to visualize colormaps in 3D perceptual space as 
well as simulating colorblindness. It uses Mayavi and Chaco, so you will need a 
full Enthought Tool Suite installation:
http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/colormap_explorer/
Of interest for this thread might be the function find_chroma() in hcl_opt.py 
which will, given a lightness value in HCL space, find the largest chroma value 
(roughly similar to saturation) such that a circle at the given lightness value 
will just fit inside of the RGB gamut. A simple maximization on that function 
will find the lightness that gives the largest chroma and hence the largest 
dynamic range of such a colormap. However, it should be noted that I have found 
such colormaps to appear a little washed out and drab. But then, I'm colorblind.
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco
From: Jae-Joon L. <lee...@gm...> - 2009年11月09日 18:08:44
On Thu, Nov 5, 2009 at 2:31 PM, Thomas Robitaille
<tho...@gm...> wrote:
> Is there an easy way to add axes to a figure, but specify the 'rect'
> in real rather than relative units? For example, something like:
>
unfortunately no. And I'm not sure if matplotlib will ever going to
support it internally.
However, converting axes coordinates given in inches to the normalized
figure coordinates is not that difficult. And this will work as far as
the figure size does not change after the axes position is calculated
in the normalized figure coordinates.
fig = figure(1)
rect_inches = 0.5, 0.5, 3., 3.
from matplotlib.transforms import Bbox, BboxTransformFrom, TransformedBbox
tr = BboxTransformFrom(Bbox.from_bounds(0, 0, *fig.get_size_inches()))
rect = TransformedBbox(Bbox.from_bounds(*rect_inches), tr).bounds
ax = fig.add_axes(rect)
Note that the axes coordinate need to be recalculated whenever the
figure size changes.
While the axes_grid toolkit has some limited support for fixed size
(in inches) axes, I personally never find it useful.
http://matplotlib.sourceforge.net/examples/axes_grid/demo_fixed_size_axes.html
-JJ
From: Chloe L. <ch...@be...> - 2009年11月09日 17:46:47
... and for dessert, is there a circular colormap that would work for 
the colorblind?
My department is practicing presenting-science-for-the-general-public, 
and the problems 'heat maps' have for the colorblind keep coming up.
handy: http://konigi.com/tools/submissions/color-deficit-simulators
&C
On Nov 8, 2009, at 3:34 AM, Gary Ruben wrote:
> Hi Ariel,
>
> You might find the attached function helpful here. Try creating a 
> new colormap using the example in the docstring (you could also try 
> setting high=0.8) - basically this will let you turn down the 
> saturation which will hopefully solve your problem. You may also 
> find the plot option useful to see what the individual colour 
> channels are doing if you decide to make a new colormap of your own 
> - you just need to ensure that the r, g, and b values match at both 
> ends.
>
> Gary
>
>
> Ariel Rokem wrote:
>> Hi everyone,
>> I am interested in using a circular colormap, in order to represent 
>> a phase variable, but I don't like 'hsv' (which is circular). In 
>> particular, I find that it induces perceptual distortion, where 
>> values in the green/yellow part of the colormap all look the same. 
>> Are there any circular colormaps except for 'hsv'? If not - how 
>> would you go about constructing a new circular colormap? Thanks,
>> Ariel
>> -- 
>> Ariel Rokem
>> Helen Wills Neuroscience Institute
>> University of California, Berkeley
>> http://argentum.ucbso.berkeley.edu/ariel
> import numpy as np
> import matplotlib.pyplot as plt
> import matplotlib.colors as colors
> import matplotlib._cm as _cm
>
>
> def rescale_cmap(cmap_name, low=0.0, high=1.0, plot=False):
> '''
> Example 1:
> my_hsv = rescale_cmap('hsv', low = 0.3) # equivalent scaling 
> to cplot_like(blah, l_bias=0.33, int_exponent=0.0)
> Example 2:
> my_hsv = rescale_cmap(cm.hsv, low = 0.3)
> '''
> if type(cmap_name) is str:
> cmap = eval('_cm._%s_data' % cmap_name)
> else:
> cmap = eval('_cm._%s_data' % cmap_name.name)
> LUTSIZE = plt.rcParams['image.lut']
> r = np.array(cmap['red'])
> g = np.array(cmap['green'])
> b = np.array(cmap['blue'])
> range = high - low
> r[:,1:] = r[:,1:]*range+low
> g[:,1:] = g[:,1:]*range+low
> b[:,1:] = b[:,1:]*range+low
> _my_data = {'red': tuple(map(tuple,r)),
> 'green': tuple(map(tuple,g)),
> 'blue': tuple(map(tuple,b))
> }
> my_cmap = colors.LinearSegmentedColormap('my_hsv', _my_data, 
> LUTSIZE)
>
> if plot:
> plt.figure()
> plt.plot(r[:,0], r[:,1], 'r', g[:,0], g[:,1], 'g', b[:,0], 
> b[:,1], 'b', lw=3)
> plt.axis(ymin=-0.2, ymax=1.2)
>
> return my_cmap
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 
> 30-Day
> trial. Simplify your report design, integration and deployment - and 
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Christopher B. <Chr...@no...> - 2009年11月09日 17:35:34
Tim Burgess wrote:
> So....decided to go down the MacPorts path. Many automated downloads 
> later, I now have a successful Basemap install (yay!)
> Many thanks to the folks who have contributed to MacPorts and 
> interestingly geos 3.1.1 is installed.
Is it 64 bit now. If so...
> Only present worry is that wxWidgets port is not building on 10.6 - yet 
> to resolve that.
wxWidgets/wxPython can not be built (for the Mac) 64 bit. It is built on 
Carbon, which Apple has not and will not port to 64 bit. There is a 
Cocoa version of wxMac, but it's not done yet, and has not been wrapped 
for Python.
You may be able to get a 64bit GTK/X11 wxPython working with MacPorts -- 
I've never tried that.
> And FYI, to check whether you have a 64bit Python install:
> >>> import sys; print sys.maxint
> 9223372036854775807
So it looks like you are running 64 bit -- what a pain this all is.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Michael D. <md...@st...> - 2009年11月09日 14:22:44
See this FAQ:
http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server
Mike
On 11/09/2009 09:20 AM, Oguz Yarimtepe wrote:
> Hi,
>
> I was trying to use the matplotlib at my Django view. The version i was trying is 0.98. What i did is to import the library and then plot a graph. The problem is when i tried the "from pylab import *", i got "RuntimeError: could not create GdkCursor object". This is most probably because of the apache user is not able to access the X server. Indeed at my distro it doesn't have shell account.
>
> I don't want to define X access to apache user. So what do you suggest?
>
> 
From: Oguz Y. <com...@gm...> - 2009年11月09日 14:20:46
Hi,
I was trying to use the matplotlib at my Django view. The version i was trying is 0.98. What i did is to import the library and then plot a graph. The problem is when i tried the "from pylab import *", i got "RuntimeError: could not create GdkCursor object". This is most probably because of the apache user is not able to access the X server. Indeed at my distro it doesn't have shell account.
I don't want to define X access to apache user. So what do you suggest?
-- 
Oguz Yarimtepe <com...@gm...>
From: luc E. <luc...@en...> - 2009年11月09日 08:43:05
Dear All,
I am new to the list, so hello everyone !
I am trying to use the new 3D facilities offered by Matplotlib, and I 
can't manage to vary the color and/or size of the markers when doing 3D 
scatter plots :
fig = plt.figure()
ax = Axes3D(fig)
ax.scatter([1,2,3],[3,1,2],[1,2,0],c='r',s=[4,10,20])
The code above doesn't seem to plot anything more than :
ax.scatter([1,2,3],[3,1,2],[1,2,0])
Does anyone have a tip regarding this issue ?
Thanks a lot,
luc
---------------
luc Estebanez
Graduate Student,
ENS, Paris
From: Gary R. <gr...@bi...> - 2009年11月08日 11:34:46
Attachments: rescale_cmap.py
Hi Ariel,
You might find the attached function helpful here. Try creating a new 
colormap using the example in the docstring (you could also try setting 
high=0.8) - basically this will let you turn down the saturation which 
will hopefully solve your problem. You may also find the plot option 
useful to see what the individual colour channels are doing if you 
decide to make a new colormap of your own - you just need to ensure that 
the r, g, and b values match at both ends.
Gary
Ariel Rokem wrote:
> Hi everyone,
> 
> I am interested in using a circular colormap, in order to represent a 
> phase variable, but I don't like 'hsv' (which is circular). In 
> particular, I find that it induces perceptual distortion, where values 
> in the green/yellow part of the colormap all look the same. Are there 
> any circular colormaps except for 'hsv'? If not - how would you go about 
> constructing a new circular colormap? 
> 
> Thanks,
> 
> Ariel
> -- 
> Ariel Rokem
> Helen Wills Neuroscience Institute
> University of California, Berkeley
> http://argentum.ucbso.berkeley.edu/ariel
From: Ariel R. <ar...@be...> - 2009年11月08日 10:11:22
Hi everyone,
I am interested in using a circular colormap, in order to represent a phase
variable, but I don't like 'hsv' (which is circular). In particular, I find
that it induces perceptual distortion, where values in the green/yellow part
of the colormap all look the same. Are there any circular colormaps except
for 'hsv'? If not - how would you go about constructing a new circular
colormap?
Thanks,
Ariel
-- 
Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel
From: Tom L. <le...@ih...> - 2009年11月07日 22:07:47
Hi
I was asked off list how I created the little sparklines using Matplotlib.
There are two ways I create these:
The live graphs on the demo page (http://your.gridspy.co.nz/powertech/)
are created by a great little jquery app (so yeah, not matplotlib):
http://omnipotent.net/jquery.sparkline/
To get the data to the browser in order to render the sparkline, you
will need some sort of mechanism similar to Ajax (or at least a form of
it) called Comet. There is a great tutorial on using orbited for this here
http://cometdaily.com/2008/10/10/scalable-real-time-web-architecture-part-2-a-live-graph-with-orbited-morbidq-and-jsio/
If any of you need more help doing that, I am happy to provide some
source code examples.
If instead, you want to create static line graphs using matplotlib such
as those on this page:
http://your.gridspy.co.nz/powertech/history/04Nov2009.htm
http://your.gridspy.co.nz/powertech/graph/tiny/3-3-04Nov2009.png?c=2 (an
example)
To render static sparklines I use the following matplot lib code:
def render_simple_line(sensors, resolution = 'hour', span = 1,
 start=None, end=None, fig=None, column=0):
 """Builds a figure that shows the given sensors at the given
resolution and span in the given time period.
 """
 if fig is None:
 fig=Figure()
 fig.set_facecolor('white')
 fig.set_edgecolor('white')
 axes = fig.add_axes([0.00,0.00,1.0,1.0], axisbg='w', frame_on=False)
 axes.set_xticks([])
 axes.set_yticks([])
 axes.set_axis_off()
 if start is None:
 start = datetime.datetime.now()
 if end is None:
 end = start + datetime.timedelta(days=1)
 first_date = start.strftime('%Y-%m-%d')
 last_date = end.strftime('%Y-%m-%d')
 desc = [("mean", pk) for pk in sensors]
 np_table = data_table_matrix(desc, resolution, first_date,
last_date, span )
 #note that np_table[0] is datetime objects and [1] is data
 if np_table.size == 0:
 return None
 #replace nulls with 0
 np_table[1:][np_table[1:] == np.array([None])] = 0
 #replace -ve values
 np_table[1:][np_table[1:] < np.array([0])] = 0
 axes.xaxis.set_major_formatter(DateFormatter('%H'))
 fig.autofmt_xdate()
 base = np.zeros(np_table.shape[1])
 color = color_list[column % len(color_list)][1]
 axes.fill_between(np_table[0], base, np_table[column + 1], facecolor
= color)
 return fig
I pass fig in so it is easy to pass a figure from the ipython console,
since ipython makes special figures that are interactive.
-Tom
PS: Dan - I replied to your email directly but it bounced.
From: Tom L. <to...@wi...> - 2009年11月07日 21:29:10
Hi
I was asked off list how I created the little sparklines using Matplotlib.
There are two ways I create these:
The live graphs on the demo page (http://your.gridspy.co.nz/powertech/) 
are created by a great little jquery app (so yeah, not matplotlib):
http://omnipotent.net/jquery.sparkline/
To get the data to the browser in order to render the sparkline, you
will need some sort of mechanism similar to Ajax (or at least a form of
it) called Comet. There is a great tutorial on using orbited for this here
http://cometdaily.com/2008/10/10/scalable-real-time-web-architecture-part-2-a-live-graph-with-orbited-morbidq-and-jsio/
If any of you need more help doing that, I am happy to provide some 
source code examples.
If instead, you want to create static line graphs using matplotlib such 
as those on this page:
http://your.gridspy.co.nz/powertech/history/04Nov2009.htm
http://your.gridspy.co.nz/powertech/graph/tiny/3-3-04Nov2009.png?c=2 (an
example)
To render static sparklines I use the following matplot lib code:
def render_simple_line(sensors, resolution = 'hour', span = 1,
 start=None, end=None, fig=None, column=0):
 """Builds a figure that shows the given sensors at the given
resolution and span in the given time period.
 """
 if fig is None:
 fig=Figure()
 fig.set_facecolor('white')
 fig.set_edgecolor('white')
 axes = fig.add_axes([0.00,0.00,1.0,1.0], axisbg='w', frame_on=False)
 axes.set_xticks([])
 axes.set_yticks([])
 axes.set_axis_off()
 if start is None:
 start = datetime.datetime.now()
 if end is None:
 end = start + datetime.timedelta(days=1)
 first_date = start.strftime('%Y-%m-%d')
 last_date = end.strftime('%Y-%m-%d')
 desc = [("mean", pk) for pk in sensors]
 np_table = data_table_matrix(desc, resolution, first_date,
last_date, span )
 #note that np_table[0] is datetime objects and [1] is data
 if np_table.size == 0:
 return None
 #replace nulls with 0
 np_table[1:][np_table[1:] == np.array([None])] = 0
 #replace -ve values
 np_table[1:][np_table[1:] < np.array([0])] = 0
 axes.xaxis.set_major_formatter(DateFormatter('%H'))
 fig.autofmt_xdate()
 base = np.zeros(np_table.shape[1])
 color = color_list[column % len(color_list)][1]
 axes.fill_between(np_table[0], base, np_table[column + 1], facecolor
= color)
 return fig
I pass fig in so it is easy to pass a figure from the ipython console,
since ipython makes special figures that are interactive.
-Tom
PS: Dan - I replied to your email directly but it bounced.
From: Jeff M. <jm...@cl...> - 2009年11月06日 17:23:31
Is there a way to show the first and last tick label on 3D plots?
From: John H. <jd...@gm...> - 2009年11月06日 15:06:10
On Thu, Nov 5, 2009 at 9:09 PM, Alan Jackson <al...@aj...> wrote:
> Trying to get a colleague to start using python, he ran into trouble,
> getting an error exit whenever he tried to fire up
> ipython -pylab
>
Thanks Alan, I committed a fix to svn HEAD which should prevent this
crash, with the following comment:
 # some afm files have floats where we are expecting ints -- there is
 # probably a better way to handle this (support floats, round rather
 # than truncate). But I don't know what the best approach is now and
 # this change to _to_int should at least prevent mpl from crashing on
 # these JDH (2009年11月06日)
 def _to_int(x):
 return int(float(x))
If other devs know the best way to handle this, please patch as necessary.
From: Tim B. <tim...@ma...> - 2009年11月06日 12:00:40
> Tim: I don't have 10.6 yet, so I've never tried building there. I 
> suspect that it's a 32/64 bit library mismatch problem. Since I 
> believe OSX builds stuff 64 bit by default on OS X, my guess is you 
> are using a 32 bit python, perhaps macpython? If so, perhaps 
> building geos with CFLAGS="-m32" will fix it. Or, it could be that 
> you have a 64 bit python and the lib was built 32 bit.
>
> Maybe someone else with experience with 10.6 will chime in, I'm 
> really just shooting in the dark here..
>
Thanks Jeff and Eric,
Problem is now (mostly) solved.
I was using 32bit Python 2.6.3 on OS X 10.5 - simply a python.org 
installation. A couple of days ago, with a bit of free time, I 
upgraded to OS X 10.6. Generally pretty smooth, but I suspect some of 
my Python changes got crushed as I had pointed /usr/bin/python* to my 
2.6.3 install. After your emails, I checked and yes on 10.6, the 
compiler defaults to 64bit. So:
cd geos-2.2.3
export CFLAGS="-m32"
export GEOS_DIR=/usr/local
./configure --prefix=$GEOS_DIR
make
sudo make install
Another complete build but unfortunately same library reference problem.
So....decided to go down the MacPorts path. Many automated downloads 
later, I now have a successful Basemap install (yay!)
Many thanks to the folks who have contributed to MacPorts and 
interestingly geos 3.1.1 is installed.
Only present worry is that wxWidgets port is not building on 10.6 - 
yet to resolve that.
And FYI, to check whether you have a 64bit Python install:
192-168-1-3:basemap-0.99.4 tim$ python
Python 2.6.4 (r264:75706, Nov 6 2009, 18:14:21)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import sys; print sys.maxint
9223372036854775807
if you get a smaller number, you have a 32bit interpreter
P.S. Should simpletest.py not be called 'hello_world.py' :-)
Tim Burgess
From: Jeff B. <jef...@gm...> - 2009年11月06日 08:22:07
For the first question, try ax.view_init(elev, azim)
Kevin Dunn-2 wrote:
> 
> Thanks for a great library and excellent documentation.
> 
> I'm using mpl_toolkits.mplot3d.Axes3D (version 0.99.0) to generate a 3D
> scatter plot and the web examples have been very useful so far. But I
> have
> these questions to which I can't find answers in the mailing lists or the
> website:
> 
> a) can you programmatically set the viewing angle (azimuth and elevation)?
> I noticed the ax.get_proj() function, but was hoping there would be an
> ax.set_proj(elev=..., az=....) function also.
> b) can you set all 6 sides of the bounding box to show up, instead of 3,
> but
> set their faces to be transparent (of course!)
> 
> Thanks,
> Kevin
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; 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&#45;12, 2009. Register
> now&#33;
> 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://old.nabble.com/3d-plots%3A-set-view-angle-%28azimuth-and-elevation%29-tp25527048p26228256.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Tom L. <le...@ih...> - 2009年11月06日 07:14:04
Hi.
I would like to introduce my usage of Matplotlib...
"
Gridspy provides you with an interactive view of resource usage in your 
building. It gives you hard data on your consumption patterns and helps 
you to make informed decisions.
...
The Gridspy allows you to access and monitor your consumption patterns 
in real-time using a standard web browser on your PC, laptop or mobile 
phone. The data is presented in high resolution and updated each second 
as you watch. The moment a light is turned on in your house, you can see 
the change on your Gridspy dashboard from across the room or across the 
planet.
"
We use Matplotlib to prepare graphs in PNG format that form an essential 
part of our dashboard here (it loads nice and fast, trust me):
http://your.gridspy.co.nz/powertech/
The blog discusses our Python Twisted backend, and other stuff:
http://blog.gridspy.co.nz/
Finally you can follow my progress as I take this product to market on 
twitter:
http://www.twitter.com/gridspy/
It has been a fantastic system to work with, and it was easy to generate 
beautiful and meaningful graphs. Thanks to everyone who has made this 
possible!
What is everyone else working on?
-Tom
From: Alan J. <al...@aj...> - 2009年11月06日 04:07:18
Trying to get a colleague to start using python, he ran into trouble,
getting an error exit whenever he tried to fire up
ipython -pylab
After much searching, he figured it out... it appears that a small patch may be
in order. Here is his note :
> I found it: I have a font installed in my personal fonts 
> directory that has non-integral sides for the "bounding box" 
> of the font.
> 
> Fortunately, it seems like once I move my ~/.fonts 
> directory "off to the side" and then run
> 
> ipython -pylab
> 
> then some of that configuration info must be cached, since I 
> am able to move my .fonts file back and still have my ipython 
> -pylab come up.
> 
> The offending line is in the return statement below
> 
> #Convert string the a python type
> _to_int = int
> _to_float = float
> _to_str = str
> 
> def _to_list_of_ints(s):
> s = s.replace(',', ' ')
> return [_to_int(val) for val in s.split()]
> 
> and I think a fix would be along the lines of Alan's remark:
> 
> return [_to_int(_to_float(val)) for val in s.split()]
> 
> This is in the file
> 
> /glb/apps/sss/epd/2.5.4.2.30201/lib/python2.5/site-packages/ma
> tplotlib-0.98.5.2n1-py2.5-linux-x86_64.egg/matplotlib/afm.py
> 
> Anyway, it works for me.
-- 
-----------------------------------------------------------------------
| Alan K. Jackson | To see a World in a Grain of Sand |
| al...@aj... | And a Heaven in a Wild Flower, |
| www.ajackson.org | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake |
-----------------------------------------------------------------------
From: Thomas R. <tho...@gm...> - 2009年11月05日 19:31:54
Hi,
Is there an easy way to add axes to a figure, but specify the 'rect' 
in real rather than relative units? For example, something like:
fig.add_axes([0.5,0.5,3.,3.], inches=True)
This would guarantee that for example if I want to increase the canvas 
size to add more subplots, I don't have to re-adjust all the existing 
axes. Also, it makes it easier to figure out the aspect ratio of axes, 
without having to worry about the canvas size. Is there a way to do 
this already, or is the easiest way to write a wrapper for add_axes 
that uses the canvas size from fig?
Cheers,
Thomas
From: Jeff W. <js...@fa...> - 2009年11月05日 13:08:26
Eric Firing wrote:
> Tim Burgess wrote:
> 
>> I've been using matplotlib and numpy happily and have gone to install 
>> basemap.
>>
>> As part of the basemap 0.99.4 install, I've compiled geos-2.2.3 and 
>> installed into /usr/local/ - no apparent problems
>>
>> I then ran >python setup.py install from the basemap directory. No 
>> issues that I could see.
>>
>> However, when trying the import I get:
>>
>> Python 2.6.3 (r263:75184, Oct 2 2009, 07:56:03)
>> [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> from mpl_toolkits.basemap import Basemap
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
>> python2.6/site-packages/mpl_toolkits/basemap/__init__.py", line 43, in 
>> <module>
>> import _geoslib, netcdftime
>> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/ 
>> lib/python2.6/site-packages/_geoslib.so, 2): Symbol not found: _GEOSArea
>> Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/ 
>> lib/python2.6/site-packages/_geoslib.so
>> Expected in: dynamic lookup
>>
>> Does basemap build ok on OS X 10.6 or are there some gotcha's I'm not 
>> aware of?
>> 
>
> It should be fine. It looks like a geoslib other than the one you 
> installed in /usr/local is the one being found.
>
> Eric
>
> 
Tim: If that's the case, setting GEOS_DIR=/usr/local and building again 
(after deleting the build directory) should fix it.
-Jeff
From: Jeff W. <js...@fa...> - 2009年11月05日 12:56:24
Tim Burgess wrote:
> I've been using matplotlib and numpy happily and have gone to install 
> basemap.
>
> As part of the basemap 0.99.4 install, I've compiled geos-2.2.3 and 
> installed into /usr/local/ - no apparent problems
>
> I then ran >python setup.py install from the basemap directory. No 
> issues that I could see.
>
> However, when trying the import I get:
>
> Python 2.6.3 (r263:75184, Oct 2 2009, 07:56:03)
> [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from mpl_toolkits.basemap import Basemap
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
> python2.6/site-packages/mpl_toolkits/basemap/__init__.py", line 43, in 
> <module>
> import _geoslib, netcdftime
> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/ 
> lib/python2.6/site-packages/_geoslib.so, 2): Symbol not found: _GEOSArea
> Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/ 
> lib/python2.6/site-packages/_geoslib.so
> Expected in: dynamic lookup
>
> Does basemap build ok on OS X 10.6 or are there some gotcha's I'm not 
> aware of?
>
> Tim
>
> 
Tim: I don't have 10.6 yet, so I've never tried building there. I 
suspect that it's a 32/64 bit library mismatch problem. Since I believe 
OSX builds stuff 64 bit by default on OS X, my guess is you are using a 
32 bit python, perhaps macpython? If so, perhaps building geos with 
CFLAGS="-m32" will fix it. Or, it could be that you have a 64 bit 
python and the lib was built 32 bit.
Maybe someone else with experience with 10.6 will chime in, I'm really 
just shooting in the dark here..
-Jeff
-Jeff
From: Jarrod M. <mi...@be...> - 2009年11月05日 10:55:07
Call for Presentations
======================
The SciPy India 2009 Program Committee is currently developing the conference
program. We are seeking presentations from industry as well as the
academic world.
We look forward to hearing your recent breakthroughs using Python! Please
read the full `call for papers <http://scipy.in/talks-cfp/>`_.
SciPy India 2009 Conference
---------------------------
The first `SciPy India Conference <http://scipy.in>`_ will be held
from December 12th to 17th, 2009 at the `Technopark in Trivandrum
<http://www.technopark.org/>`_, Kerala, India.
The theme of the conference will be "Scientific Python in Action" with
respect to application and teaching. We are pleased to have Travis
Oliphant, the creator and lead developer of `numpy
<http://numpy.scipy.org>`_ as the keynote speaker.
Please register `here <http://scipy.in>`_.
Important Dates
---------------
* Friday, Nov. 20: Abstracts Due
* Friday, Nov. 27: Announce accepted talks, post schedule
* Saturday-Sunday, Dec. 12-13 Conference
* Monday-Tuesday, Dec. 14-15 Tutorials
* Wednesday-Thursday, Dec. 16-17 Sprints
Organizers
----------
* Jarrod Millman, Neuroscience Institute, UC Berkeley, USA (Conference Co-Chair)
* Prabhu Ramachandran, Department of Aerospace Engineering,
 IIT Bombay, India (Conference Co-Chair)
* FOSSEE Team
Sponsors
--------
* National Mission On Education through ICT - Ministry of Human
Resource Development, Government of India
* SPACE-Kerala (India)
* Kerala State IT Mission(KSITM)
* SIG-FOSS Of CSI
11 messages has been excluded from this view by a project administrator.

Showing results of 346

<< < 1 .. 10 11 12 13 14 > >> (Page 12 of 14)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /