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
(12) |
2
(13) |
3
(14) |
4
(9) |
|
5
(9) |
6
(22) |
7
(17) |
8
(16) |
9
(19) |
10
(17) |
11
(6) |
|
12
|
13
(20) |
14
(21) |
15
(20) |
16
(10) |
17
(14) |
18
(3) |
|
19
(3) |
20
(12) |
21
(22) |
22
(26) |
23
(31) |
24
(26) |
25
(9) |
|
26
(4) |
27
(33) |
28
(15) |
29
(37) |
30
(26) |
|
|
|
From: Eric F. <ef...@ha...> - 2009-04-06 22:14:50
|
j bai wrote:
> Hi, P.Romero,
> Please let me know if you get this working. I am trying to do the same
> type of 2 axes bar chart. but I got error message.
> I am using regular bar ().
> the following is the email i sent a week ago. Eric, I did use the
> twinx(), but it gave errors.
>
> thanks in advance.
>
> Hi, everyone,
> I am a matplotlib beginner. I am trying to do a chart with 2 y axes
> using twinx()
> I keep getting error message "malformed header from script. Bad
> header= is masked in one or more l: test.cgi" when I do two bar
> charts on two axes. if I do one bar chart and one line chart, I wouldnt
> get the error.
> if I refresh the web page, the chart would show up.
> the following is my code.
>
> ...
> ax = self.fig.add_axes( self.rectMain, axisbg=self.axesBG)
> ticks = self.setTickInterval( 10, 0, buybackDataobj.sharesMax)
> ind = na.array(range(len(
> buybackDataobj.quarters)))
> majorFormatter = FormatStrFormatter('%2.1f')
> ax.yaxis.set_major_locator(MultipleLocator( ticks ) )
> ax.yaxis.set_major_formatter(majorFormatter)
> bar(ind, buybackDataobj.shares, self.barwidth,
> color=self.draw.color['DarkGreen'] )
Try making that ax.bar(...)
>
> t = arange(0, float(buybackDataobj.sharesMax), ticks )
> ax.set_ylim(0, buybackDataobj.sharesMax * 1.1)
> ax.set_xlim(0, ind[-1] + self.barwidth*2)
> ax.set_ylabel("Value Bought " + buybackDataobj.scale, fontsize =
> self.fontsize )
>
> ax.set_xticks(ind + self.barwidth)
>
> ax.set_xticklabels( buybackDataobj.quarters, fontsize =
> self.fontsize)
> setp( ax.get_xticklabels(), rotation = self.rotation,
> horizontalalignment='center', family=
> 'sans-serif', fontsize = self.xaxisfs )
>
> if buybackDataobj.charttype == 'sells':
>
> ax2 = twinx()
> #ax2.plot(ind + self.barwidth/2, buybackDataobj.sells,
> ls='-', marker ='.', ms=11, c='#FF3300') // I wouldnt get the error
> message if I do this
> plot
>
> bar(ind + self.barwidth, buybackDataobj.sells,
> self.barwidth, color='#FF3300' ) // malformed header from script. Bad
> header= is masked in one or more l: test.cgi
And make that one ax2.bar(...).
It sounds like you have a combined mpl and cgi problem here; maybe an
exception in mpl is triggering a cgi error. "malformed header from
script" is not coming from mpl. "is masked in one or more" probably is,
but you need to see the whole traceback to find out what the problem is.
So as a matter of strategy, separate the mpl from the cgi; make sure
your script runs without error in standalone mode. Stick to purely or
mostly OO style. You probably want to start with something like
import matplotlib
matplotlib.use("agg")
import pyplot as plt # e.g. if you want to use "fig = plt.figure()"
This makes sure you are using a non-interactive backend.
See
http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server
Eric
> ax2.set_xticklabels(buybackDataobj.quarters, visible=False )
> ax2.set_ylim(buybackDataobj.sellsMin * 0.75,
> buybackDataobj.sellsMax * 1.1)
> ax2.set_ylabel("Insider Selling $" +
> buybackDataobj.sellsScale, verticalalignment='center', fontsize =
> self.fontsize)
>
> setp( ax2.get_yticklabels(), rotation = 0,
> horizontalalignment='left', family='sans-serif', fontsize=self.fontsize )
>
> .............
>
>
> On Mon, Apr 6, 2009 at 3:44 PM, Eric Firing <ef...@ha...
> <mailto:ef...@ha...>> wrote:
>
> P.Romero wrote:
> > Is it possible to create a colorbar with different scales on each
> side?
> >
> >
> >
> > Example:
> >
> > a temperature colorbar with celcius values on the left side and
> > farenheit values on the right side.
> >
> >
> >
> > If so, how could this be done?
>
> A colorbar is just an axes object with some customization of the ticks
> and labels, and with a pcolor plot inside. You could get your second
> scale using a technique similar to the twinx and twiny Axes methods; you
> can then use set_xlim or set_ylim so that the Fahrenheit range on the
> new axes matches the Celcius range on the old one.
>
> To get started, look at the source for the twinx/twiny methods.
>
> Eric
>
> >
> >
> >
> > Please help,
> >
> > Thanks,
> >
> > P.Romero
> >
> >
> >
> ------------------------------------------------------------------------
> >
> >
> ------------------------------------------------------------------------------
> > This SF.net email is sponsored by:
> > High Quality Requirements in a Collaborative Environment.
> > Download a free trial of Rational Requirements Composer Now!
> > http://p.sf.net/sfu/www-ibm-com
> >
> >
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> <mailto:Mat...@li...>
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: j b. <jia...@gm...> - 2009-04-06 21:42:48
|
Hi, P.Romero,
Please let me know if you get this working. I am trying to do the same
type of 2 axes bar chart. but I got error message.
I am using regular bar ().
the following is the email i sent a week ago. Eric, I did use the twinx(),
but it gave errors.
thanks in advance.
Hi, everyone,
I am a matplotlib beginner. I am trying to do a chart with 2 y axes using
twinx()
I keep getting error message "malformed header from script. Bad header=
is masked in one or more l: test.cgi" when I do two bar charts on two
axes. if I do one bar chart and one line chart, I wouldnt get the error.
if I refresh the web page, the chart would show up.
the following is my code.
...
ax = self.fig.add_axes( self.rectMain, axisbg=self.axesBG)
ticks = self.setTickInterval( 10, 0, buybackDataobj.sharesMax)
ind = na.array(range(len(buybackDataobj.quarters)))
majorFormatter = FormatStrFormatter('%2.1f')
ax.yaxis.set_major_locator(MultipleLocator( ticks ) )
ax.yaxis.set_major_formatter(majorFormatter)
bar(ind, buybackDataobj.shares, self.barwidth,
color=self.draw.color['DarkGreen'] )
t = arange(0, float(buybackDataobj.sharesMax), ticks )
ax.set_ylim(0, buybackDataobj.sharesMax * 1.1)
ax.set_xlim(0, ind[-1] + self.barwidth*2)
ax.set_ylabel("Value Bought " + buybackDataobj.scale, fontsize =
self.fontsize )
ax.set_xticks(ind + self.barwidth)
ax.set_xticklabels( buybackDataobj.quarters, fontsize =
self.fontsize)
setp( ax.get_xticklabels(), rotation = self.rotation,
horizontalalignment='center', family=
'sans-serif', fontsize = self.xaxisfs )
if buybackDataobj.charttype == 'sells':
ax2 = twinx()
#ax2.plot(ind + self.barwidth/2, buybackDataobj.sells,
ls='-', marker ='.', ms=11, c='#FF3300') // I wouldnt get the error
message if I do this
plot
bar(ind + self.barwidth, buybackDataobj.sells,
self.barwidth, color='#FF3300' ) // malformed header from script. Bad
header= is masked in one or more l: test.cgi
ax2.set_xticklabels(buybackDataobj.quarters, visible=False )
ax2.set_ylim(buybackDataobj.sellsMin * 0.75,
buybackDataobj.sellsMax * 1.1)
ax2.set_ylabel("Insider Selling $" +
buybackDataobj.sellsScale, verticalalignment='center', fontsize =
self.fontsize)
setp( ax2.get_yticklabels(), rotation = 0,
horizontalalignment='left', family='sans-serif', fontsize=self.fontsize )
.............
On Mon, Apr 6, 2009 at 3:44 PM, Eric Firing <ef...@ha...> wrote:
> P.Romero wrote:
> > Is it possible to create a colorbar with different scales on each side?
> >
> >
> >
> > Example:
> >
> > a temperature colorbar with celcius values on the left side and
> > farenheit values on the right side.
> >
> >
> >
> > If so, how could this be done?
>
> A colorbar is just an axes object with some customization of the ticks
> and labels, and with a pcolor plot inside. You could get your second
> scale using a technique similar to the twinx and twiny Axes methods; you
> can then use set_xlim or set_ylim so that the Fahrenheit range on the
> new axes matches the Celcius range on the old one.
>
> To get started, look at the source for the twinx/twiny methods.
>
> Eric
>
> >
> >
> >
> > Please help,
> >
> > Thanks,
> >
> > P.Romero
> >
> >
> > ------------------------------------------------------------------------
> >
> >
> ------------------------------------------------------------------------------
> > This SF.net email is sponsored by:
> > High Quality Requirements in a Collaborative Environment.
> > Download a free trial of Rational Requirements Composer Now!
> > http://p.sf.net/sfu/www-ibm-com
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Nathaniel T. <loc...@ya...> - 2009-04-06 20:29:35
|
In regards to my previous example, the lambda function magic is unnecessary, instead of: gobject.idle_add(lambda iter=animate(): iter.next()) It is simply adequate to do: gobject.idle_add(animate().next) Which is much simpler. My apologies for over coding the solution. -- Nathaniel |
|
From: Nathaniel T. <loc...@ya...> - 2009-04-06 20:06:18
|
I don't know who I should notify about this, but I've found a fix for simple animation. If one uses the code found here: http://matplotlib.sourceforge.net/examples/animation/simple_anim_gtk.html it works okay, but if you try to move the window it freezes, and you can't use anything on the toolbar. Really annoying, and why not quite a bug, its definitely undesirable behavior. So I've found a very simple fix that leaves the gui reasonably interactive and the window is freely movable. It centers around using a python generator and the yield statement. Calling "yield some_variable" in a function causes execution to stop at that point until the generator's next() method is called, this allows us to "pause" the execution of the animate() function and return control the gui thread. As it currently stands, once animate() is called it executes until completion, never allowing gui events to be handled, hence the freezing. The solution is changing too lines of code, note that this is for the GTK example but the same principle should be applicable to the other backends. Note that there are extra explanatory comments that could be removed when posting the actual example. -- Nathaniel """ A simple example of an animated plot using a gtk backend """ import time import numpy as np import matplotlib matplotlib.use('GTKAgg') # do this before importing pylab import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) def animate(): tstart = time.time() # for profiling x = np.arange(0, 2*np.pi, 0.01) # x-array line, = ax.plot(x, np.sin(x)) for i in np.arange(1,200): line.set_ydata(np.sin(x+i/10.0)) # update the data fig.canvas.draw() # redraw the canvas # Here is generator magic that stops execution of animate() till the generators next() method is called yield True # continue animating print 'FPS:' , 200/(time.time()-tstart) raise SystemExit import gobject print 'adding idle' # This is some lambda and python magic: # Python only evaluates defaults for arguments once, # so the first call to this lambda function sets iter to the generator made (automagically) from the animate() function. # Each subsequent call to the lambda function calls iter.next() which restarts(unpauses) execution of the animate() function, # until it yeilds again, at which point control goes back to the gui # These calls are done when the gui is idle, hence why we are registering an idle callback, gobject.idle_add(lambda iter=animate(): iter.next()) print 'showing' plt.show() |
|
From: Jeff W. <js...@fa...> - 2009-04-06 19:56:37
|
P.Romero wrote: > Jeff, > I've attached a test script and my data file. > Unfortunately, the method that Im using to create the data set isn't very > portable (the data is being imported from an external program), so sending > my .npz file is the best I can do. > > The gaps are about 5 pixels, and create an offset from where the contours > end to where the basemap hits the edge of the plot. > > Please let me know if there's something in my data set that could be causing > this, or if its an issue with basemap. > > Thanks, > P.Romero > Pablo: The extend of your map projection region is m.ymin, m.ymax = 0.0 1812318.63167 whereas Y.min(), Y.max() = -28762.6317985 1780259.69866. The reason you get the gap along the top edge is that the data doesn't extend all the way to the northern boundary of the map region. Just shrink your map region a little bit and it will go away. -Jeff > -----Original Message----- > From: Jeff Whitaker [mailto:js...@fa...] > Sent: 2009-04-06 6:13 AM > To: P.Romero > Cc: mat...@li... > Subject: Re: [Matplotlib-users] problem with basemap & my data arrays, gap > around plot edge > > P.Romero wrote: > >> Hi, >> >> Im having a problem with contourf & basemap; >> >> theres a fairly wide gap showing up around the top&left edges of my plot. >> >> Im trying to do the following: >> >> Import numpy as np >> >> Z=my_data( .) >> >> m=basemap( . ) >> >> X,Y=m(*np.meshgrid(Z.lon,Z.lat)) >> >> Znp=Z.filled >> >> cs=m.contourf(X,Y,Znp) >> >> using this method, Im experiencing a strange gap around the left&top >> edges of the plot. >> >> It seems as if the contour data is not aligning correctly with the >> basemap, or is somehow 'falling short' of filling in the entire area. >> >> Ive used this same method to plot other contour plots and have never >> experienced this type of gap (using the same version of >> basemap/matplotlib/numpy/etc.). >> >> Im not sure if there's something wrong with the way Im creating my >> data, or if this is a problem with basemap. >> >> In either case, can someone please provide me with some help figuring >> out why that gap is appearing? >> >> Ive attached an npz file with my 3 arrays: X,Y,Znp. >> >> Ive also attached a png image of my output, where the gap is clearly >> evident around the left&top edges. >> >> Thanks, >> >> P.Romero >> >> > > Pablo: Please include a working example that creates your example plot. > > -Jeff > -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: Eric F. <ef...@ha...> - 2009-04-06 19:44:20
|
P.Romero wrote: > Is it possible to create a colorbar with different scales on each side? > > > > Example: > > a temperature colorbar with celcius values on the left side and > farenheit values on the right side. > > > > If so, how could this be done? A colorbar is just an axes object with some customization of the ticks and labels, and with a pcolor plot inside. You could get your second scale using a technique similar to the twinx and twiny Axes methods; you can then use set_xlim or set_ylim so that the Fahrenheit range on the new axes matches the Celcius range on the old one. To get started, look at the source for the twinx/twiny methods. Eric > > > > Please help, > > Thanks, > > P.Romero > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: jtamir <jt...@ar...> - 2009-04-06 19:34:40
|
Hi, I am having trouble installing Basemap. I followed the directions in the README file included in the archive (and posted at http://matplotlib.sourceforge.net/basemap/doc/html/users/installing.html). After successfully installing the GEOS library (also included), I cd to the "top level basemap directory" and run the command "python setup.py install." The install fails, with multiple compile errors related to src/_proj.c. However, it appears that lib/python2.5/site-packages/numpy/core/include/numpy/__multiarray_a pi.h also produces errors, so I suspect it may have to do with gcc... Some relevant information... Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy; import matplotlib >>> print numpy.__version__, matplotlib.__version__ 1.1.1 0.98.3 ...And the last few errors when trying to install... src/_proj.c:3563: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__pyx_PyInt_AsUnsignedLongLong’ src/_proj.c:3585: error: expected ‘)’ before ‘*’ token src/_proj.c:3600: error: expected ‘)’ before ‘*’ token src/_proj.c:3615: error: expected ‘)’ before ‘*’ token src/_proj.c:3630: error: expected ‘)’ before ‘*’ token src/_proj.c:3645: error: expected ‘)’ before ‘*’ token src/_proj.c:3660: error: expected ‘)’ before ‘*’ token src/_proj.c:3675: error: expected ‘)’ before ‘*’ token src/_proj.c:3690: error: expected ‘)’ before ‘*’ token src/_proj.c:3705: error: expected ‘)’ before ‘*’ token src/_proj.c:3720: error: expected ‘)’ before ‘*’ token src/_proj.c:3735: error: expected ‘)’ before ‘*’ token error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Isrc -I/home/jtamir/lib/python2.5/site-packages/numpy/core/include -I/home/jtamir/include/python2.5 -c src/_proj.c -o build/temp.linux-i686-2.5/src/_proj.o" failed with exit status 1 Any idea how to proceed? Thanks, Jon -- View this message in context: http://www.nabble.com/Basemap-Installation-Errors-tp22915617p22915617.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: P.Romero <rom...@ho...> - 2009-04-06 19:29:29
|
Is it possible to create a colorbar with different scales on each side? Example: a temperature colorbar with celcius values on the left side and farenheit values on the right side. If so, how could this be done? Please help, Thanks, P.Romero |
|
From: P.Romero <rom...@ho...> - 2009-04-06 19:27:24
|
Jeff, I've attached a test script and my data file. Unfortunately, the method that Im using to create the data set isn't very portable (the data is being imported from an external program), so sending my .npz file is the best I can do. The gaps are about 5 pixels, and create an offset from where the contours end to where the basemap hits the edge of the plot. Please let me know if there's something in my data set that could be causing this, or if its an issue with basemap. Thanks, P.Romero -----Original Message----- From: Jeff Whitaker [mailto:js...@fa...] Sent: 2009-04-06 6:13 AM To: P.Romero Cc: mat...@li... Subject: Re: [Matplotlib-users] problem with basemap & my data arrays, gap around plot edge P.Romero wrote: > > Hi, > > Im having a problem with contourf & basemap; > > theres a fairly wide gap showing up around the top&left edges of my plot. > > Im trying to do the following: > > Import numpy as np > > Z=my_data( .) > > m=basemap( . ) > > X,Y=m(*np.meshgrid(Z.lon,Z.lat)) > > Znp=Z.filled > > cs=m.contourf(X,Y,Znp) > > using this method, Im experiencing a strange gap around the left&top > edges of the plot. > > It seems as if the contour data is not aligning correctly with the > basemap, or is somehow 'falling short' of filling in the entire area. > > Ive used this same method to plot other contour plots and have never > experienced this type of gap (using the same version of > basemap/matplotlib/numpy/etc.). > > Im not sure if there's something wrong with the way Im creating my > data, or if this is a problem with basemap. > > In either case, can someone please provide me with some help figuring > out why that gap is appearing? > > Ive attached an npz file with my 3 arrays: X,Y,Znp. > > Ive also attached a png image of my output, where the gap is clearly > evident around the left&top edges. > > Thanks, > > P.Romero > Pablo: Please include a working example that creates your example plot. -Jeff |
|
From: Troels K. J. <tkj...@gm...> - 2009-04-06 18:48:09
|
On Monday 06 April 2009 20:15:47 Jouni K. Seppänen wrote:
> Chaitanya Krishna <ic...@gm...> writes:
> > That is, when I use pylab.ylabel(r'$V [A^{3}]$') I don't get any space
> > in between V and [.
>
> Like TeX, matplotlib ignores spaces in math mode and uses spacing
> derived from the usual roles of the symbols. You need to use an explicit
> command to add space.
>
> > I also tried using the math mode spacing for Latex, So, if I try to do
> > pylab.ylabel(r'$V\;[A^{3}]$'), I only get V and not even A^3.
>
> On the current trunk, and on the v0_98_5 maintenance branch, that works
> fine. At least the following spacing commands seem to work: r'$a\ b$',
> r'$a\,b$', r'$a\;b$', r'$a\!b$' (negative space) and r'$a\quad b$' work.
> Perhaps you can update to a newer version of matplotlib?
It is also possible to mix math mode and non-math mode.
ylabel(r'$V$ [\AA$^3$]')
(also note that units by convention are not italic...)
Best regards
Troels Kofoed Jacobsen
|
|
From: Jouni K. S. <jk...@ik...> - 2009-04-06 18:16:11
|
Chaitanya Krishna <ic...@gm...> writes:
> That is, when I use pylab.ylabel(r'$V [A^{3}]$') I don't get any space
> in between V and [.
Like TeX, matplotlib ignores spaces in math mode and uses spacing
derived from the usual roles of the symbols. You need to use an explicit
command to add space.
> I also tried using the math mode spacing for Latex, So, if I try to do
> pylab.ylabel(r'$V\;[A^{3}]$'), I only get V and not even A^3.
On the current trunk, and on the v0_98_5 maintenance branch, that works
fine. At least the following spacing commands seem to work: r'$a\ b$',
r'$a\,b$', r'$a\;b$', r'$a\!b$' (negative space) and r'$a\quad b$' work.
Perhaps you can update to a newer version of matplotlib?
--
Jouni K. Seppänen
http://www.iki.fi/jks
|
|
From: Jouni K. S. <jk...@ik...> - 2009-04-06 17:37:35
|
A B <pyt...@gm...> writes: > I have the following code and am wondering whether there is a more > efficient way to plot multiple curves. Maybe somehow accumulating the > data into a single variable, then calling plot once ... Thanks for any > ideas. > > for ofile in files: > d = mlab.csv2rec(ofile, names = ['date','field']) > ax.plot(d['date'], d['field']) You can give multiple x,y pairs to plot, so perhaps something like data = [mlab.csv2rec(f, names=['date','field']) for f in files] data = [[x['date'],x['field']] for x in data] ax.plot(*np.concatenate(data)) would work. But I don't know if it's really any more efficient. For large plots, you may want to take a look at collections: http://matplotlib.sourceforge.net/api/collections_api.html#matplotlib.collections.LineCollection -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: João L. S. <js...@fc...> - 2009-04-06 14:49:40
|
Hi,
I found a minor bug, feel free to ignore it :) . If the vertical scale
of a plot has numbers ~1E-6 the ylabel won't be visible. Example script:
#-------------------------------------------
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(-10.0,10.0,0.1)
plt.plot(x,1E-6*np.sin(x))
plt.ylabel("Y Label")
plt.show()
#-------------------------------------------
The workaround is of course simple, just adjust figure.subplot.left.
Ubuntu 8.10, matplotlib svn (rev. 7032).
JLS
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-04-06 14:38:06
|
There are a few ways to do that depending on exactly what you want.
>From your script, you may just clip your image.
im = imshow(Z, extent=(-1, 1, -1, 1))
im.set_clip_path(Circle((0,0),1, transform=ax.transData))
(Note the use of extent keyword in imshow)
Or,
You can use polar coordinate with pcolormesh for image display. But
your data need to be defined in the polar coordinate, unlike your
script.
# function defined in polar coordinate
def func5(theta, r):
y = r*np.sin(theta)
theta=np.arcsin(y)
return np.cos(theta)
R=1.
n_theta, n_r = 360, 100
# cooridnates of the mesh
theta = np.linspace(0, 2*np.pi, n_theta+1)
r = np.linspace(0., R, n_r + 1)
dr, dtheta = r[1]-r[0], theta[1]-theta[0]
# cooridnate for the data point
theta_d = np.arange(dtheta/2., 2*np.pi, dtheta)
r_d = np.arange(dr/2., R, dr)
TT, RR = meshgrid(theta_d, r_d)
Z = func5(TT, RR)
ax=subplot(1,1,1, projection="polar", aspect=1.)
ax.pcolormesh(theta, r, Z)
-JJ
On Mon, Apr 6, 2009 at 6:35 AM, Lorenzo Isella <lor...@gm...> wrote:
> Hello,
> So maybe a couple of images can help.
> Using the code
>
>
> #!/usr/bin/env python
> """
> See pcolor_demo2 for a much faster way of generating pcolor plots
> """
> from __future__ import division
> from pylab import *
>
> def func3(x,y):
> return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2)
>
>
> def func4(x,y):
> theta=arcsin(y)
> return cos(theta)
>
>
> # make these smaller to increase the resolution
> dx, dy = 0.05, 0.05
>
> x = arange(-1.0, 1.0, dx)
> y = arange(-1.0, 1.0, dy)
> X,Y = meshgrid(x, y)
>
> Z = func4(X, Y)
>
> print "Z is, ", Z
>
> ax = subplot(111)
> im = imshow(Z, cmap=cm.jet)
> #im.set_interpolation('nearest')
> #im.set_interpolation('bicubic')
> im.set_interpolation('bilinear')
> #ax.set_image_extent(-3, 3, -3, 3)
>
> show()
>
> I can get the attached image.png, but what I am really after is
> image2.png (the same quantity plotted on a circular domain!). How can
> I achieve that (without using scissors on an existing image?).
> This is what I meant from start.
> Cheers
>
> Lorenzo
>
>
>
>
> 2009/4/3 Jae-Joon Lee <lee...@gm...>:
>> I'm afraid that I'm still confused and there seems to be not much
>> thing I can help..
>>
>> You're considering a circle, but you already have your function in a
>> cartesian coordinate. I'm not sure why you can't just plot in a
>> cartesian coordinate? (in other words, what is wrong with your
>> original script?)
>>
>> There is an "set_image_extent" call in your original script (although
>> commented out). Maybe what you're trying to do is simply
>>
>> im = imshow(Z, cmap=cm.jet, extent=(-3, 3, -3, 3))
>>
>> I'm not sure it would be relevant, but if you have your function or
>> data in (r, theta) coordinate, one simple way is just to use the
>> polar axes with pcolormesh method.
>>
>> n_theta, n_r = 100, 50
>> theta = np.linspace(0, 2*np.pi, n_theta+1)
>> r = np.linspace(0., 1., n_r + 1)
>> data = np.arange(0., n_theta*n_r).reshape(n_r, n_theta)
>> ax=subplot(1,1,1, projection="polar", aspect=1.)
>> ax.pcolormesh(theta, r, data)
>>
>>
>>
>> -JJ
>>
>
>
>
> --
> Life is what happens to you while you're busy making other plans.
>
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-04-06 13:39:39
|
The easiest solution would be to use a proxy(?) artist. For example, l1, = plot(x, y, "bo") # original points l2, = plot(xnew, ynew, "b-") # interpolated line l3, = plot(x, y, "bo-") # just for the legend l3.remove() # remove the line from the axes so that it is not drawn. legend([ll3], ["bo-"]) IHTH, -JJ On Mon, Apr 6, 2009 at 3:01 AM, Sahar <sa...@cm...> wrote: > I want to plot smooth line between data points (Excel like) and I can do it > with with 2 lines: > > Original data points as circles, for instance: plot(x, y, 'bo') > Spline of these points as line: plot(xnew, ynew, 'b-') > > The only problem with this is the legend - I get either 'o' or '---' but not > the required 'o-----o'. > > > Thanks for any suggestions, > > > > ******************************************************************************************************* > This e-mail message may contain confidential,and privileged information or > data that constitute proprietary information of CMT Medical Ltd. Any review > or distribution by others is strictly prohibited. If you are not the > intended recipient you are hereby notified that any use of this information > or data by any other person is absolutely prohibited. If you are not the > intended recipient, please delete all copies. Thank You. > http://www.cmt.co.il > ******************************************************************************************************** > > > > > > ************************************************************************************ > This footnote confirms that this email message has been scanned by > PineApp Mail-SeCure for the presence of malicious code, vandals & computer > viruses. > ************************************************************************************ > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Jeff W. <js...@fa...> - 2009-04-06 11:13:25
|
P.Romero wrote: > > Hi, > > Im having a problem with contourf & basemap; > > theres a fairly wide gap showing up around the top&left edges of my plot. > > Im trying to do the following: > > Import numpy as np > > Z=my_data( …) > > m=basemap( … ) > > X,Y=m(*np.meshgrid(Z.lon,Z.lat)) > > Znp=Z.filled > > cs=m.contourf(X,Y,Znp) > > using this method, Im experiencing a strange gap around the left&top > edges of the plot. > > It seems as if the contour data is not aligning correctly with the > basemap, or is somehow ‘falling short’ of filling in the entire area. > > Ive used this same method to plot other contour plots and have never > experienced this type of gap (using the same version of > basemap/matplotlib/numpy/etc.). > > Im not sure if there’s something wrong with the way Im creating my > data, or if this is a problem with basemap. > > In either case, can someone please provide me with some help figuring > out why that gap is appearing? > > Ive attached an npz file with my 3 arrays: X,Y,Znp. > > Ive also attached a png image of my output, where the gap is clearly > evident around the left&top edges. > > Thanks, > > P.Romero > Pablo: Please include a working example that creates your example plot. -Jeff |
|
From: Lorenzo I. <lor...@gm...> - 2009-04-06 10:35:49
|
Hello,
So maybe a couple of images can help.
Using the code
#!/usr/bin/env python
"""
See pcolor_demo2 for a much faster way of generating pcolor plots
"""
from __future__ import division
from pylab import *
def func3(x,y):
return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2)
def func4(x,y):
theta=arcsin(y)
return cos(theta)
# make these smaller to increase the resolution
dx, dy = 0.05, 0.05
x = arange(-1.0, 1.0, dx)
y = arange(-1.0, 1.0, dy)
X,Y = meshgrid(x, y)
Z = func4(X, Y)
print "Z is, ", Z
ax = subplot(111)
im = imshow(Z, cmap=cm.jet)
#im.set_interpolation('nearest')
#im.set_interpolation('bicubic')
im.set_interpolation('bilinear')
#ax.set_image_extent(-3, 3, -3, 3)
show()
I can get the attached image.png, but what I am really after is
image2.png (the same quantity plotted on a circular domain!). How can
I achieve that (without using scissors on an existing image?).
This is what I meant from start.
Cheers
Lorenzo
2009/4/3 Jae-Joon Lee <lee...@gm...>:
> I'm afraid that I'm still confused and there seems to be not much
> thing I can help..
>
> You're considering a circle, but you already have your function in a
> cartesian coordinate. I'm not sure why you can't just plot in a
> cartesian coordinate? (in other words, what is wrong with your
> original script?)
>
> There is an "set_image_extent" call in your original script (although
> commented out). Maybe what you're trying to do is simply
>
> im = imshow(Z, cmap=cm.jet, extent=(-3, 3, -3, 3))
>
> I'm not sure it would be relevant, but if you have your function or
> data in (r, theta) coordinate, one simple way is just to use the
> polar axes with pcolormesh method.
>
> n_theta, n_r = 100, 50
> theta = np.linspace(0, 2*np.pi, n_theta+1)
> r = np.linspace(0., 1., n_r + 1)
> data = np.arange(0., n_theta*n_r).reshape(n_r, n_theta)
> ax=subplot(1,1,1, projection="polar", aspect=1.)
> ax.pcolormesh(theta, r, data)
>
>
>
> -JJ
>
--
Life is what happens to you while you're busy making other plans.
|
|
From: Gregor T. <gre...@gm...> - 2009-04-06 08:48:09
|
Eric Firing schrieb: > Gregor Thalhammer wrote: >> Tobias Wood >> [...] > [...] >> I also noticed you used C++ constructs in your code. I think this is >> not recommended. > > Gregor, > > Would you elaborate, please, to satisfy my curiosity? The original > file is C++, so use of C++ constructs in the patch would seem natural. > > Thank you. > > Eric > You are right. I was assuming the original file is C. Sorry for this stupid comment. Gregor |
|
From: Sahar <sa...@cm...> - 2009-04-06 07:25:29
|
I want to plot smooth line between data points (Excel like) and I can do it with with 2 lines: a.. Original data points as circles, for instance: plot(x, y, 'bo') b.. Spline of these points as line: plot(xnew, ynew, 'b-') The only problem with this is the legend - I get either 'o' or '---' but not the required 'o-----o'. Thanks for any suggestions, ******************************************************************************************************* This e-mail message may contain confidential,and privileged information or data that constitute proprietary information of CMT Medical Ltd. Any review or distribution by others is strictly prohibited. If you are not the intended recipient you are hereby notified that any use of this information or data by any other person is absolutely prohibited. If you are not the intended recipient, please delete all copies. Thank You. http://www.cmt.co.il ******************************************************************************************************** ************************************************************************************ This footnote confirms that this email message has been scanned by PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses. ************************************************************************************ |
|
From: Andrew S. <str...@as...> - 2009-04-06 02:13:44
|
Tobias Wood wrote: >> Tobias, >> >> I would like to apply your patch, but the test in >> examples/tests/pngsuite fails. If you can submit a new patch where this >> test passes, and, even better, if a small example 12-bit PNG of yours is >> added to the test, I will apply it. >> >> Apart from that, I would echo Eric's thanks for the patch and >> explanation. >> >> -Andrew > > Hi Andrew and Eric, > Thanks for the responses. I was unaware of the png test suite. I have > attached a new diff that passes this test correctly. It originally > failed because I was not handling greyscale images with an alpha > channel, but it also brought to light several other issues with my code > that I have fixed. I have changed the structure of the code > significantly - the if/else struct has gone and a single loop returns > the different image matrices. Although this is more concise, it no > longer informs the user if it hits an unsupported image type. > > Unfortunately I do not have a small test image available, all of ours > are a minimum of 512x620. However the pngsuite page, > http://libpng.org/pub/png/pngsuite.html, does have a set of suitable > images labelled cs*n*.png. These have thrown up an interesting issue - > to what maximum value should n-bit images be scaled when n is between 8 > and 16? The png spec and test images suggest it should be (2^n - 1). > This means that higher bit depths give higher precision over the same > intensity range and the same maximum value. However for my particular > camera and software this would be wrong, as the CCD has a fixed 12-bit > dynamic range and the lower png bit depths are only used to save file > space. Hence at the moment I have set my software to scale to (2^16 - 1) > for 8 < n < 16, but it follows the png spec for n < 8, so there are two > contradictory behaviours and I am unsure which is the best approach. > Personally I would prefer matplotlib to return raw integer values, not > floats scaled between 0 and 1 and then I can apply the scaling myself, > but I am aware that this is not particularly user friendly for anyone > else. imshow() seems to handle integer values fine and correctly scales > for display, provided that no alpha channel is present. > > Should I post another message to the developer list about this to see > what people think? I'd very much like to discuss this with someone who > has a lot more experience of pngs than me. Tobias, I went ahead and applied your patch to the svn trunk and the 0.98.5 maintenance branch -- the aspect of having grayscale images come in as 2d arrays brings the functionality inline with the docstring to imread(), so it qualifies as a bug fix. The rest is a nice feature addition (the ability to read high dynamic range PNGs) that I think is unlikely to break anything. As for your questions, I think they can be addressed later. (I hope you maintain your interest in this subject.) In particular, it would be good to get Michael Droetboom's responses on this -- he's the resident PNG expert. In terms of the 8 < n < 16 bit PNG issue, if they are to be stored as integers, they will have to be stored in 16 bits, thus there are two reasonable ways to do it -- left shifted and right shifted. There are arguments for both. Thus, my opinion is that adding keyword arguments to imread() that would modify the current behavior appropriately would be the best solution. In other words, something like return_as_integer=False, integer_shift='left' would be the defaults. Next time you submit patches, I do think it would be best to submit to the mpl-dev email list. Anyhow, thanks for the patch! -Andrew |