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
(3) |
2
(7) |
3
(13) |
4
(6) |
5
(18) |
6
(39) |
7
(1) |
8
(4) |
9
(4) |
10
(4) |
11
(19) |
12
(15) |
13
(16) |
14
(1) |
15
(5) |
16
(17) |
17
(12) |
18
(19) |
19
(2) |
20
(5) |
21
(3) |
22
(1) |
23
(3) |
24
(5) |
25
(4) |
26
(1) |
27
(13) |
28
(4) |
29
(2) |
30
(21) |
31
(17) |
|
|
|
|
From: Benjamin R. <ben...@ou...> - 2011-05-06 01:18:14
|
2011/4/3 hongleij <hon...@12...> > OS :Win7 SP1 > ActivePython-2.7.1.3-win32-x86.msi > numpy-1.5.1-win32-superpack-python2.7.exe > matplotlib-1.0.1.win32-py2.7.exe > > Code: > > from mpl_toolkits.mplot3d import axes3d > ax = axes3d.Axes3D(plt.gcf()) > #ax.set_xlim(1,100000) > #ax.set_ylim(1,100000) > ax.set_xlabel("Download(GB)") > ax.set_ylabel("Upload(GB)") > ax.set_title("User Up/Down In 6 days") > ax.set_xscale('log') # Error: Cause No display > #ax.set_yscale('log') # > group = ax.scatter3D([1,20,300],[1,20,300],[1,20,300]) > #ax.legend( user_level_groups, [ user[0] for user in > user_level_str_list] ) > plt.show() > > > Error: > > Exception in Tkinter callback > Traceback (most recent call last): > File "C:\Python27\lib\lib-tk\Tkinter.py", line 1410, in __call__ > return self.func(*args) > File > "C:\Python27\lib\site-packages\matplotlib\backends\backend_tkagg.py", line > 245, in resize > self.show() > File > "C:\Python27\lib\site-packages\matplotlib\backends\backend_tkagg.py", line > 248, in draw > FigureCanvasAgg.draw(self) > File "C:\Python27\lib\site-packages\matplotlib\backends\backend_agg.py", > line 394, in draw > self.figure.draw(self.renderer) > File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 798, in > draw > func(*args) > File "C:\Python27\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line > 172, in draw > ax.draw(renderer) > File "C:\Python27\lib\site-packages\mpl_toolkits\mplot3d\axis3d.py", line > 238, in draw > self.label.draw(renderer) > File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "C:\Python27\lib\site-packages\matplotlib\text.py", line 591, in > draw > ismath=ismath) > File "C:\Python27\lib\site-packages\matplotlib\backends\backend_agg.py", > line 154, in draw_text > self._renderer.draw_text_image(font.get_image(), int(x), int(y) + 1, > angle, gc) > File "C:\Python27\lib\site-packages\numpy\ma\core.py", line 3818, in > __int__ > raise MaskError, 'Cannot convert masked element to a Python int.' > MaskError: Cannot convert masked element to a Python int. > > Sorry for the delay in responding. Yes, this is a known bug. I have not been able to figure out its exact cause. At this point, I will just say that mplot3d does not support log scales. Sorry I could not be more helpful. Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-06 01:00:20
|
On Sat, Apr 16, 2011 at 8:17 AM, Giovanni Luca Ciampaglia < jun...@gm...> wrote: > Is there a way to control the distance between the axis label and the > tick labels with mplot3d.Axes3D? For small figure sizes they overlap and > I haven't found a way to fix that. My last resort was to remove the tick > labels but that sucks for publication-quality plots. > > Cheers, > -- > Giovanni Luca Ciampaglia > Giovanni, Sorry for the delay in responding. I have not been following this mailing list for the past couple of months. Currently, the distance for the positioning of the label and the ticks is hard-coded. Note that in the current development branch (and I believe in v1.0.1), I have made some significant fixes to the calculation and alignment of the tick labels. This has lead to substantial improvement (in my opinion) of the ticklabel placement. My plan is for the next release to remove many of the hard-coded values that governs the appearance of mplot3d plots. Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-06 00:53:31
|
On Mon, Apr 18, 2011 at 4:25 AM, Muffles <dan...@gm...> wrote: > > Hello all, > i created some program to read from netcdf files and plot the data, and it > seems to work ok. But when i try to run an older file, it just shows this: > > Traceback (most recent call last): > File "netcdf2png.py", line 199, in <module> > savefig("range.png") > File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 356, in > savefig > return fig.savefig(*args, **kwargs) > File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 1032, in > savefig > self.canvas.print_figure(*args, **kwargs) > File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line > 1476, in print_figure > **kwargs) > File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", > line 358, in print_png > FigureCanvasAgg.draw(self) > File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", > line 314, in draw > self.figure.draw(self.renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 773, in > draw > for a in self.axes: a.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1735, in draw > a.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/collections.py", line 704, > in draw > return Collection.draw(self, renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/lib/pymodules/python2.6/matplotlib/collections.py", line 201, > in draw > self.update_scalarmappable() > File "/usr/lib/pymodules/python2.6/matplotlib/collections.py", line 477, > in update_scalarmappable > self._facecolors = self.to_rgba(self._A, self._alpha) > File "/usr/lib/pymodules/python2.6/matplotlib/cm.py", line 166, in to_rgba > x = self.norm(x) > File "/usr/lib/pymodules/python2.6/matplotlib/colors.py", line 825, in > __call__ > raise ValueError("minvalue must be less than or equal to maxvalue") > ValueError: minvalue must be less than or equal to maxvalue > > Any ideas? > Thx in advance > My best guess is that there is something messing up the colormap normalization. Without knowing more about your program and the data being plotted, I can't say more. Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-06 00:49:35
|
I apologize for the delay. I have not been paying attention to this mailing list for the past couple of months. My responses are below. On Wed, Apr 20, 2011 at 12:20 AM, José Alexandre Nalon <na...@te...>wrote: > Greetings, > > I'm trying to use Matplotlib to plot 3d surfaces, with > good results. While the plot are nice, there is little > information on the website about customizing them. To > get what I want, I used some tricks and hacks, and I am > pretty sure that there are better ways to do it. Here is > what I did, if you have any advice on how to do it better. > > * The wireframe lines in the surface are thicker than I > wanted. I couldn't find a way to configure their > thickness. To get thinner lines, I made my plots huge > (about 24 inches), and adjusted fonts accordingly. This > is a very ugly (and unpredictable) hack. > > That sounds like a decent feature request. Could you please file one at either sourceforge or github? > * I need gray images, so I used the gray colormap. This, > however, gave me very dark and bright areas, and I > wanted a little less variation. Since my functions > always range from 0. to 1., I set vmin=-1 and vmax=2. > I got the result I wanted, but I feel that there is > a better way to do that. > > This is more of an issue regarding colormap norms. You might want to read up on them here: http://matplotlib.sourceforge.net/api/colors_api.html?highlight=colormap%20norm#matplotlib.colors.Normalize > * The grids on the 'walls' and 'floor', on the other hand, > are very bright, and I wanted them darker. Couldn't find > a way to do that. > > Not currently. These are hard-coded. I am hoping to have that and other things configurable in the next release of mpl. > * In some plots, I don't want ticks on some axis. Setting > ticks to [] gave me no result, and there is no method > for that in the z-axis. Setting ticklabels to [] also > made no difference. Is there a way to remove the ticks > or the labels in 3d plots? > > Are you talking about the ticks, or the labels for the tick locations? Note that in 2d plots you can have ticks without labels, or labels without ticks. Currently in mplot3d, this is not very neat, and it is one thing I want to have cleaned up for the next release. > I figure out that there is probably ways to do all those > by handling the corresponding Artists, or other object of > the kind. But they are full of details, and I don't know > exactly where to start. Any directions will be appreciated. > > I've been using matplotlib for years, and it is always > helpful, and the plots are always beautiful. Thanks for > the nice work. > > Thanks for using matplotlib! Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-06 00:35:39
|
On Tue, Apr 26, 2011 at 3:02 PM, Eric Firing <ef...@ha...> wrote: > On 04/26/2011 09:36 AM, bu...@gm... wrote: > > I believe this feature, which has been requested a number of times, but > > is still missing from matplotlib is genuinely useful for interactive > > plotting. Moreover, I've heard matlab has it... > > > > Here's a potential solution to cover my simple plotting needs. The goal > > is not to support all the weird and wonderful matplotlib features, if > > you need those you probably work only from script anyway. My approach is > > based on figureoptions.py in matplotlib.backends.qt4_editor (or the more > > recent version in spyder): > > > > 1) Save figure file: > > . get xy data for each plot object > > . get object styles (color of plots, linestyle, etc.) > > . save to auto-generated python script > > > > Later... > > > > 2) Open figure file: > > The script will open a new figure, recreate all objects and then apply > > styles to each object. > > >> You have full control over the figure and its contents again for > editing > > > > Using this approach backwards compatibility should not be a issue (as > > demonstrated by figureoptions). On the other hand not all matplotlib > > objects/options will be supported. > > > > Any comments or suggestions ? > > Implementing anything like this will immediately lead to a stream of > complaints that it doesn't support "all the weird and wonderful > matplotlib features". > > The vector backends are actually doing something like this, but saving > in their respective graphics languages instead of in python. Presumably > some sort of "matplotlib_script" backend could be written, using the pdf > or svg backend as a template. > > Better practice is to use something like the ipython logging facility to > save one's interactive commands, and then manually to edit that down to > a script that creates the desired figure. That way one retains full > control, reproducibility, and documentation of what went into a figure. > > Eric > > Not meaning to resurrect a dead thread, but I would like to point out that Matlab's functionality appears to have been implemented by saving figure components in a .mat file (but called them .fig instead). I have not investigated this any further, but I would wonder just how far-fetched it would be to be able to pickle the artist objects into our own sort of .fig files that we could load up on our own? Just food for thought... Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-06 00:28:20
|
On Thu, Apr 28, 2011 at 1:13 PM, Pau <vim...@go...> wrote: > Hi, > > I am trying to "grep" in 650 data files a row which has a particular > number on column 2, namely " 0.250000000000000E+00 ". > > Alternatively, I could look for that row by searching for the first > column, which is " 1 ". > > Unfortunately, this row changes position in the 650 files and looks like > this: > > ----------- > . > . > . > 4224 0.249999993684469E-04 0.450621747970581E+01 > -0.217168951034546E+01 0.798277109861374E-01 -0.598546504974365E+00 > -0.947211563587189E+00 0.298483103513718E+00 0.694457411766052E+00 > -0.135573709011078E+01 0.500285959243774E+01 0 > 4225 0.249999993684469E-04 0.503941202163696E+01 > -0.236623978614807E+01 -0.171467363834381E+00 -0.204598993062973E+00 > -0.764434099197388E+00 0.354671090841293E+00 0.141895398497581E+00 > -0.693929433822632E+00 0.556993389129639E+01 0 > 4226 0.249999993684469E-04 0.403050041198730E+01 > -0.215032029151917E+01 0.877652913331985E-01 -0.991083562374115E+00 > 0.611193120479584E+00 0.273028463125229E+00 0.364663577079773E+01 > -0.221709823608398E+01 0.456908226013184E+01 0 > 1 0.250000000000000E+00 0.417827463150024E+01 > -0.208329892158508E+01 0.104015089571476E+00 0.154748081695288E-02 > -0.619542039930820E-02 -0.361486850306392E-02 0.216096282005310E+01 > -0.701378881931305E+00 0.467000341415405E+01 0 > 4228 0.249999993684469E-04 -0.348412361145020E+02 > -0.309311046600342E+02 -0.551393890380859E+01 -0.908447951078415E-01 > -0.427876152098179E-01 -0.533953774720430E-02 0.295748591423035E+01 > -0.196792855858803E-01 0.469153327941895E+02 0 > 4229 0.249999993684469E-04 0.427954912185669E+01 > -0.195016658306122E+01 0.785302296280861E-01 0.806781768798828E+00 > -0.110497450828552E+01 -0.624167263507843E+00 0.235030865669250E+01 > -0.216405773162842E+01 0.470360040664673E+01 0 > 4230 0.249999993684469E-04 0.551125669479370E+01 > -0.394835329055786E+01 0.588055849075317E+00 -0.504932820796967E+00 > 0.104279957711697E+00 -0.213553920388222E+00 0.198102459311485E+00 > -0.341262459754944E+00 0.680509042739868E+01 0 > . > . > . > ------------- > > The purpose is to identify the row and then plot the 3rd and 4th > columns once that row has been identified: > > > X_inst = FILE[????:, 2] # Column 3 > Y_inst = FILE[????:, 3] # Column 4 > > My problem is how to define those ???? > > thanks a lot, > > Pau > > This is more of a numpy problem than a matplotlib problem. I would suggest asking on numpy's mailing list. Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-06 00:25:26
|
On Fri, Apr 29, 2011 at 7:18 AM, Musa Gabere <mus...@gm...> wrote: > Hi Everyone, > > I am currently using matplotlib version 0.99 Ubuntu operating system. > > I am plotting a figure whose script is as follows. The figure i get is > usually trimmed off. See the attached > figure. Is there a way to solve this problem? Thanks > > import numpy as np > import matplotlib.pyplot as plt > > > conf_arr = [[33,2,0,0,0,0,0,0,0,1,3], > > > > [3,31,0,0,0,0,0,0,0,0,0], > > > > [0,4,41,0,0,0,0,0,0,0,1], > > > > [0,1,0,30,0,6,0,0,0,0,1], > > > > [0,0,0,0,38,10,0,0,0,0,0], > > > > [0,0,0,3,1,39,0,0,0,0,4], > > > > [0,2,2,0,4,1,31,0,0,0,2], > > > > [0,1,0,0,0,0,0,36,0,2,0], > > > > [0,0,0,0,0,0,1,5,37,5,1], > > > > [3,0,0,0,0,0,0,0,0,39,0], > > > > [0,0,0,0,0,0,0,0,0,0,38]] > > > > norm_conf = [] > for i in conf_arr: > > > a = 0 > tmp_arr = [] > > > a = sum(i, 0) > > > for j in i: > tmp_arr.append(float(j)/float(a)) > > > > norm_conf.append(tmp_arr) > > fig = plt.figure() > > > plt.clf() > ax = fig.add_subplot(111) > > > ax.set_aspect(1) > res = ax.imshow(np.array(norm_conf), cmap=plt.cm.jet, > > > > interpolation='nearest') > > width = len(conf_arr) > > > height = len(conf_arr[0]) > > > for x in xrange(width): > > > for y in xrange(height): > > > ax.annotate(str(conf_arr[x][y]), xy=(x, y), > > > > horizontalalignment='center', > verticalalignment='center') > > > > cb = fig.colorbar(res) > > > alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' > plt.xticks(range(width), alphabet[:width]) > > > > plt.yticks(range(height), alphabet[:height]) > > > plt.savefig('confusion_matrix.png', format='png') > > Musa, I just tested your code with the latest in the development branch, and it appears that whatever bug caused your problem has since been fixed. I don't know when the fix was made, but hopefully it made it into the v1.0.1 release. Cheers, Ben Root |
From: Paul L. <pau...@ii...> - 2011-05-06 00:16:51
|
[Repost from 21 Mar 2011: note suggested patches] Hi all, I am using Matplotlib 1.0.1 and am seeing weird behaviour with mplot3d and ticker formatters, and I think I need to submit a patch to axes3d, but am not sure how much it will break, because format_zdata() and format_coord() look to be defined inconsistently. When trying to rotate a plot, which was created including the following commands, ... ax.plot(x[0,alow:atop],x[1,alow:atop],x[2,alow:atop],c=rgb.tolist()) ax.w_xaxis.set_major_locator(tic.LinearLocator(3)) ax.w_xaxis.set_major_formatter(tic.FormatStrFormatter('')) ax.w_yaxis.set_major_locator(tic.LinearLocator(3)) ax.w_yaxis.set_major_formatter(tic.FormatStrFormatter('')) ax.w_zaxis.set_major_locator(tic.LinearLocator(3)) ax.w_zaxis.set_major_formatter(tic.FormatStrFormatter('')) plt.draw() ... I received the following backtrace and error message: /usr/lib64/python2.6/site-packages/matplotlib/backend_bases.pyc in mouse_move(self, event) 2393 if event.inaxes and event.inaxes.get_navigate(): 2394 -> 2395 try: s = event.inaxes.format_coord(event.xdata, event.ydata) 2396 except ValueError: pass 2397 except OverflowError: pass /usr/lib64/python2.6/site-packages/mpl_toolkits/mplot3d/axes3d.pyc in format_coord(self, xd, yd) 474 475 xs = self.format_xdata(x) --> 476 ys = self.format_ydata(y) 477 zs = self.format_ydata(z) 478 return 'x=%s, y=%s, z=%s' % (xs, ys, zs) /usr/lib64/python2.6/site-packages/mpl_toolkits/mplot3d/axes3d.pyc in format_ydata(self, y) 424 except TypeError: 425 fmt = self.w_yaxis.get_major_formatter() --> 426 return sensible_format_data(fmt, y) 427 428 def format_zdata(self, z): /usr/lib64/python2.6/site-packages/mpl_toolkits/mplot3d/axes3d.pyc in sensible_format_data(self, value) 26 if abs(value) > 1e4 or abs(value)<1e-3: 27 s = '%1.4e' % value ---> 28 return self._formatSciNotation(s) 29 else: 30 return '%4.3f' % value AttributeError: FormatStrFormatter instance has no attribute '_formatSciNotation' --- I am using FormatStrFormatter('') to try to obtain an empty tick. [1] It looks like sensible_format_data() assumes that self is class ScalarFormatter(Formatter), since this is the only ticker Formatter that has attribute _formatSciNotation(s). As far as I can tell, this means that sensible_format_data(fmt,y) should *only* be called if fmt has class ScalarFormatter(Formatter). [2] In axes3d.py, I see: def format_zdata(self, z): """ Return z string formatted. This function will use the attribute self.fmt_zdata if it is callable, else will fall back on the yaxis major formatter """ try: return self.fmt_zdata(z) except (AttributeError, TypeError): fmt = self.w_zaxis.get_major_formatter() return sensible_format_data(fmt, z) To me, it looks like the call to sensible_format_data(fmt, z) is wrong. The same error occurs in format_xdata() and format_ydata(). So I would like to submit a patch for format_xdata(), format_ydata(), format_zdata(), e.g.: def format_zdata(self, z): """ Return z string formatted. This function will use the attribute self.fmt_zdata if it is callable, else will fall back on the zaxis major formatter """ try: return self.fmt_zdata(z) except (AttributeError, TypeError): fmt = self.w_zaxis.get_major_formatter() try: return sensible_format_data(fmt, z) except (AttributeError, TypeError): return format_data(fmt, z) [3] But I am also worried about the comment "else will fall back on the yaxis major formatter". Shouldn't this say "the zaxis major formatter", since that is what the code does? Or should the code use the yaxis major formatter, since that is what the documentation says? The documentation http://matplotlib.github.com/mpl_toolkits/mplot3d/api.html agrees with the comment and not with the code. [4] In def format_coord(self, xd, yd), I see xs = self.format_xdata(x) ys = self.format_ydata(y) zs = self.format_ydata(z) Why doesn't the last line say zs = self.format_zdata(z) ? Best, Paul |
From: Benjamin R. <ben...@ou...> - 2011-05-05 23:59:19
|
On Sun, May 1, 2011 at 4:35 PM, C M <cmp...@gm...> wrote: > I get this error and would like to know what to do to eliminate it and > also what it means: > > C:\Python25\lib\site-packages\matplotlib\axes.py:2571: > UserWarning: Attempting to set identical bottom==top results > in singular transformations; automatically expanding. > bottom=0, top=0 + 'bottom=%s, top=%s') % (bottom, top)) > > This is with Matplotlib 1.0.0. > > Thank you, > Che > > I have seen this happen when the plot is set to use the limits of the data to guide the axes limits, but the data being displayed is either vertical or horizontal. It isn't a huge issue as the code is automatically padding the axes to make take the plot out of "flat world". Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-05 23:53:23
|
On Thu, May 5, 2011 at 6:32 PM, Frederic Vogt <fv...@ms...> wrote: > > As for the roll issue described below : > > how hard would it be to implement something similar to > > tr = Affine2D().scale(2, 1).rotate_deg(30) > > inside mplot3D ? Where should I start ? > > All I want basically is define my viewpoint with 6 parameters (elev, azim, > distance, roll, pitch and yaw), and not just 2 (elev,azim). I know it can > be done interactively, but I want(need) to script it. > > Any suggestions ? > > Fréd > > Fred, Ideally, it should be possible to redefine mplot3d's transformations so that this is possible within matplotlib's current framework... if mplot3d actually used transforms like the rest of matplotlib. Unfortunately, a lot of stuff is hard-coded. You could take a look at the proj3d.py file in matplotlib/lib/mpl_toolkits/mplot3d. The event handling code is in axes3d.py in the same directory. Note that things are a bit of a mess, and if you want to help me out with improving it, I would suggest working off of the master branch on github. I have also been working towards improving matplotlib's transforms framework so that it could one day be capable of handling N-D inputs (right now it assumes 1-D). Once the transforms framework gets improved, then I anticipate getting mplot3d updated to use real transforms, which should make your goal a lot easier. But I don't see that happening for a while now. So, in the meantime, I would welcome any and all patches to improve the current mplot3d code. Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-05 23:34:27
|
On Tue, May 3, 2011 at 3:40 AM, K.-Michael Aye <kmi...@gm...>wrote: > A colleague posed an interesting challenge: > How to do a filled plot having the y-axis in logarithm? > I think I can do it with creating patches myself an adding it to the > axis, but isn't there anything built-in? > > Best regards, > Michael > > > Does fill_between() not work for you? Note, I have never tried it on a log scale plot. Ben Root |
From: Frederic V. <fv...@ms...> - 2011-05-05 23:32:28
|
As for the roll issue described below : how hard would it be to implement something similar to tr = Affine2D().scale(2, 1).rotate_deg(30) inside mplot3D ? Where should I start ? All I want basically is define my viewpoint with 6 parameters (elev, azim, distance, roll, pitch and yaw), and not just 2 (elev,azim). I know it can be done interactively, but I want(need) to script it. Any suggestions ? Fréd On Sun, May 1, 2011 8:26 pm, Frederic Vogt wrote: > Hello, > > I am using the scatter function and axes3D. I can define my viewpoint on > my data points using the elev and azim parameters. But I am looking for > more specification of the viewpoint : namely, I want to roll (i.e. rotate > around the view axis) and offset it (i.e. get sideways, not rotate around > my data points). > > Is there any way to do it ? At the moment, I am using transformation > matrices applied to my data points to reproduce the roll and offset. > Ultimately, I want to rotate and offset both the data points and axis, but > the transformation matrices only impact the data point. > > Hence my question : any way to roll and offset around a viewpoint with > Axes3D ? I don't want to do this interactively, I want to be able to > program it. > > Thanks, and cheers ! > > Fréd > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Benjamin R. <ben...@ou...> - 2011-05-05 23:27:30
|
On Tue, May 3, 2011 at 3:57 AM, Gerald Storer <gd...@mr...> wrote: > Hello, > > I've been trying to animate some plots with the qt backend and run into > a couple of problems. > > Firstly, > I'd like to be able to update the axis limits in an automated fashion as > the data changes size. > > Secondly, > Resizing figures appears to redraw everything _but_ items with the > animation flag. The is causing me problems when the animation is paused > or the frames are occurring slow enough such that there is a noticable > period where the my lines disappear. > > I've sort of solved both of these problems but the solutions seem > hackish. In particular updating the axis limits is slowing the > animation by 25% and toggling the animated field using the qt events > just feels like its asking for trouble. > > Below is the qt animation example with my solutions. Adjust the size of > the plot after the animation finishes to see the effect of the resize > hack. I would be grateful if anyone could suggest some improvements. > > Thanks, > Gerald. > > # For detailed comments on animation and the techniqes used here, see > > # the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations > > import os > > import sys > > #import matplotlib > > #matplotlib.use('Qt4Agg') > > from matplotlib.figure import Figure > > from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as > FigureCanvas > > from PyQt4 import QtCore, QtGui > > ITERS = 100 > > import numpy as np > > import time > > class BlitQT(FigureCanvas): > > def __init__(self): > > FigureCanvas.__init__(self, Figure()) > > self.ax = self.figure.add_subplot(111) > > #self.ax.grid() > > self.draw() > > self.old_size = self.ax.bbox.width, self.ax.bbox.height > > self.ax_background = self.copy_from_bbox(self.ax.bbox) > > self.cnt = 0 > > self.x = np.arange(0,2*np.pi,0.01) > > self.sin_line, = self.ax.plot(self.x, np.sin(self.x), > animated=True) > > self.cos_line, = self.ax.plot(self.x, np.cos(self.x), > animated=True) > > self.draw() > > self.old_limits = self.ax.get_xlim(),self.ax.get_ylim() > > self.tstart = time.time() > > self.maintimer = self.startTimer(10) > > ## HACK for disapearing objects on resize > > def resizeEvent(self,evt): > > super(BlitQT,self).resizeEvent(evt) > > self.sin_line.set_animated(False) > > def paintEvent(self,evt): > > super(BlitQT,self).paintEvent(evt) > > self.sin_line.set_animated(True) > > def timerEvent(self, evt): > > current_size = self.ax.bbox.width, self.ax.bbox.height > > if self.old_size != current_size: > > self.old_size = current_size > > #self.ax.clear() > > #self.ax.grid() > > self.draw() > > self.ax_background = self.copy_from_bbox(self.ax.bbox) > > self.restore_region(self.ax_background) > > # update the data > > > self.sin_line.set_ydata(np.sin(self.x+self.cnt/10.0)*self.cnt/100.0) > > > self.cos_line.set_ydata(np.cos(self.x+self.cnt/10.0)*self.cnt/100.0) > > ## HACK for updating axis limits > > self.ax.relim() > > self.ax.autoscale_view() > > current_limits = self.ax.get_xlim(),self.ax.get_ylim() > > if self.old_limits != current_limits: > > self.old_limits = current_limits > > self.draw() > > self.ax_background = self.copy_from_bbox(self.ax.bbox) > > self.blit(self.figure.bbox) > > > > # just draw the animated artist > > self.ax.draw_artist(self.sin_line) > > self.ax.draw_artist(self.cos_line) > > # just redraw the axes rectangle > > self.blit(self.ax.bbox) > > if self.cnt == 0: > > # TODO: this shouldn't be necessary, but if it is excluded the > > # canvas outside the axes is not initially painted. > > self.draw() > > if self.cnt==ITERS: > > # print the timing info and quit > > print 'FPS:' , ITERS/(time.time()-self.tstart) > > #sys.exit() > > self.killTimer(self.maintimer) > > else: > > self.cnt += 1 > > app = QtGui.QApplication(sys.argv) > > widget = BlitQT() > > widget.show() > > sys.exit(app.exec_()) > > Gerald, I haven't looked at your code, but I would like to point out that if you wish to experiment a little further with animations in matplotlib, there is a animation module that is in the current development branch (but has not been officially released). Maybe using it might help make your code less "hack-ish"? We would also greatly welcome any and all comments on the module before the next release of matplotlib. Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-05 23:22:47
|
On Wed, May 4, 2011 at 11:23 PM, <bu...@gm...> wrote: > redlines.set_visible(False) > > it is also possible to delete the line from ax.lines. > Ex: del ax.lines[-1] deletes the last line. > > you need to perform a redraw for the change to be visible on the plot. > There are more "correct" ways to do this. For example, each artist object comes with a "remove" method: http://matplotlib.sourceforge.net/api/artist_api.html?highlight=remove#matplotlib.artist.Artist.remove So, if you save the lines that you create from the call to plot, you can subsequently remove them at your leisure. Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-05 23:16:51
|
2011/5/4 Sebastian Krieger <seb...@us...> > Dear all, > > I have a small question about subplot. I want to avoid creating plot axes > manually using pylab.axes, to create an asymmetrical arrangement of subplots > like the following code in Matlab: > > figure > subplot(2,2,1:2) > text(.5,.5,'subplot(2,2,1:2)',... > 'FontSize',14,'HorizontalAlignment','center') > subplot(2,2,3) > text(.5,.5,'subplot(2,2,3)',... > 'FontSize',14,'HorizontalAlignment','center') > subplot(2,2,4) > text(.5,.5,'subplot(2,2,4)',... > 'FontSize',14,'HorizontalAlignment','center') > > Reference: http://www.mathworks.com/help/techdoc/ref/subplot.html > > > Is it possible in matplotlib? > > Cheers, > Sebastian > > Sebastian, mpl 1.0.0 came with a powerful gridspec tool for more advanced handling of subplots. Maybe this will be of use to you? http://matplotlib.sourceforge.net/users/gridspec.html?highlight=gridspec Ben Root |
From: Benjamin R. <ben...@ou...> - 2011-05-05 22:24:57
|
On Thursday, May 5, 2011, Alexander Dietz <ale...@go...> wrote: > Hi, > > I have the following situation. I have been following the example to create a 3d surface, as explained here: > > http://matplotlib.sourceforge.net/examples/mplot3d/surface3d_demo2.html > > and I have altered the code slightly to plot a straight red line from the center outside of the sphere (see code at the end of this email). As one can see, the whole line is visible always, no matter how the sphere is turned. Is there a way to 'hide' those parts of the red line, which are 'behind' the blue surface? Like you stick a pencil into an apple and turn the apple, so you can see parts of the pencil, depending on how the apple is rotated (except the part of the pencil inside the apple)? > > If someone can help me with that problem that would be great. > > > Thanks > Alex > > > > > > > from mpl_toolkits.mplot3d import Axes3D > import matplotlib.pyplot as plt > import numpy as np > > fig = plt.figure() > #ax = fig.add_subplot(111, projection='3d') > ax = Axes3D(fig) > > u = np.linspace(0, 2 * np.pi, 100) > v = np.linspace(0, np.pi, 100) > > x = 10 * np.outer(np.cos(u), np.sin(v)) > y = 10 * np.outer(np.sin(u), np.sin(v)) > z = 10 * np.outer(np.ones(np.size(u)), np.cos(v)) > > ax.plot([0,15],[0.0,0.0],'r', lw=4) > > ax.plot_surface(x, y, z, rstride=4, cstride=4, color='b') > > plt.show() > Mplot3d is not a true 3d plotting system. I would recommend mayavi for that. Because mplot3d is a hack to render 3d objects with a 2d rendering system, matplotlib can't get the the layering right. Maybe in the far future this will be changed, but for now, it is a design limitation. Ben |
From: Goyo <goy...@gm...> - 2011-05-05 21:31:25
|
2011/5/5 Chris Rodgers <chr...@be...>: > 1) Is this the intended behavior of matplotlib, or is there something > wrong with my installation? This is by design, hspace and vspace are proportional to the size of each subplot. Also the number of ticks does not depend on the subplot or labels size (using the default locator). So you have to fine tune if things don't fit together. Of course you can write custom subplot-like functions which take care of this the way you find more convenient. I wonder how other plotting packages deal with this. Goyo |
From: Chris R. <chr...@be...> - 2011-05-05 19:59:42
|
Hi Whenever I create figures with at least 3x3 subplots, the x-tick labels overlap with each other and they also overlap with the title of the adjacent subplot, rendering the entire figure illegible. I know that I can fine-tune the plot to look exactly the way I want with "wspace" and "hspace" for instance, but I don't understand why this is the default behavior. I wonder if I have a system font issue, such that matplotlib thinks the fonts are smaller than they really are. My questions: 1) Is this the intended behavior of matplotlib, or is there something wrong with my installation? 2) Assuming I don't have an installation issue, is there a very general parameter I can change so that the overlap doesn't occur, rather than manually adjusting every figure? Minimal code to reproduce the problem: import numpy as np import matplotlib.pyplot as plt plt.figure() plt.subplot(331) plt.subplot(334) plt.plot(np.arange(10000)) plt.title('Title') plt.show() I'm attaching the output figure, although I'm not sure if the list accepts attachments. The x-tick labels on subplot 334 overlap each other, and the title of subplot 334 overlaps with the x-tick labels in subplot 331. System: Ubuntu 10.04 x64 All packages are the stable versions from Synaptic, including ipython, python, numpy, matplotlib 0.99.1.1 I've also tried the Enthought distribution with matplotlib 1.0.1 and the results are the same I've tried both "Wx" and "Tk" backends and the results are the same I've tried `matplotlib.rcParams['xtick.labelsize'] = 'x-small'`, and this does make the labels smaller, but for sufficiently large numbers the overlap still occurs. Thanks for any help! Chris |
From: Chris R. <xro...@gm...> - 2011-05-05 19:54:33
|
Hi Whenever I create figures with at least 3x3 subplots, the x-tick labels overlap with each other and they also overlap with the title of the adjacent subplot, rendering the entire figure illegible. I know that I can fine-tune the plot to look exactly the way I want with "wspace" and "hspace" for instance, but I don't understand why this is the default behavior. I wonder if I have a system font issue, such that matplotlib thinks the fonts are smaller than they really are. My questions: 1) Is this the intended behavior of matplotlib, or is there something wrong with my installation? 2) Assuming I don't have an installation issue, is there a very general parameter I can change so that the overlap doesn't occur, rather than manually adjusting every figure? Minimal code to reproduce the problem: import numpy as np import matplotlib.pyplot as plt plt.figure() plt.subplot(331) plt.subplot(334) plt.plot(np.arange(10000)) plt.title('Title') plt.show() I'm attaching the output figure, although I'm not sure if the list accepts attachments. The x-tick labels on subplot 334 overlap each other, and the title of subplot 334 overlaps with the x-tick labels in subplot 331. System: Ubuntu 10.04 x64 All packages are the stable versions from Synaptic, including ipython, python, numpy, matplotlib 0.99.1.1 I've also tried the Enthought distribution with matplotlib 1.0.1 and the results are the same I've tried both "Wx" and "Tk" backends and the results are the same I've tried `matplotlib.rcParams['xtick.labelsize'] = 'x-small'`, and this does make the labels smaller, but for sufficiently large numbers the overlap still occurs. Thanks for any help! Chris |
From: Alexander D. <ale...@go...> - 2011-05-05 19:37:26
|
Hi, I have the following situation. I have been following the example to create a 3d surface, as explained here: http://matplotlib.sourceforge.net/examples/mplot3d/surface3d_demo2.html and I have altered the code slightly to plot a straight red line from the center outside of the sphere (see code at the end of this email). As one can see, the whole line is visible always, no matter how the sphere is turned. Is there a way to 'hide' those parts of the red line, which are 'behind' the blue surface? Like you stick a pencil into an apple and turn the apple, so you can see parts of the pencil, depending on how the apple is rotated (except the part of the pencil inside the apple)? If someone can help me with that problem that would be great. Thanks Alex from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure() #ax = fig.add_subplot(111, projection='3d') ax = Axes3D(fig) u = np.linspace(0, 2 * np.pi, 100) v = np.linspace(0, np.pi, 100) x = 10 * np.outer(np.cos(u), np.sin(v)) y = 10 * np.outer(np.sin(u), np.sin(v)) z = 10 * np.outer(np.ones(np.size(u)), np.cos(v)) ax.plot([0,15],[0.0,0.0],'r', lw=4) ax.plot_surface(x, y, z, rstride=4, cstride=4, color='b') plt.show() |
From: Goyo <goy...@gm...> - 2011-05-05 18:49:24
|
2011/5/5 Sebastian Krieger <seb...@us...>: > Dear all, > > I have a small question about subplot. I want to avoid creating plot axes > manually using pylab.axes, to create an asymmetrical arrangement of subplots > like the following code in Matlab: > > figure > subplot(2,2,1:2) > text(.5,.5,'subplot(2,2,1:2)',... > 'FontSize',14,'HorizontalAlignment','center') > subplot(2,2,3) > text(.5,.5,'subplot(2,2,3)',... > 'FontSize',14,'HorizontalAlignment','center') > subplot(2,2,4) > text(.5,.5,'subplot(2,2,4)',... > 'FontSize',14,'HorizontalAlignment','center') > > Reference: http://www.mathworks.com/help/techdoc/ref/subplot.html > > Is it possible in matplotlib? Easier done than explained: import matplotlib.pyplot as plt plt.subplot(121) plt.subplot(222) plt.subplot(224) plt.show() Goyo |
From: Michael S. <elm...@gm...> - 2011-05-05 17:57:59
|
Hi Everyone, I have several subplots in one figure, and I'm trying to dynamically display different subplots depending on user input. Everything works fine with the set_visible command, except that I'm running into a problem with shared axes. Basically, I'd like to be able to choose to display subplots (211) and (212) with optionally shared x-axes, and it looks like I either need to find a way to tell add_subplot to not delete overlapping axes *or* to be able to dynamically set axes to share an x-axis My first thought was to create two sets of overlapping axes and set one pair invisible, something like this: f = figure(0) ax1_noshare = f.add_subplot(211) ax2_noshare = f.add_subplot(212) ax1_share = f.add_subplot(211) ax2_share = f.add_subplot(212, sharex=ax1_share) # more code here if show_shared: ax1_noshare.set_visible(False) ax1_noshare.set_visible(False) ax1_share.set_visible(True) ax1_share.set_visible(True) #etc However, the second set of add_subplot(211) calls (to create ax1_share and ax2_share) delete the overlapping axes defined just above, so when I go to set the non-shared axes visible, I get a blank figure. I could, of course, change my code such that I can just optionally set ax2 to share ax1's x-axis, but I'd need a function like: ax2.set_shared_axis(sharex=ax1) which doesn't appear to exist. So my question is, Is it possible to either specify that add_subplot should not delete overlapping axes, or to set a shared axis after the axis has already been created? Thanks, Michael |
From: <bu...@gm...> - 2011-05-05 04:23:35
|
redlines.set_visible(False) it is also possible to delete the line from ax.lines. Ex: del ax.lines[-1] deletes the last line. you need to perform a redraw for the change to be visible on the plot. <quote author="Mathew Yeates-4"> Hi I've added some lines with ax.add_line(yellowlines) ax.add_line(redlines) how can I remove the lines without completely redrawing everything? -Mathew |
From: Sebastian K. <seb...@us...> - 2011-05-05 02:09:10
|
Dear all, I have a small question about subplot. I want to avoid creating plot axes manually using pylab.axes, to create an asymmetrical arrangement of subplots like the following code in Matlab: figure subplot(2,2,1:2) text(.5,.5,'subplot(2,2,1:2)',... 'FontSize',14,'HorizontalAlignment','center') subplot(2,2,3) text(.5,.5,'subplot(2,2,3)',... 'FontSize',14,'HorizontalAlignment','center') subplot(2,2,4) text(.5,.5,'subplot(2,2,4)',... 'FontSize',14,'HorizontalAlignment','center') Reference:http://www.mathworks.com/help/techdoc/ref/subplot.html Is it possible in matplotlib? Cheers, Sebastian -- *Sebastian Krieger, M.Sc.* Laboratório de Oceanografia por Satélites Instituto Oceanográfico -- Universidade de São Paulo Praça do Oceanográfico, 191 -- São Paulo, SP -- 05508-120 -- Brasil Cel.: +55 (11) 9241-5606 -- Tel.: +55 (11) 3091-6575 -- Skype: regeirk Www: los.io.usp.br <http://los.io.usp.br> -- E-mail: seb...@us... <mailto:seb...@us...> Currículo Lattes: lattes.cnpq.br/3216430385408182 <http://lattes.cnpq.br/3216430385408182%20> |
From: Pythonified <net...@gm...> - 2011-05-05 01:51:24
|
I have been trying to assign different colors for each line I plot, where the colors are incrementally darkened (or lightened), or selected from a colorbar (e.g. rainbow). Any ideas? -- View this message in context: http://old.nabble.com/incremental-colors-for-lines-tp31546719p31546719.html Sent from the matplotlib - users mailing list archive at Nabble.com. |