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

Showing 3 results of 3

From: Russell E. O. <ro...@uw...> - 2013年11月22日 22:12:08
We have code that ran fine in 1.1.1 that raises an exception in colorbar 
in 1.2.1 and 1.3.1. I have appended an example; I'm afraid it is rather 
extreme, but we have seen this for arrays that have more than one 
non-masked values as well, even with the values not all being equal.
Should I report this as a bug? Should we guard all our calls to colormap 
with try/except, or perhaps there's a flag we can set that says "do your 
best"? (But I don't see anything like that in the docs).
-- Russell
 cmap = getattr(cm, cmap)
 cmap.set_bad('k', 0.2)
 if cmapOver is not None:
 cmap.set_over(cmapOver, 1.0)
 if cmapUnder is not None:
 cmap.set_under(cmapUnder, 1.0)
 p = PatchCollection(patches, norm=norm, cmap=cmap)
 value_array = numpy.array(values)
 masked_value_array = 
numpyMa.masked_where(numpy.isnan(value_array), value_array)
 p.set_array(masked_value_array)
 cb = self.fig.colorbar(p)
 File 
"/nfs/lsst/home/rowen/code/testing_pipeQA/python/lsst/testing/pipeQA/figu
res/FpaQaFigure.py", line 317, in makeFigure
 cb = self.fig.colorbar(p)
 File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/figure.py
", line 1451, in colorbar
 cb = cbar.colorbar_factory(cax, mappable, **kw)
 File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 1274, in colorbar_factory
 cb = Colorbar(cax, mappable, **kwargs)
 File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 877, in __init__
 ColorbarBase.__init__(self, ax, **kw)
 File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 317, in __init__
 self.draw_all()
 File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 342, in draw_all
 self._config_axes(X, Y)
 File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 433, in _config_axes
 self.update_ticks()
 File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 367, in update_ticks
 ticks, ticklabels, offset_string = self._ticker()
 File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 580, in _ticker
 ticks = self._locate(b)
 File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 829, in _locate
 z = np.take(y, i0) + (xn - np.take(b, i0)) * dy / db
FloatingPointError: invalid value encountered in divide
Where masked_value_array=[-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
-- -- -- -- -- -- -- -- -- --
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 0.7598040968345164 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--]
From: Russell E. O. <ro...@uw...> - 2013年11月22日 22:01:12
In article <528...@st...>,
 Michael Droettboom <md...@st...> 
 wrote:
> When you use |--home|, distutils assumes you are referring to a home 
> directory in which you have a tree of libraries in |lib|lib64| living 
> there, so it appends |lib64/python| to the given path:
> 
> |> python setup.py install --home=/foo
> running install
> Checking .pth file supportin /foo/lib64/python/
> error: can't create or remove files in install directory|
> 
> So the issue is not that your PYTHONPATH doesn't contain 
> |/lsst/home/rowen/code/sandbox/Linux64/external/matplotlib/1.3.1+1| 
> (which it does) but that it doesn't contain 
> |/lsst/home/rowen/code/sandbox/Linux64/external/matplotlib/1.3.1+1/lib/python|
> |.
> 
> With matplotlib 1.2.1, we used raw distutils and not setuptools, which 
> does the same thing without the strict check. And that does allow users 
> to shoot themselves in the foot, since the check is in fact right when 
> it says things won't work:
> 
> |> git checkout v1.2.1
> > mkdir ~/foo
> > python setup.py install --home=~/foo
> ...
> > PYTHONPATH=~/foo python
> Python2.7.5 (default, Oct8 2013,12:19:40)
> [GCC4.8.1 20130603 (Red Hat4.8.1-1)] on linux2
> Type"help","copyright","credits" or "license" for more information.
> >>>import matplotlib
> Traceback (most recent call last):
> File"<stdin>", line1,in <module>
> ImportError: No module named matplotlib|
> 
> I think what you really want to use is |--install-lib|, which will 
> install the matplotlib library directly inside of the given path, which 
> (if it's also on the `PYTHONPATH`) it will work.
Thank you. That did it!
For the record, we do actually want the files in <path>/lib/python. So I 
fixed it by manually adding <path>/lib/python to PYTHONPATH before 
running the installer.
It would help if the error message showed which path was expected to be 
on the PYTHONPATH, but now that I know I'm happy.
-- Russell
From: Eric L. <lar...@gm...> - 2013年11月22日 19:56:52
Just wanted to let people know that I chased down the problem I was having.
The command I was using was working, but I wrongly assumed the coordinate
system was normalized for some reason. Doing things like:
fig.canvas.button_press_event(110, 240, 1, False, None)
works great!
Cheers,
Eric
On Thu, Nov 21, 2013 at 9:52 AM, Eric89GXL <lar...@gm...> wrote:
> Hello,
>
> I have some some matplotlib code that we use for interactive plotting, and
> I
> want to do non-interactive unit testing. This means I need to emulate
> keypresses and mouse clicks.
>
> It is simple enough to do keypress unit testing by using:
>
> fig.canvas.key_press_event('down')
>
> This for example allows us to test that pressing "down" in a figure window
> elicits the appropriate behavior.
>
> However, I am having difficulty testing mouse clicks. We have behaviors
> where users can click within an axis (e.g., fix.axes[1]) to elicit some
> behavior. I have tried the following:
>
> fig.canvas.button_press_event(0.5, 0.5, 1)
>
> But within the event handler (which generally has structure
> _mouse_click(event, params)), the "event" object does not have the
> "event.inaxes" field populated correctly (it is always "None") despite my
> emulated click @ (0.5, 0.5) sitting within one of the axes in the figure.
>
> Does anyone know how to emulate either of these types of clicks?
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/Emulating-keypress-and-mouse-clicks-tp42534.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up
> now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

Showing 3 results of 3

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 によって変換されたページ (->オリジナル) /