SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S






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






Showing 6 results of 6

From: <jk...@ik...> - 2007年09月03日 22:21:03
Johann Cohen-Tanugi <co...@sl...> writes:
> I would like to know if there is an easy to invert a axis (specifically 
> the x-axis), id est to have the labels between say 0 an1 automatically 
> run from right to left.
setp(gca(), 'xlim', reversed(getp(gca(), 'xlim')))
i.e., just put the larger limit before the smaller one.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Johann Cohen-T. <co...@sl...> - 2007年09月03日 21:52:23
hello,
I would like to know if there is an easy to invert a axis (specifically 
the x-axis), id est to have the labels between say 0 an1 automatically 
run from right to left. This is particularly welcome in astrophysical 
context, where the spherical x coordinate of a 2D image is often reversed.
thanks,
Johann
From: Eric F. <ef...@ha...> - 2007年09月03日 18:25:20
Attachments: colorbar_only.py
Jose,
Attached is an example that should at least point you in the right 
direction. I will also add it to the examples directory in the 
distribution.
Eric
Jose Gomez-Dans wrote:
> Hi,
> I am using Matplotlib to produce colormaps which I use with other
> programs. I would like to produce a PNG file with the used colormap
> (so that I can overlay). Rather than doing an imshow(<something>)
> followed by colorbar, is there an easy way I could pass the colorbar
> my cmap instance to have it plotted on its own? In essence, what I
> want to do is to do a savefig, and get something along the lines of
> what is shown here: <http://www.igidl.ul.pt/colorscale.gif>. I will
> need to change the scale (i.e.,, the numbers :D) with each run.
> 
> So far, I have "cut+pasted" from a whole image, which is hardly convenient! :(
> 
> Cheers,
> Jose
From: <jk...@ik...> - 2007年09月03日 16:41:40
Xavier Gnata <gn...@ob...> writes:
> I do not know if we should post bug reports against matplotlib svn. 
Posting bug reports is likely to be helpful, but I suspect the
developers' list might be more appropriate for bugs in the svn version.
For bugs in released versions, I think John has told people to file a
bug in the Sourceforge tracker and also send a message to the mailing
list.
> Anyway, imshow is now fully broken this way :
[...]
> --> 200 w, h, d = renderer.get_text_width_height_descent(
> ValueError: need more than 2 values to unpack
It's not in imshow really, but in the usetex branch of
get_text_width_height_descent in the agg backend. I fixed the immediate
problem, though baseline alignment is unlikely to work with usetex as of
now.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Xavier G. <gn...@ob...> - 2007年09月03日 15:57:51
Hi,
I do not know if we should post bug reports against matplotlib svn. 
Please tell us.
Anyway, imshow is now fully broken this way :
imshow(ones((100,100)))
/usr/lib/python2.4/site-packages/matplotlib/pylab.py in imshow(*args, 
**kwargs)
 1960 try:
 1961 ret = gca().imshow(*args, **kwargs)
-> 1962 draw_if_interactive()
 1963 except:
 1964 hold(b)
/usr/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py in 
draw_if_interactive()
 56 figManager = Gcf.get_active()
 57 if figManager is not None:
---> 58 figManager.show()
 59
 60
/usr/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py in 
show(self)
 350 if sys.platform=='win32' : self.window.update()
 351 else:
--> 352 self.canvas.draw()
 353 self._shown = True
 354
/usr/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py in 
draw(self)
 189
 190 def draw(self):
--> 191 FigureCanvasAgg.draw(self)
 192 tkagg.blit(self._tkphoto, self.renderer._renderer, 
colormode=2)
 193 self._master.update_idletasks()
/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py in 
draw(self)
 381
 382 self.renderer = self.get_renderer()
--> 383 self.figure.draw(self.renderer)
 384
 385 def get_renderer(self):
/usr/lib/python2.4/site-packages/matplotlib/figure.py in draw(self, 
renderer)
 610
 611 # render the axes
--> 612 for a in self.axes: a.draw(renderer)
 613
 614 # render the figure text
/usr/lib/python2.4/site-packages/matplotlib/axes.py in draw(self, 
renderer, inframe)
 1336
 1337 for zorder, i, a in dsu:
-> 1338 a.draw(renderer)
 1339
 1340 self.transData.thaw() # release the lazy objects
/usr/lib/python2.4/site-packages/matplotlib/axis.py in draw(self, 
renderer, *args, **kwargs)
 588 tick.set_label1(label)
 589 tick.set_label2(label)
--> 590 tick.draw(renderer)
 591 if tick.label1On and tick.label1.get_visible():
 592 extent = tick.label1.get_window_extent(renderer)
/usr/lib/python2.4/site-packages/matplotlib/axis.py in draw(self, renderer)
 168 if self.tick2On: self.tick2line.draw(renderer)
 169
--> 170 if self.label1On: self.label1.draw(renderer)
 171 if self.label2On: self.label2.draw(renderer)
 172
/usr/lib/python2.4/site-packages/matplotlib/text.py in draw(self, renderer)
 773 def draw(self, renderer):
 774 self.update_coords(renderer)
--> 775 Text.draw(self, renderer)
 776 if self.get_dashlength() > 0.0:
 777 self.dashline.draw(renderer)
/usr/lib/python2.4/site-packages/matplotlib/text.py in draw(self, renderer)
 315 angle = self.get_rotation()
 316
--> 317 bbox, info = self._get_layout(renderer)
 318 trans = self.get_transform()
 319 if rcParams['text.usetex']:
/usr/lib/python2.4/site-packages/matplotlib/text.py in _get_layout(self, 
renderer)
 198 baseline = None
 199 for line in lines:
--> 200 w, h, d = renderer.get_text_width_height_descent(
 201 line, self._fontproperties, 
ismath=self.is_math_text(line))
 202 if baseline is None:
ValueError: need more than 2 values to unpack
I have tried both Tk and GTKagg backends with the same result.
Xavier.
-- 
############################################
Xavier Gnata
CRAL - Observatoire de Lyon
9, avenue Charles André
69561 Saint Genis Laval cedex
Phone: +33 4 78 86 85 28
Fax: +33 4 78 86 83 86
E-mail: gn...@ob...
############################################ 
From: Jose Gomez-D. <jgo...@gm...> - 2007年09月03日 13:41:30
Hi,
I am using Matplotlib to produce colormaps which I use with other
programs. I would like to produce a PNG file with the used colormap
(so that I can overlay). Rather than doing an imshow(<something>)
followed by colorbar, is there an easy way I could pass the colorbar
my cmap instance to have it plotted on its own? In essence, what I
want to do is to do a savefig, and get something along the lines of
what is shown here: <http://www.igidl.ul.pt/colorscale.gif>. I will
need to change the scale (i.e.,, the numbers :D) with each run.
So far, I have "cut+pasted" from a whole image, which is hardly convenient! :(
Cheers,
Jose

Showing 6 results of 6

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





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

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

More information about our ad policies

Ad destination/click URL:

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