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





Showing 5 results of 5

From: Jody K. <jk...@uv...> - 2013年09月25日 22:15:42
	
Hi all,
I am trying to make 3-D "curtain" plots. Basically, x,y are N-vectors, z is an M-vector, and C is MxN data set collected on the path with z. Application is a ship's track through the ocean. I also want to be able to contour a second variable C2 also MxN. I know how to do that, but the example below just uses plot3D, because thats how I do the curtain contouring. 
If I plot three such "curtains" they look OK, including the magenta line in each. 
If I plot a fourth, the magenta line is obscured by the curtain, and so on for more curtains.
Any clue what the problem is? The code for this example is below, and I think is self contained, plus or minus running in pylab.
Thanks, Jody
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
n=0
fig = figure()
for Nn in array([3,4]):
 n=n+1
 ax = fig.add_subplot(2,1,n,projection='3d')
 for off in arange(0,Nn*2,2)*50.:
 
 x = np.arange(-5, 5, .5)
 y = np.arange(-5, 5, .5)
 Z = np.arange(0,200,1)
 Z=np.tile(np.reshape(Z,(200,1)),(1,size(y)))
 X = np.tile(y,(200,1))
 Y = np.tile(y,(200,1))
 
 N = X*Y*Z
 N = N/N.max() # normalize 0..1
 surf = ax.plot_surface(
 X+off, Y, Z, rstride=20, cstride=4,
 facecolors=cm.jet(N),
 linewidth=0, antialiased=False, shade=False,alpha=0.9)
 ax.plot(x+off+0.001,y,(y+5)*25.,'m')
 ax.set_xlim([-50,350])
 ax.set_ylim([-8.,8.])
 fig.savefig('doc/bad3dslices.png',res=72)
--
Jody Klymak 
http://web.uvic.ca/~jklymak/
From: Chao Y. <cha...@gm...> - 2013年09月25日 09:36:02
Hi,
I met with a problem using Python to draw graphs. Compare the
following two scripts and attached graphs. For the first one, the left
edge of the colorbar is white. It seems that only when I use
norm=LogNorm() the problem happens. Does anyone know how to solve it?
Thanks!
python1:
from mpl_toolkits.basemap import cm
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LogNorm
data = np.tile(np.logspace(-12,0,num=13),(13,1))
print data[0]
bounds = data[0][2:-2]
print bounds
fig,ax=plt.subplots()
im = ax.imshow(data,vmin=bounds[0],vmax=bounds[-1],norm=LogNorm(),cmap
= cm.GMT_seis_r)
cb=fig.colorbar(im,ax=ax,\
 extend='both',\
 ticks=bounds,\
 #default, can be omitted
 drawedges=False,\
 shrink=0.6,\
 orientation='horizontal',\
 pad=0.02)
plt.show()
python2:
from mpl_toolkits.basemap import cm
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LogNorm
data = np.tile(np.arange(-12,0),(13,1))
print data[0]
bounds = data[0][2:-2]
print bounds
fig,ax=plt.subplots()
im = ax.imshow(data,vmin=bounds[0],vmax=bounds[-1],cmap = cm.GMT_seis_r)
cb=fig.colorbar(im,ax=ax,\
 extend='both',\
 ticks=bounds,\
 #default, can be omitted
 drawedges=False,\
 shrink=0.6,\
 orientation='horizontal',\
 pad=0.02)
