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






Showing 10 results of 10

From: Damon M. <dam...@gm...> - 2012年09月21日 21:10:54
On Friday, September 21, 2012, Benjamin Root wrote:
> Note: please use "Reply-All" to make sure the mailing list continues to
> get this thread.
>
> Could you do a "uname -a" at the command-line and give us that output? I
> was not aware that Apple shipped any 32-bit machines anymore.
>
> Ben Root
>
> ---------- Forwarded message ----------
> From: Ranjit Chacko <ra...@ge... <javascript:_e({}, 'cvml',
> 'ra...@ge...');>>
> Date: Fri, Sep 21, 2012 at 2:55 PM
> Subject: Re: [Matplotlib-users] install problem on OSX 10.8
> To: Benjamin Root <ben...@ou... <javascript:_e({}, 'cvml',
> 'ben...@ou...');>>
>
>
> I'm just cloned the repo from master yesterday, and I tried running the
> following script:
> NAME=matplotlib
> VERSION=v1.1.x
> PREFIX=$HOME
> cd matplotlib
> export LDFLAGS="-Os -arch i386 -L/usr/X11/lib"
> export CFLAGS="-Os -arch i386 -I/usr/X11/include
> -I/usr/X11/include/freetype2 -I/usr/X11/include/libpng12"
> export PKG_CONFIG_PATH="/usr/X11/lib/pkgconfig"
> export ARCHFLAGS="-arch i386"
> python setup.py build
> # use --prefix if you don't want it installed in the default location:
> python setup.py install #--prefix=$PREFIX
> cd ..
>
> Thanks,
>
> -Ranjit
>
>
I'm not sure 10.8 supports 32-bit machines at all. Apple even dropped
support for some 64-bit machines in the 10.8 release.
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Andrea G. <and...@gm...> - 2012年09月21日 19:11:14
Hi Eric, All,
On 21 September 2012 15:46, Moore, Eric (NIH/NIDDK) [F] wrote:
>> -----Original Message-----
>> From: Andrea Gavana [mailto:and...@gm...]
>> Sent: Wednesday, September 19, 2012 11:09 AM
>> To: mat...@li...
>> Subject: [Matplotlib-users] Image as marker and axes "equal" aspect
>> ratio
>>
>> Hi All,
>>
>> I am currently trying to plot 4 points (but they will be more, in
>> an animated sequence later), and I am trying to use an image as a point
>> marker. I am using the axes transData transform to get the point
>> coordinates from the data world to the display world.
>>
>> Everything seems to be working OK (i.e., the images are placed
>> correctly close to the plot points); however, as soon as I try to force
>> the axes into an "equal" aspect ratio with this command:
>>
>> ax.set_aspect('equal')
>>
>> Then all the calculations are messed up and the images end up very far
>> from the plot points. I have tried also the approach mentioned in this
>> StackOverflow post:
>>
>> http://stackoverflow.com/questions/2318288/how-to-use-custom-marker-
>> with-plot
>>
>> But I get the same wrong answer when I set the "equal" aspect ratio for
>> the axes.
>>
>> I am attaching a small sample application which demonstrates the
>> problem, a small "smiley.png" image needed to run the script and two
>> plots generated by my script, one with the "equal" aspect ratio and the
>> other without.
>>
>> I appreciate any suggestion, as I feel I am missing something
>> important...
>>
> The source of the problem is that the transformation you are using has not been updated to account for your set_aspect call. I played around a little bit, but I'm not sure how to force mpl to update the transform. Perhaps someone else can comment. This is a very fragile way to do things anyway because figimage places the image in screen coordinates and you really would like to place it relative to the axis.
Thank you for your answer and for taking the time to play with the
sample I posted. I know that using figimage is not exactly the best
way to go, but I can only think of two other approaches:
1) Use imshow: from the documentation, it appears to me that you can't
place an image wherever you want, and I was unable to find any example
on how to use imshow to place multiple images in a specific place
inside the axes;
2) Use scatter: again, from the docs it seems that scatter supports
symbols, mathtext, paths and regular polygons, but no images...
I may of course be wrong about the above statements, and again I
welcome any suggestion you may have.
Thank you.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
From: Benjamin R. <ben...@ou...> - 2012年09月21日 19:02:25
Note: please use "Reply-All" to make sure the mailing list continues to get
this thread.
Could you do a "uname -a" at the command-line and give us that output? I
was not aware that Apple shipped any 32-bit machines anymore.
Ben Root
---------- Forwarded message ----------
From: Ranjit Chacko <ra...@ge...>
Date: Fri, Sep 21, 2012 at 2:55 PM
Subject: Re: [Matplotlib-users] install problem on OSX 10.8
To: Benjamin Root <ben...@ou...>
I'm just cloned the repo from master yesterday, and I tried running the
following script:
NAME=matplotlib
VERSION=v1.1.x
PREFIX=$HOME
cd matplotlib
export LDFLAGS="-Os -arch i386 -L/usr/X11/lib"
export CFLAGS="-Os -arch i386 -I/usr/X11/include
-I/usr/X11/include/freetype2 -I/usr/X11/include/libpng12"
export PKG_CONFIG_PATH="/usr/X11/lib/pkgconfig"
export ARCHFLAGS="-arch i386"
python setup.py build
# use --prefix if you don't want it installed in the default location:
python setup.py install #--prefix=$PREFIX
cd ..
Thanks,
-Ranjit
From: Benjamin R. <ben...@ou...> - 2012年09月21日 18:53:54
On Fri, Sep 21, 2012 at 2:19 PM, Ranjit Chacko <ra...@ge...> wrote:
> I'm having some trouble compiling matplotlib, and I'm not sure how to fix
> it. Does anyone have any advice on how to proceed given the following
> traceback?
>
> Thanks,
>
> -Ranjit
>
>
Which version of matplotlib? How are you building it (i.e., what set of
directions are you following)?
Ben Root
From: Damon M. <dam...@gm...> - 2012年09月21日 18:50:47
On Friday, September 21, 2012, Michael Rawlins wrote:
>
> After the build, I determined that 'install' was also needed.
>
> > python setup.py install
>
> completed with no errors. OK, finally built and installed. But now my
> matplotlib script gives this error:
>
> Traceback (most recent call last):
> File "map_PrcpBias_Northeast.py", line 21, in <module>
> from netCDF4 import Dataset as NetCDFFile
> ImportError: /usr/local/lib/python2.7/dist-packages/netCDF4.so: undefined
> symbol: nc_inq_var_endian
>
>
> So, checking shared library dependencies:
>
> > ldd /usr/local/lib/python2.7/dist-packages/netCDF4.so
>
> linux-gate.so.1 => (0xb776a000)
> libnetcdf.so.7 => /usr/local/lib/libnetcdf.so.7 (0xb7604000)
> libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb75d3000)
> libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb742d000)
> libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7401000)
> /lib/ld-linux.so.2 (0xb776b000)
>
> and
>
> > ldd /usr/local/lib/libnetcdf.so.7
>
> linux-gate.so.1 => (0xb7765000)
> libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7663000)
> libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb74be000)
> /lib/ld-linux.so.2 (0xb7766000)
>
> no libhdf5 there. Can this be fixed?
>
> MR
>
>
>
>
>From what I remember dealing with the netcdf c library, you have to
explicitly set a compile flag to enable hdf5 support. That was a while ago,
though. I'm not sure if things have changed.
Hope this helps.
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Ranjit C. <ra...@ge...> - 2012年09月21日 18:49:27
I'm having some trouble compiling matplotlib, and I'm not sure how to fix
it. Does anyone have any advice on how to proceed given the following
traceback?
Thanks,
-Ranjit
building 'matplotlib.ft2font' extension
gcc -DNDEBUG -g -fwrapv -O3 -Wall -Os -I/usr/X11/include
-I/usr/X11/include/freetype2 -I/usr/X11/include/libpng12 -arch i386
-DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1
-I/usr/local/include -I/usr/include -I/usr/X11/include
-I/opt/getaround/lib/python2.7/site-packages/numpy/core/include
-I/usr/local/include -I/usr/include -I/usr/X11/include -I.
-I/usr/local/include/freetype2 -I/usr/include/freetype2
-I/usr/X11/include/freetype2
-I/opt/getaround/lib/python2.7/site-packages/numpy/core/include/freetype2
-I/usr/local/include/freetype2 -I/usr/include/freetype2
-I/usr/X11/include/freetype2 -I./freetype2
-I/opt/getaround/include/python2.7 -c src/ft2font.cpp -o
build/temp.macosx-10.4-i386-2.7/src/ft2font.o
src/ft2font.cpp: In instantiation of ‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/ft2font.cpp:854: instantiated from here
src/ft2font.cpp:854: error: explicit instantiation of
‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition
available
src/ft2font.cpp: In instantiation of ‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/ft2font.cpp:854: instantiated from here
src/ft2font.cpp:854: error: explicit instantiation of
‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition
available
src/ft2font.cpp: In instantiation of ‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/ft2font.cpp:854: instantiated from here
src/ft2font.cpp:854: error: explicit instantiation of
‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition
available
src/ft2font.cpp: In instantiation of ‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/ft2font.cpp:854: instantiated from here
src/ft2font.cpp:854: error: explicit instantiation of
‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition
available
src/ft2font.cpp: In instantiation of ‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/ft2font.cpp:854: instantiated from here
src/ft2font.cpp:854: error: explicit instantiation of
‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition
available
error: command 'gcc' failed with exit status 1
On Wed, Sep 19, 2012 at 9:14 AM, Fabien Lafont <laf...@gm...>wrote:
> Actually I want to try to plot something like this picture:
>
> http://physics.aps.org/assets/d88621a594e78eea
>
> With a color for inside and another for outside.
>
>
Probably not to the level of control one may wish to have, but one can
achieve shading effects assuming a light source. plot_surface() can assume
a light source for you, or you could provide one IIRC. This isn't very
well documented (in fact, it is downright non-existent!).
The most simple way of getting something like what you want is to set
shade=True and not use a colormap. This shades the surface according to
the normal vector to the surface.
One can also provide a "lightsource". I just noticed this is not
documented. One can specify a "lightsource" kwarg to plot_surface (note
that shade must be set to True, a cmap must be provided, and oddly enough,
facecolors has to be not None (this might be a bug)), and a colorbar won't
work (seem to throw an exception...). By default (i.e., lightsource=None),
a matplotlib.color.LightSource object with azdeg=135 and altdeg=55 is used
to shade based on the data and colormap. You can provide your own light
source to achieve the effect you would like by positioning it properly
(don't ask me how, I never played with that part).
I know this was kind of vague, but I hope it is at least somewhat
illuminating.
Cheers!
Ben Root
From: Michael R. <raw...@ya...> - 2012年09月21日 14:31:07
After the build, I determined that 'install' was also needed.
> python setup.py install
completed with no errors. OK, finally built and installed. But now my matplotlib script gives this error:
Traceback (most recent call last):
 File "map_PrcpBias_Northeast.py", line 21, in <module>
  from netCDF4 import Dataset as NetCDFFile 
ImportError: /usr/local/lib/python2.7/dist-packages/netCDF4.so: undefined symbol: nc_inq_var_endian
So, checking shared library dependencies:
> ldd /usr/local/lib/python2.7/dist-packages/netCDF4.so
  linux-gate.so.1 => (0xb776a000)
  libnetcdf.so.7 => /usr/local/lib/libnetcdf.so.7 (0xb7604000)
  libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb75d3000)
  libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb742d000)
  libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7401000)
  /lib/ld-linux.so.2 (0xb776b000)
