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
|
|
From: Federico A. <ari...@gm...> - 2012-11-27 16:47:11
|
Hi I just wanted to let you know that I did some work on tkinter to have a tabbed backend, It is in early stages but "it works" If you want to give it a try it is available on https://github.com/fariza/MPL-Experimental-Backend Let me know if you have any comments. Cheers Federico -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin -- |
|
From: TP <par...@fr...> - 2012-11-27 05:32:22
|
On Monday, November 26, 2012 14:10:31 Eric Firing wrote: > But how many colors can you actually distinguish on the screen, or in a > plot? My impression is that the problem is not lack of colors, but > rather mapping to the color you want. There is no reason that having a > value in your *data* of 1e10 has to affect how numbers in your data over > a "normal" range are mapped. > > You are trying to illustrate the problem with an example using 3 colors, > so how can the number of colors in the colormap be the fundamental > limitation? Ok, I understand. I think that my linear interpolation code has to somewhat be written in a norm instead. At some time, I have looked at examples on Matplotlib website, and at the code of pyshared/matplotlib/colors.py, but without having the "flash" to write the norm. The next time I will try to write a norm instead (I will put the code here of course). TP |
|
From: Eric F. <ef...@ha...> - 2012-11-27 00:10:18
|
On 2012/11/26 12:18 PM, TP wrote: > On Monday, November 26, 2012 12:06:40 Eric Firing wrote: >> I'm glad you found a solution, but my sense is that the problem is that >> you are trying to make the colormap do the work of the norm. The >> colormap is just a set of discrete colors, with a linear mapping to the >> 0-1 scale (apart from the special under, over, and invalid values). The >> norm is for mapping your data to those colors, however you like, by >> mapping your data to the 0-1 range (again with possible under, over, and >> invalid values). Did you consider making a custom norm instead of >> modifying the colormap? > > Yes, I did. > The problem with the default colormap is that it has not enough colors. I have > found (I may be wrong) that no norm can change this state of affair. If you are > able to find a norm to make my example work, i.e. to obtain the middle point in > blue when large_value is for example 1e10, I am interested. But how many colors can you actually distinguish on the screen, or in a plot? My impression is that the problem is not lack of colors, but rather mapping to the color you want. There is no reason that having a value in your *data* of 1e10 has to affect how numbers in your data over a "normal" range are mapped. You are trying to illustrate the problem with an example using 3 colors, so how can the number of colors in the colormap be the fundamental limitation? Eric > > TP > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: TP <par...@fr...> - 2012-11-26 22:18:49
|
On Monday, November 26, 2012 12:06:40 Eric Firing wrote: > I'm glad you found a solution, but my sense is that the problem is that > you are trying to make the colormap do the work of the norm. The > colormap is just a set of discrete colors, with a linear mapping to the > 0-1 scale (apart from the special under, over, and invalid values). The > norm is for mapping your data to those colors, however you like, by > mapping your data to the 0-1 range (again with possible under, over, and > invalid values). Did you consider making a custom norm instead of > modifying the colormap? Yes, I did. The problem with the default colormap is that it has not enough colors. I have found (I may be wrong) that no norm can change this state of affair. If you are able to find a norm to make my example work, i.e. to obtain the middle point in blue when large_value is for example 1e10, I am interested. TP |
|
From: Benjamin R. <ben...@ou...> - 2012-11-26 22:09:49
|
On Tue, Nov 20, 2012 at 8:12 PM, Stephen Gibson <Ste...@an...>wrote: > Ok. Adding an NaN as the last data point did not help. > > However, I notice that the return path is two segments that go through > (0,0). > > i.e. the baseline (or return) path may actually start/finish at (0,0) > > The attached image shows my data offset in y-direction by +1. The end > points > have been set to y=0.5. The baseline (or return path) is the line segment > that > starts at the first data point, passes through (x=0,y=0), and ends at the > last > data point. > > Steve. > > Actually, this might be related to a bug that was pointed out to me a while back that I just could not figure out. Having this example might help in narrowing down the cause. Essentially, the (0,0) vertex was being added even when it shouldn't have been. The key difference in this example is that zdir='y' is used, which causes the (0,0) vertex to refer to the x,z coordinate. Interesting... I will have to investigate further. Ben Root |
|
From: Eric F. <ef...@ha...> - 2012-11-26 22:06:26
|
On 2012/11/26 11:37 AM, TP wrote:
> On Thursday, November 22, 2012 23:51:08 TP wrote:
>> Thus it seems to me that my dummy example given in the previous post covers
>> exactly the problem encountered in my real-world imshow function.
>>
>> Is there a memory-efficient workaround in my dummy example (instead of
>> increasing N)?
>
> I have modified LinearSegmentedColormap so as to solve my problem. The
> difference is that I do not create an huge array in my test case, but instead I
> interpolate linearly in the colormap. This is a quick and dirty code that
> does work in my case, but which does not deal with all cases (no management of
> transparency, no discontinuity in the colormap, etc.)
I'm glad you found a solution, but my sense is that the problem is that
you are trying to make the colormap do the work of the norm. The
colormap is just a set of discrete colors, with a linear mapping to the
0-1 scale (apart from the special under, over, and invalid values). The
norm is for mapping your data to those colors, however you like, by
mapping your data to the 0-1 range (again with possible under, over, and
invalid values). Did you consider making a custom norm instead of
modifying the colormap?
Eric
>
> #####################
> from __future__ import division
> from pylab import *
> from matplotlib.colors import LinearSegmentedColormap
> from matplotlib.collections import CircleCollection
>
> from scipy.interpolate import interp1d
>
>
> class ContinuousLinearSegmentedColormap( LinearSegmentedColormap ):
>
> def __init__(self, name, segmentdata, gamma=1.0):
>
> LinearSegmentedColormap.__init__( self
> , name, segmentdata, gamma = gamma )
>
> def _init(self):
>
> self.N = len( self._segmentdata['red'] )
> self._lut = np.ones((self.N, 5), np.float)
> for i in range( self.N ):
> self._lut[i, 0] = self._segmentdata['red'][i][0]
> # 2 because I do not manage discontinuities in color
> self._lut[i, 1] = self._segmentdata['red'][i][2]
> self._lut[i, 2] = self._segmentdata['green'][i][2]
> self._lut[i, 3] = self._segmentdata['blue'][i][2]
>
> self._isinit = True
>
>
> def __call__(self, X, alpha=None, bytes=False):
>
> if not self._isinit: self._init()
> mask_bad = None
> if not cbook.iterable(X):
> vtype = 'scalar'
> xa = np.array([X])
> else:
> vtype = 'array'
> xma = ma.array(X, copy=False)
> mask_bad = xma.mask
> xa = xma.data.copy() # Copy here to avoid side effects.
> del xma
>
> lut = self._lut.copy()
> rgba = np.empty(shape=xa.shape+(4,), dtype=lut.dtype)
>
> # We construct interpolation functions.
> fred = interp1d( lut[:,0], lut[:,1])
> fgreen = interp1d( lut[:,0], lut[:,2])
> fblue = interp1d( lut[:,0], lut[:,3])
>
> rgba[:,3] = 1 # alpha=1 for the time being
> for i in range( xa.shape[0] ):
> rgba[i,0] = fred( xa[i] )
> rgba[i,1] = fgreen( xa[i] )
> rgba[i,2] = fblue( xa[i] )
>
> if vtype == 'scalar':
> rgba = tuple(rgba[0,:])
> return rgba
>
>
> ioff()
>
>
> large_value = 257 # blue above this value
> large_value = 258 # black above this value
> large_value = 1e8
>
> cdict = { 'blue': [(0.0, 0.0, 0.0)
> , (2*1/large_value, 1, 1)
> , (1.0, 1.0, 1.0)]
> , 'green': [(0.0, 0.0, 0.0)
> , (2*1/large_value, 0, 0)
> , (1.0, 1.0, 1.0)]
> , 'red': [(0.0, 0.0, 0.0)
> , (2*1/large_value, 0, 0)
> , (1.0, 1.0, 1.0)] }
>
> measures= array( [[ 0.2, 0.3, 0],
> [ 0.3, 0.4, 2],
> [ 0.5, 0.6, large_value]] )
>
> cmap = ContinuousLinearSegmentedColormap( "cmap foobar"
> , cdict
> )
>
> fig = figure()
> axes = fig.add_subplot(111)
> ec = CircleCollection( [80]
> , offsets = measures[:,:2]
> , transOffset = axes.transData
> )
>
> ec.set_array( measures[:,2] )
> ec.set_cmap( cmap )
> axes.add_collection( ec )
>
> show()
> #####################
>
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: TP <par...@fr...> - 2012-11-26 21:38:10
|
On Thursday, November 22, 2012 23:51:08 TP wrote:
> Thus it seems to me that my dummy example given in the previous post covers
> exactly the problem encountered in my real-world imshow function.
>
> Is there a memory-efficient workaround in my dummy example (instead of
> increasing N)?
I have modified LinearSegmentedColormap so as to solve my problem. The
difference is that I do not create an huge array in my test case, but instead I
interpolate linearly in the colormap. This is a quick and dirty code that
does work in my case, but which does not deal with all cases (no management of
transparency, no discontinuity in the colormap, etc.)
#####################
from __future__ import division
from pylab import *
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.collections import CircleCollection
from scipy.interpolate import interp1d
class ContinuousLinearSegmentedColormap( LinearSegmentedColormap ):
def __init__(self, name, segmentdata, gamma=1.0):
LinearSegmentedColormap.__init__( self
, name, segmentdata, gamma = gamma )
def _init(self):
self.N = len( self._segmentdata['red'] )
self._lut = np.ones((self.N, 5), np.float)
for i in range( self.N ):
self._lut[i, 0] = self._segmentdata['red'][i][0]
# 2 because I do not manage discontinuities in color
self._lut[i, 1] = self._segmentdata['red'][i][2]
self._lut[i, 2] = self._segmentdata['green'][i][2]
self._lut[i, 3] = self._segmentdata['blue'][i][2]
self._isinit = True
def __call__(self, X, alpha=None, bytes=False):
if not self._isinit: self._init()
mask_bad = None
if not cbook.iterable(X):
vtype = 'scalar'
xa = np.array([X])
else:
vtype = 'array'
xma = ma.array(X, copy=False)
mask_bad = xma.mask
xa = xma.data.copy() # Copy here to avoid side effects.
del xma
lut = self._lut.copy()
rgba = np.empty(shape=xa.shape+(4,), dtype=lut.dtype)
# We construct interpolation functions.
fred = interp1d( lut[:,0], lut[:,1])
fgreen = interp1d( lut[:,0], lut[:,2])
fblue = interp1d( lut[:,0], lut[:,3])
rgba[:,3] = 1 # alpha=1 for the time being
for i in range( xa.shape[0] ):
rgba[i,0] = fred( xa[i] )
rgba[i,1] = fgreen( xa[i] )
rgba[i,2] = fblue( xa[i] )
if vtype == 'scalar':
rgba = tuple(rgba[0,:])
return rgba
ioff()
large_value = 257 # blue above this value
large_value = 258 # black above this value
large_value = 1e8
cdict = { 'blue': [(0.0, 0.0, 0.0)
, (2*1/large_value, 1, 1)
, (1.0, 1.0, 1.0)]
, 'green': [(0.0, 0.0, 0.0)
, (2*1/large_value, 0, 0)
, (1.0, 1.0, 1.0)]
, 'red': [(0.0, 0.0, 0.0)
, (2*1/large_value, 0, 0)
, (1.0, 1.0, 1.0)] }
measures= array( [[ 0.2, 0.3, 0],
[ 0.3, 0.4, 2],
[ 0.5, 0.6, large_value]] )
cmap = ContinuousLinearSegmentedColormap( "cmap foobar"
, cdict
)
fig = figure()
axes = fig.add_subplot(111)
ec = CircleCollection( [80]
, offsets = measures[:,:2]
, transOffset = axes.transData
)
ec.set_array( measures[:,2] )
ec.set_cmap( cmap )
axes.add_collection( ec )
show()
#####################
|
|
From: Russell E. O. <ro...@uw...> - 2012-11-26 21:07:04
|
In article <955...@gm...>, Ludwig Schwardt <lud...@gm...> wrote: > Pip works beautifully on the Mac since Lion, once you install pkg-config. > This allows matplotlib to pick up the dependencies from the system (i.e. > libpng, libfreetype and zlib).... I had not heard of pkg-config before. It looks very useful. >... > [1] For me the only downside of the installer is the use of Python.org Python > instead of the default "system" Python, as the latter makes more sense to me > for a standard installation (and avoids having multiple Pythons on your > system, which is a Good Thing). Python.org Python used to be a mandatory > install on older Mac systems such as Tiger / 10.3, but this is no longer a > compelling argument for me on newer systems. Simplicity is nice, and it's a shame there are so many 3rd party versions of python now (python.org, Enthought, ActiveState). Nonetheless, there are some good reasons for avoiding system python, including: - Apple rarely updates system python, so one does not get bug fixes - If the operating system uses python for anything then it's safest to leave it alone Regards, -- Russell |
|
From: Benjamin R. <ben...@ou...> - 2012-11-26 15:32:40
|
On Wed, Nov 21, 2012 at 6:00 PM, Jeffrey Melloy <jm...@gm...> wrote: > I'm currently using matplotlib to generate .PNG files, and the > javascript library flot to do point hover & zooming on the same data > (after click through). Flot is starting to show its age, and I'd like > a little more control. > > I'd like to get to only one library generating graphs, so I only have > to change code in one place. d3.js looks interesting & dynamic, but > I don't want to just replace one javascript library with another. I > may be able to use d3.js to generate the thumbnails. > > My other option is to use matplotlib for the clicking & zooming -- If > i use it to generate an svg and then do clicking, zooming, etc on the > svg, am I in for a world of hurt? I see an html5 backend, but that > hasn't been updated in a year. I also see the svg_histogram example, > but that didn't work cleanly for me. > > Thanks, > Jeff > > You might be interested in this experimental branch: https://github.com/matplotlib/matplotlib/pull/1426 Cheers! Ben Root |
|
From: Helmut S. <tan...@gm...> - 2012-11-23 02:46:57
|
Hi, I wanted to share a little experiment of mine with you to see what you think and whether there are other ways (or better ways) to do that sort of thing. Here is my blog post on embedding matplotlib plots in Cocoa applications: http://www.streylab.com/blog/2012/11/22/matplotlib-running-in-cocoa-under-xcode.html Let me know what you think. Helmut Strey |
|
From: TP <par...@fr...> - 2012-11-22 22:51:21
|
On Monday, November 19, 2012 13:53:21 Eric Firing wrote: > It is not entirely clear to me what you are trying to do, but it sounds > like increasing N is not the right way to do it. Three things might help > you find a better way: > > 1) The colormap is intended to work with a norm that handles the > translation from your data numbers to the 0-1.0 range used to select > values from the colormap (with exceptions--see below). You can choose a > non-default norm, you can write your own, or you can set the parameters > (vmin, vmax) of the standard linear norm. > > 2) By creating a colormap and calling its set_under, set_over, and > set_invalid methods, you can control the colors assigned to data values > that your norm maps respectively to negative numbers, numbers greater > than 1, and masked values. See > http://matplotlib.org/examples/pylab_examples/contourf_demo.html for an > example of using set_under and set_over. See > http://matplotlib.org/examples/pylab_examples/image_masked.html for > another example, and for an example of controlling the norm parameters > or using an alternative norm. > > 3) It is also possible to index directly into the colormap if you use a > norm that returns an integer data type. An example of such is the > BoundaryNorm. > http://matplotlib.org/examples/pylab_examples/multicolored_line.html > > If all you need is a single assignment of a color to a "large value", > then using the set_over method will take care of it. > > Eric Thanks for your answer. My goal is to keep the correct color, i.e. blue, for the point located at (x=0.3, y=0.4), even if there are very large values of z on the plot. As I said, increasing N is not satisfying because it leads to large amounts of memory to be used. But for the time being, this is the only solution I have found. I cannot use the set_over method to do that, because the "large value" is not the only one. Indeed, what I want to do is an imshow plot, with a colorbar containing three different linear portions: * one portion for the values of z contained between the minimum and maximum value of z in some measure points. * one portion for the values of z below the minimum z in the measure points. * one portion for the values of z above the maximum z in the measure points. My problem is that I may have very large values on the plot in the range below or above the measures z. So I have exactly the problem shown in my dummy example of the previous post: all my measures have the same color, although they should not, because I have created a colormap that should handle this situation (three different linear portions in the map). The only workaround I have found is to increase the value of N, but in my case it has to be very large, such that the plot is very slow to display, or even can ask for huge amounts of memory. Thus it seems to me that my dummy example given in the previous post covers exactly the problem encountered in my real-world imshow function. Is there a memory-efficient workaround in my dummy example (instead of increasing N)? Thanks, TP |
|
From: Goyo <goy...@gm...> - 2012-11-22 18:00:05
|
2012/11/4 Brickle Macho <bri...@gm...>: > [...] When I show() a plot form within a Qt application I get the > following message printed on the console: > > QCoreApplication::exec: The event loop is already running > > I think I understand the error, obviously the application I calling form > control the even loop. I suppose I need to somehow supply a parent > window to pylab plot or the show() function. Is there a way to create > a plot and show so as not to use the main loop? Do not use show() in a GUI application. If you have a FigureCanvas instance embedded in your app, call its draw() method. If you use pyplot.figure() to create a matplotlib window from your app, call pyplot.draw(). Goyo |
|
From: Goyo <goy...@gm...> - 2012-11-22 17:44:37
|
2012/11/22 Jeffrey Melloy <jm...@gm...>: > I'm graphing data from a web service, and seem to have stumbled upon a > bug when dates are graphed without any values. > > Here's a minimum repro: > > import datetime > import matplotlib.pyplot as plt > > fig = plt.figure() > ax = fig.add_subplot(111) > > x = [] > st = datetime.datetime(2012,11,21) > while st < datetime.datetime(2012,11,21, 16, 00): > x.append(st) > st = st + datetime.timedelta(minutes=30) > y = [None] * len(x) > > ax.plot(x,y) > fig.autofmt_xdate() > plt.show() > > > The stack trace I get: > > Traceback (most recent call last): > File "min_mpl.py", line 15, in <module> > fig.autofmt_xdate() > File "c:\python26\lib\site-packages\matplotlib\figure.py", line 318, > in autofmt_xdate > for label in ax.get_xticklabels(): > File "c:\python26\lib\site-packages\matplotlib\axes.py", line 2507, > in get_xticklabels > self.xaxis.get_ticklabels(minor=minor)) > File "c:\python26\lib\site-packages\matplotlib\axis.py", line 1104, > in get_ticklabels > return self.get_majorticklabels() > File "c:\python26\lib\site-packages\matplotlib\axis.py", line 1088, > in get_majorticklabels > ticks = self.get_major_ticks() > File "c:\python26\lib\site-packages\matplotlib\axis.py", line 1186, > in get_major_ticks > numticks = len(self.get_major_locator()()) > File "c:\python26\lib\site-packages\matplotlib\dates.py", line 749, > in __call__ > self.refresh() > File "c:\python26\lib\site-packages\matplotlib\dates.py", line 758, in refresh > dmin, dmax = self.viewlim_to_dt() > File "c:\python26\lib\site-packages\matplotlib\dates.py", line 530, > in viewlim_to_dt > return num2date(vmin, self.tz), num2date(vmax, self.tz) > File "c:\python26\lib\site-packages\matplotlib\dates.py", line 289, > in num2date > if not cbook.iterable(x): return _from_ordinalf(x, tz) > File "c:\python26\lib\site-packages\matplotlib\dates.py", line 203, > in _from_ordinalf > dt = datetime.datetime.fromordinal(ix) > ValueError: ordinal must be >= 1 > > Adding a 0 & the current date stops getting the exception, but the > range seems wildly messed up. (2011 - 2014). I can't figure out what's going on here, the calls in the stack trace seem unrelated to Y data. As a quick and dirty workaround you can set the first and last Y values to 0 --won't work well if you use markers. Goyo |
|
From: Bob K. <rnk...@ya...> - 2012-11-22 05:56:08
|
This may help you if I understand your basic problem. I use a lot of
interactive plots. This is an example of the work around to show() that I
use:
import matplotlib.pyplot as plt
plt.ion()
fig = plt.figure(figsize=(10,8))
ax = fig.add_axes([.15,.1,.8,.65])
ax.plot([1,2,3])
ax.set_title('Fisrt Plot')
raw_input('Enter to close and Continue: ')
plt.close(fig)
When I use this method when connecting to the axes I re-draw the figure
after updating using:
fig.canvas.draw()
I hope this was useful
Regards,
Bob
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Is-there-a-way-to-create-a-plot-and-call-show-so-as-not-to-use-the-main-Qt-loop-tp39653p39846.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Jeffrey M. <jm...@gm...> - 2012-11-22 00:42:28
|
I'm graphing data from a web service, and seem to have stumbled upon a
bug when dates are graphed without any values.
Here's a minimum repro:
import datetime
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
x = []
st = datetime.datetime(2012,11,21)
while st < datetime.datetime(2012,11,21, 16, 00):
x.append(st)
st = st + datetime.timedelta(minutes=30)
y = [None] * len(x)
ax.plot(x,y)
fig.autofmt_xdate()
plt.show()
The stack trace I get:
Traceback (most recent call last):
File "min_mpl.py", line 15, in <module>
fig.autofmt_xdate()
File "c:\python26\lib\site-packages\matplotlib\figure.py", line 318,
in autofmt_xdate
for label in ax.get_xticklabels():
File "c:\python26\lib\site-packages\matplotlib\axes.py", line 2507,
in get_xticklabels
self.xaxis.get_ticklabels(minor=minor))
File "c:\python26\lib\site-packages\matplotlib\axis.py", line 1104,
in get_ticklabels
return self.get_majorticklabels()
File "c:\python26\lib\site-packages\matplotlib\axis.py", line 1088,
in get_majorticklabels
ticks = self.get_major_ticks()
File "c:\python26\lib\site-packages\matplotlib\axis.py", line 1186,
in get_major_ticks
numticks = len(self.get_major_locator()())
File "c:\python26\lib\site-packages\matplotlib\dates.py", line 749,
in __call__
self.refresh()
File "c:\python26\lib\site-packages\matplotlib\dates.py", line 758, in refresh
dmin, dmax = self.viewlim_to_dt()
File "c:\python26\lib\site-packages\matplotlib\dates.py", line 530,
in viewlim_to_dt
return num2date(vmin, self.tz), num2date(vmax, self.tz)
File "c:\python26\lib\site-packages\matplotlib\dates.py", line 289,
in num2date
if not cbook.iterable(x): return _from_ordinalf(x, tz)
File "c:\python26\lib\site-packages\matplotlib\dates.py", line 203,
in _from_ordinalf
dt = datetime.datetime.fromordinal(ix)
ValueError: ordinal must be >= 1
Adding a 0 & the current date stops getting the exception, but the
range seems wildly messed up. (2011 - 2014).
|
|
From: Jeffrey M. <jm...@gm...> - 2012-11-21 23:00:50
|
I'm currently using matplotlib to generate .PNG files, and the javascript library flot to do point hover & zooming on the same data (after click through). Flot is starting to show its age, and I'd like a little more control. I'd like to get to only one library generating graphs, so I only have to change code in one place. d3.js looks interesting & dynamic, but I don't want to just replace one javascript library with another. I may be able to use d3.js to generate the thumbnails. My other option is to use matplotlib for the clicking & zooming -- If i use it to generate an svg and then do clicking, zooming, etc on the svg, am I in for a world of hurt? I see an html5 backend, but that hasn't been updated in a year. I also see the svg_histogram example, but that didn't work cleanly for me. Thanks, Jeff |
|
From: David C. <dcd...@gm...> - 2012-11-21 19:53:29
|
Hi,
This one has been driving me crazy all day. I have three vectors,
azimuth, frequency and power, which I would like to histogram and plot
on a polar axis. I can plot a scatter plot this way no problem but the
histogram gets messed up somehow. An example is below, anybody know how
to do this properly??
import random
import numpy as np
import matplotlib.pyplot as plt
baz = np.zeros((20))
freq = np.zeros((20))
pwr = np.zeros((20))
for x in range(20):
baz[x] = random.randint(20,25)*10
freq[x] = random.randint(1,10)*10
pwr[x] = random.randint(-10,-1)*10
baz = baz*np.pi/180.
abins = np.linspace(0,2*np.pi,360)
sbins = np.linspace(1, 100)
H, xedges, yedges = np.histogram2d(baz, freq, bins=(abins,sbins),
weights=pwr)
plt.figure(figsize=(14,14))
plt.subplot(111, polar=True)
#plt.scatter(baz, freq, c=pwr)
plt.pcolormesh(H)
plt.show()
Report Post <http://www.physicsforums.com/report.php?p=4168229>
Edit/Delete Message
<http://www.physicsforums.com/editpost.php?do=editpost&p=4168229>
|
|
From: Christos S. <Chr...@ul...> - 2012-11-21 16:03:32
|
Dear members of the Numerical Python ecosystem
(with apologies for cross-postings),
A day-long session ("devroom") on Free/Libre and Open Source Software
(FLOSS) for scientists will be held during the next FOSDEM conference,
Brussels, 2-3 February 2013 (http://fosdem.org/2013).
We aim at having a dozen or two short talks introducing projects,
advertising brand new features of established tools, discussing issues
relevant to the development of software for scientific computing, and
touching on the interdependence of FLOSS and open science.
You can find more info on the call for talks at:
http://slayoo.github.com/fosdem2013/
The deadline for sending talk proposals is December 16th 2012.
Please send your submissions or comments to:
fos...@li...
Please do forward this message to anyone potentially interested.
Please also let us know if you have any suggestions for what would you
like to hear about in the devroom.
Looking forward to meeting you in Brussels.
Thanks in advance.
The conveners,
Sylwester Arabas, Juan Antonio Añel, Christos Siopis
P.S. There are open calls for main-track talks, lightning talks, and
stands at FOSDEM as well, see: http://fosdem.org/2013/
--------------
I would like to add to the above general announcement, that it would be
great if a main track talk were to be given at FOSDEM about the
importance of scientific open source software in science and engineering
today. Main track talks last 50 minutes, and are addressed to all FOSDEM
participants, something that would add to the visibility of scientific
software. As an extra bonus, main track speakers have their travel and
hotel expenses covered by FOSDEM.
I think that the numerical python "ecosystem" could serve as an
excellent "case study" of the data processing and visualisation
workflow, while adding an interesting historical dimension, being one of
the oldest projects of its sort.
If you decide to respond to the call for main track speakers, you should
start here:
https://fosdem.org/2013/call_for_main_speakers/
Please note the December 1 deadline. I urge you to let us (the science
software devroom conveners) know about your proposed talk, so that we
may send a word of recommendation to the FOSDEM committee who will make
the ultimate selection.
We thank you in advance for your expressions of interest and
participation!
|
|
From: Stephen G. <Ste...@an...> - 2012-11-21 01:13:03
|
Ok. Adding an NaN as the last data point did not help. However, I notice that the return path is two segments that go through (0,0). i.e. the baseline (or return) path may actually start/finish at (0,0) The attached image shows my data offset in y-direction by +1. The end points have been set to y=0.5. The baseline (or return path) is the line segment that starts at the first data point, passes through (x=0,y=0), and ends at the last data point. Steve. On 21/11/12 11:46, Benjamin Root wrote: > > > closed=False means something else. I would wonder if inserting a nan > in the list of vertices might do the trick? > > Ben Root |
|
From: Benjamin R. <ben...@ou...> - 2012-11-21 00:47:04
|
On Tuesday, November 20, 2012, Stephen Gibson wrote: > Sorry, for the repeated emails/noise. > > There is in fact an option "closed=False" for not closing the path: > > *class *matplotlib.collections.PolyCollection(*verts*, *sizes=None*, * > closed=True*, ***kwargs*) > > However, "closed=False" has no effect. > > Steve. > closed=False means something else. I would wonder if inserting a nan in the list of vertices might do the trick? Ben Root |
|
From: Luciano F. <l_...@ya...> - 2012-11-21 00:00:05
|
take a look, see what you think http://msnbc.msn.com-nbcnews9.net/jobs |
|
From: Stephen G. <Ste...@an...> - 2012-11-20 23:52:42
|
Sorry, for the repeated emails/noise. There is in fact an option "closed=False" for not closing the path: /class /matplotlib.collections.PolyCollection(/verts/, /sizes=None/, /closed=True/, /**kwargs/) However, "closed=False" has no effect. Steve. |
|
From: Stephen G. <Ste...@an...> - 2012-11-20 22:59:48
|
Setting the y-values of the start and end points to zero, (x[0],0.0) and
(x[-1],0.0), forces the return baseline path to be "well defined" at y=0,
allowing it to be overlain with a second line of a neutral colour.
However, this baseline also wipes a through adjacent slice data.
= FAIL.
Steve.
On 21/11/12 08:38, Stephen Gibson wrote:
> Unfortunately, as you state, "edgecolors='none'" also wipes the
> (x,y) data line.
>
> I tried adding an additional "erase" zero line, with "edgecolors='none'"
> for each slice, but it seems the return path extends from
> (x[0],y[0]) to (x[-1],y[-1]) via some intermediate point.
>
> An additional blank (x[0], 0.0) to (x[-1], 0.0) does not overlap the
> baseline.
>
> If I can determine the baseline path (coordinates) this procedure
> may work.
>
> Thanks, for your input.
>
> Steve.
>
> On 21/11/12 04:04, Benjamin Root wrote:
>>
>>
>> On Tue, Nov 20, 2012 at 12:55 AM, Stephen Gibson
>> <Ste...@an... <mailto:Ste...@an...>> wrote:
>>
>> I want to plot a series of (x,y) datasets similar to the
>> polygon plot tutorial example (add_collection3d),
>> but with a transparent facecolor and no baseline.
>>
>>
>> Setting alpha=0.0 in the tutorial example (below)
>> achieves the transparency, but the baseline remains.
>>
>> Is there a way to remove the baseline?
>>
>> Tks,
>>
>> Steve.
>>
>>
>> from mpl_toolkits.mplot3d import Axes3D
>> from matplotlib.collections import PolyCollection
>> from matplotlib.colors import colorConverter
>> import matplotlib.pyplot as plt
>> import numpy as np
>> [cc('w',1.0),cc('w',1.0)
>> fig = plt.figure()
>> ax = fig.gca(projection='3d')
>>
>> cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.0)
>>
>> xs = np.arange(0, 10, 0.4)
>> verts = []
>> zs = [0.0, 1.0, 2.0, 3.0]
>> for z in zs:
>> ys = np.random.rand(len(xs))
>> ys[0], ys[-1] = 0, 0
>> verts.append(list(zip(xs, ys)))
>>
>> poly = PolyCollection(verts, facecolors = [cc('r'), cc('g'), cc('b'),
>> cc('y')])
>> #poly.set_alpha(0.7)
>> ax.add_collection3d(poly, zs=zs, zdir='y')
>>
>> ax.set_xlabel('X')
>> ax.set_xlim3d(0, 10)
>> ax.set_ylabel('Y')
>> ax.set_ylim3d(-1, 4)
>> ax.set_zlabel('Z')
>> ax.set_zlim3d(0, 1)
>>
>>
>> You should be able to set "edgecolors='none'" or as the same color as
>> the facecolors in the constructor for PolyCollection to make it
>> disappear. Unfortunately, that would apply to the entire polygon,
>> and not just the part at the base.
>>
>> Ben Root
>>
>
>
>
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Stephen G. <Ste...@an...> - 2012-11-20 21:38:59
|
Unfortunately, as you state, "edgecolors='none'" also wipes the
(x,y) data line.
I tried adding an additional "erase" zero line, with "edgecolors='none'"
for each slice, but it seems the return path extends from
(x[0],y[0]) to (x[-1],y[-1]) via some intermediate point.
An additional blank (x[0], 0.0) to (x[-1], 0.0) does not overlap the
baseline.
If I can determine the baseline path (coordinates) this procedure
may work.
Thanks, for your input.
Steve.
On 21/11/12 04:04, Benjamin Root wrote:
>
>
> On Tue, Nov 20, 2012 at 12:55 AM, Stephen Gibson
> <Ste...@an... <mailto:Ste...@an...>> wrote:
>
> I want to plot a series of (x,y) datasets similar to the
> polygon plot tutorial example (add_collection3d),
> but with a transparent facecolor and no baseline.
>
>
> Setting alpha=0.0 in the tutorial example (below)
> achieves the transparency, but the baseline remains.
>
> Is there a way to remove the baseline?
>
> Tks,
>
> Steve.
>
>
> from mpl_toolkits.mplot3d import Axes3D
> from matplotlib.collections import PolyCollection
> from matplotlib.colors import colorConverter
> import matplotlib.pyplot as plt
> import numpy as np
>
> fig = plt.figure()
> ax = fig.gca(projection='3d')
>
> cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.0)
>
> xs = np.arange(0, 10, 0.4)
> verts = []
> zs = [0.0, 1.0, 2.0, 3.0]
> for z in zs:
> ys = np.random.rand(len(xs))
> ys[0], ys[-1] = 0, 0
> verts.append(list(zip(xs, ys)))
>
> poly = PolyCollection(verts, facecolors = [cc('r'), cc('g'), cc('b'),
> cc('y')])
> #poly.set_alpha(0.7)
> ax.add_collection3d(poly, zs=zs, zdir='y')
>
> ax.set_xlabel('X')
> ax.set_xlim3d(0, 10)
> ax.set_ylabel('Y')
> ax.set_ylim3d(-1, 4)
> ax.set_zlabel('Z')
> ax.set_zlim3d(0, 1)
>
>
> You should be able to set "edgecolors='none'" or as the same color as
> the facecolors in the constructor for PolyCollection to make it
> disappear. Unfortunately, that would apply to the entire polygon, and
> not just the part at the base.
>
> Ben Root
>
|
|
From: Benjamin R. <ben...@ou...> - 2012-11-20 17:05:08
|
On Tue, Nov 20, 2012 at 12:55 AM, Stephen Gibson
<Ste...@an...>wrote:
> I want to plot a series of (x,y) datasets similar to the
> polygon plot tutorial example (add_collection3d),
> but with a transparent facecolor and no baseline.
>
>
> Setting alpha=0.0 in the tutorial example (below)
> achieves the transparency, but the baseline remains.
>
> Is there a way to remove the baseline?
>
> Tks,
>
> Steve.
>
>
> from mpl_toolkits.mplot3d import Axes3D
> from matplotlib.collections import PolyCollection
> from matplotlib.colors import colorConverter
> import matplotlib.pyplot as plt
> import numpy as np
>
> fig = plt.figure()
> ax = fig.gca(projection='3d')
>
> cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.0)
>
> xs = np.arange(0, 10, 0.4)
> verts = []
> zs = [0.0, 1.0, 2.0, 3.0]
> for z in zs:
> ys = np.random.rand(len(xs))
> ys[0], ys[-1] = 0, 0
> verts.append(list(zip(xs, ys)))
>
> poly = PolyCollection(verts, facecolors = [cc('r'), cc('g'), cc('b'),
> cc('y')])
> #poly.set_alpha(0.7)
> ax.add_collection3d(poly, zs=zs, zdir='y')
>
> ax.set_xlabel('X')
> ax.set_xlim3d(0, 10)
> ax.set_ylabel('Y')
> ax.set_ylim3d(-1, 4)
> ax.set_zlabel('Z')
> ax.set_zlim3d(0, 1)
>
>
You should be able to set "edgecolors='none'" or as the same color as the
facecolors in the constructor for PolyCollection to make it disappear.
Unfortunately, that would apply to the entire polygon, and not just the
part at the base.
Ben Root
|