plt.show()
Chao
-- 
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
From: roman3217 <dav...@no...> - 2013年09月25日 09:06:24
Hello, 
I did a mistake in my previous post.
The correct xlC that I created :
#!/bin/bash
parameters=$(echo $* | sed s/'-l '/''/g)
Modules/ld_so_aix $parameters -lC -ltcl -ltk
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Problem-with-matplotlib-under-aix-6-1-tp42093p42096.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: vwf <vw...@vu...> - 2013年09月25日 08:31:28
On Tue, Sep 24, 2013 at 03:46:52PM -0700, Jody Klymak wrote: [...]
> 
> 2) Can I suggest this example be added to the tutorial?
> http://stackoverflow.com/questions/6539944/color-matplotlib-plot-surface-command-with-surface-gradient
> None of the other examples explain how to colour your surface with
> data, which is what I wanted. 
> 
> 3) I think plot_surface should accept a fourth (optional) argument C
> for colouring the faces: plot_surface(X,Y,Z,C). I do this a lot if I
> want to make a 3-D plot, and normalizing C, clipping it, and indexing
> a colormap seem clunky, when the routine could do it for me. 
> 
I largely agree. I spend many days to get my plots and posted a few
times on this list e.g.
Subject: Re: [Matplotlib-users] how to create a facecolors map?
Date: 2013年8月29日 09:24:40
Better documetation would be very nice; please provide example code.
And a remark about that: most exemples show functions with symmetry.
This can be confusing when coloring and other techniques are applied.
PS. Please cut down the original message before replying.
From: David R. <Dav...@no...> - 2013年09月25日 08:31:19
hello,
Sorry for my poor english.
I have a big problem with matplotlib under AIX6.1.
My configuration :
OS : AIX 6.1
XLC : 12.1.0.0
Python 2.7.5-1
I installed Python and all dependencies from www.oss4aix.org/download/RPMS with the rpm files.
This is the all packages that I installed:
rpm -ivh gcc/libgcc-4.4.7-1.aix6.1.ppc.rpm
rpm -ivh libffi/libffi-3.0.13-1.aix5.1.ppc.rpm
rpm -ivh libffi/libffi-devel-3.0.13-1.aix5.1.ppc.rpm
rpm -ivh expat/expat-2.1.0-1.aix5.1.ppc.rpm
rpm -ivh expat/expat-devel-2.1.0-1.aix5.1.ppc.rpm
rpm -ivh libiconv/libiconv-1.14-2.aix5.1.ppc.rpm glib2/glib2-2.36.3-1.aix5.1.ppc.rpm gettext/gettext-0.17-1.aix5.1.ppc.rpm --nodeps (missing libxlsmp.a(smprt.o))
rpm -ivh pkg-config/pkg-config-0.28-1.aix5.1.ppc.rpm
rpm -ivh zlib/zlib-1.2.8-1.aix5.1.ppc.rpm
rpm -ivh zlib/zlib-devel-1.2.8-1.aix5.1.ppc.rpm
rpm -ivh libpng/libpng-1.6.3-1.aix5.1.ppc.rpm
rpm -ivh libpng/libpng-devel-1.6.3-1.aix5.1.ppc.rpm
rpm -ivh freetype2/freetype2-2.5.0-1.aix5.1.ppc.rpm
rpm -ivh freetype2/freetype2-devel-2.5.0-1.aix5.1.ppc.rpm
rpm -ivh fontconfig/fontconfig-2.8.0-2.aix5.1.ppc.rpm
rpm -ivh fontconfig/fontconfig-devel-2.8.0-2.aix5.1.ppc.rpm
rpm -ivh libXrender/libXrender-0.9.7-2.aix6.1.ppc.rpm
rpm -ivh libXrender/libXrender-devel-0.9.7-2.aix6.1.ppc.rpm
rpm -ivh libXft/libXft-2.3.1-1.aix5.1.ppc.rpm
rpm -ivh libXft/libXft-devel-2.3.1-1.aix5.1.ppc.rpm
rpm -Uvh tcl/tcl-8.5.14-1.aix5.1.ppc.rpm
rpm -ivh tcl/tcl-devel-8.5.14-1.aix5.1.ppc.rpm
rpm -Uvh tk/tk-8.5.14-1.aix5.1.ppc.rpm
rpm -ivh tk/tk-devel-8.5.14-1.aix5.1.ppc.rpm
rpm -ivh info/info-5.1-1.aix5.1.ppc.rpm
rpm -ivh readline/readline-6.2-4.aix5.1.ppc.rpm
rpm -ivh readline/readline-devel-6.2-4.aix5.1.ppc.rpm
rpm -ivh openssl/openssl-1.0.1e-2.aix5.1.ppc.rpm
rpm -ivh openssl/openssl-devel-1.0.1e-2.aix5.1.ppc.rpm
rpm -ivh gdbm/gdbm-1.10-1.aix5.1.ppc.rpm
rpm -ivh gdbm/gdbm-devel-1.10-1.aix5.1.ppc.rpm
rpm -ivh gmp/gmp-5.0.5-1.aix5.1.ppc.rpm
rpm -ivh gmp/gmp-devel-5.0.5-1.aix5.1.ppc.rpm
rpm -ivh gettext/gettext-devel-0.17-1.aix5.1.ppc.rpm
rpm -ivh db4/db4-4.7.25-2.aix5.1.ppc.rpm
rpm -ivh db4/db4-devel-4.7.25-2.aix5.1.ppc.rpm
rpm -ivh bzip2/bzip2-1.0.6-1.aix5.1.ppc.rpm
rpm -ivh bzip2/bzip2-devel-1.0.6-1.aix5.1.ppc.rpm
rpm -ivh sqlite/sqlite-3.7.17-1.aix5.1.ppc.rpm
rpm -ivh sqlite/sqlite-devel-3.7.17-1.aix5.1.ppc.rpm
rpm -ivh python/python-libs-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/python-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/python-devel-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/tkinter-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/python-tools-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/python-test-2.7.5-1.aix6.1.ppc.rpm
In the first step I spent a lot of time to compile matplotlib. This is what I did to install matplotlib :
>From sources I installed NUMPY, SETUPTOOLS, PYTHON-DATEUTIL
With easy_install I installed TORNADO, PYPARSING
I need to do some changes in sources of matplotlib:
Patch 0
--- CXX/WrapPython.h 2013年09月18日 14:47:26.000000000 -0500
+++ CXX/WrapPython.h.orig 2013年09月18日 14:47:07.000000000 -0500
@@ -38,9 +38,6 @@
 #ifndef __PyCXX_wrap_python_hxx__
 #define __PyCXX_wrap_python_hxx__