and
> ldd /usr/local/lib/libnetcdf.so.7
  linux-gate.so.1 => (0xb7765000)
  libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7663000)
  libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb74be000)
  /lib/ld-linux.so.2 (0xb7766000)
no libhdf5 there. Can this be fixed?
MR
From: Moore, E. (NIH/N. [F] <eri...@ni...> - 2012年09月21日 13:47:33
> -----Original Message-----
> From: Andrea Gavana [mailto:and...@gm...]
> Sent: Wednesday, September 19, 2012 11:09 AM
> To: mat...@li...
> Subject: [Matplotlib-users] Image as marker and axes "equal" aspect
> ratio
> 
> Hi All,
> 
> I am currently trying to plot 4 points (but they will be more, in
> an animated sequence later), and I am trying to use an image as a point
> marker. I am using the axes transData transform to get the point
> coordinates from the data world to the display world.
> 
> Everything seems to be working OK (i.e., the images are placed
> correctly close to the plot points); however, as soon as I try to force
> the axes into an "equal" aspect ratio with this command:
> 
> ax.set_aspect('equal')
> 
> Then all the calculations are messed up and the images end up very far
> from the plot points. I have tried also the approach mentioned in this
> StackOverflow post:
> 
> http://stackoverflow.com/questions/2318288/how-to-use-custom-marker-
> with-plot
> 
> But I get the same wrong answer when I set the "equal" aspect ratio for
> the axes.
> 
> I am attaching a small sample application which demonstrates the
> problem, a small "smiley.png" image needed to run the script and two
> plots generated by my script, one with the "equal" aspect ratio and the
> other without.
> 
> I appreciate any suggestion, as I feel I am missing something
> important...
> 
> Thank you in advance.
> 
> 
> Andrea.
> 
> "Imagination Is The Only Weapon In The War Against Reality."
> http://xoomer.alice.it/infinity77/
> 
> # ------------------------------------------------------------- # def
> ask_mailing_list_support(email):
> 
> if mention_platform_and_version() and include_sample_app():
> send_message(email)
> else:
> install_malware()
> erase_hard_drives()
> # ------------------------------------------------------------- #
Andrea, 
The source of the problem is that the transformation you are using has not been updated to account for your set_aspect call. I played around a little bit, but I'm not sure how to force mpl to update the transform. Perhaps someone else can comment. This is a very fragile way to do things anyway because figimage places the image in screen coordinates and you really would like to place it relative to the axis.
Eric 
From: Benjamin R. <ben...@ou...> - 2012年09月21日 01:46:32
On Thursday, September 20, 2012, Brian J Mingus wrote:
> Hi all,
>
> I have managed to create a 3d plot with uneven aspect ratio via
> auto_scale_xyz but I haven't yet figured out how to fix the grid. If you
> could give me a pointer I would appreciate it.
>
> http://imagebin.org/index.php?mode=image&id=229196
>
> Thanks,
>
>
Brian,
Just today, I submitted a PR that involved extensive fixes to autoscaling
in mplot3d. I don't have the PR number on me, but it should be easy to
find on the github page. While I don't think it will fix much for you, I
would be interested to know if it breaks your code.
As for your issues, it is hard to help out without a code sample to see how
you got to where you are. Did you happen to use my experimental daspect
branch?
Cheers!
Ben Root
>
>

Showing 10 results of 10

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