- #include<stdio.h>
- #include<unistd.h>
-
 // On some platforms we have to include time.h to get select defined
 #if !defined(__WIN32__) && !defined(WIN32) && !defined(_WIN32) && !defined(_WIN64)
 #include <sys/time.h>
Patch 1
--- src/ft2font.h 2013年09月18日 14:43:11.000000000 -0500
+++ src/ft2font.h.orig 2013年09月18日 14:42:19.000000000 -0500
@@ -1,9 +1,5 @@
 /* -*- mode: c++; c-basic-offset: 4 -*- */
- #include<stdio.h>
- #include<unistd.h>
-
-
 /* A python interface to freetype2 */
 #ifndef _FT2FONT_H
 #define _FT2FONT_H
Patch 2
--- src/mplutils.h 2013年09月18日 14:46:06.000000000 -0500
+++ src/mplutils.h.orig 2013年09月18日 14:45:32.000000000 -0500
@@ -12,9 +12,6 @@
 *
 */
- #include<stdio.h>
- #include<unistd.h>
-
 #ifndef _MPLUTILS_H
 #define _MPLUTILS_H
Patch 3
--- ttconv/pprdrv.h 2013年09月18日 14:49:07.000000000 -0500
+++ ttconv/pprdrv.h.orig 2013年09月18日 14:48:47.000000000 -0500
@@ -21,9 +21,6 @@
 ** This file last revised 5 December 1995.
 */
- #include<stdio.h>
- #include<unistd.h>
-
 #include <vector>
 #include <cassert>
I create a link in the sources directory : ln -s /opt/freeware/lib/python2.7/config Modules
I create a xlC script
cat > xlC << EOF
/bin/bash
Modules/ld_so_aix
EOF
chmod a+x xlC
python setup.py install
With all this, the compilation ends.
When I check the use of matplotlib
import matplotlib
import numpy as np
from matplotlib import pyplot
a=np.arange(100)
pyplot.plot(a)
At this point I'm so happy !!!!!!
BUT, when I want plot the array !!!!
pyplot.show()
I had a segmentation fault ...... HELLLLLLLLLP !
My first question : Do somebody is able to plot something with matplotlib uner AIX 6.1 ???? And HOW ???
Do you know a howtodo page to do a correct installation ?
Thank you !
David

Showing 5 results of 5

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