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

Showing results of 194

<< < 1 2 3 4 .. 8 > >> (Page 2 of 8)
From: Robert Y. <Rob...@as...> - 2010年12月23日 21:19:14
Hi, I have used Matplotlib extensively now for 2 years with python 2.x.
I recently needed to move to python 3.1 which was greatly facilitated by
numpy and scipy being ported to python 3. I was lucky in that all I
have to change is many print statements. All on a Windows OS.
 
But my progress is severely limited by having no port of Matplotlib to
python 3. I am definitely a user so have contributed twice to
Matplotlib development.
 
Plea: If the stars align properly, I would be so grateful for a port of
matplotlib to python 3.
 
Thanks for hearing me.
 
 
From: Pawel J. <pa...@gm...> - 2010年12月23日 20:23:16
Hey guys,
Thank you so much for your clear answers which have been very helpful!
Pawel
-----Wiadomość oryginalna-----
Od: Paul Ivanov [mailto:piv...@gm...] 
Wysłano: Thursday, December 23, 2010 3:03 PM
Do: mat...@li...
DW: Pawel Janowski
Temat: Re: ODP: [Matplotlib-users] starting with pplots
Pawel Janowski, on 2010年12月23日 10:09, wrote:
> Hi Pavel,
> 
> Thanks for your help. Matplotlib seems to be a really cool tool. Your 
> response almost answered my question. What I want is for the 3D plot 
> to be 2D. I mean the z-axis can only take on 5 discreet values so I 
> don't want to visualize 3 dimensions but just two with the data points 
> colored five different colors depending on the z value.
Pawel,
(I'm replying back to the list, so that others may benefit - hello there,
search engine visitors from the future!)
In that case, you can either follow Goya's suggestion - if you only want to
draw points. scatter will actually rescale the color values you give to
whatever colormap you're using - and for your case, with just five z values
in range(1,6), I found a slight tweak to the 'hsv' colormap does the trick.
 from numpy.random import rand, randint
 import matplotlib.pyplot as plt
 x,y = rand(2,100)
 z = randint(1,6,100)
 plt.scatter(x,y,c=z, vmin=-1, cmap=plt.get_cmap('hsv'))
You can see the built-in colormaps here:
http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.htm
l
and as Goyo showed, it's pretty easy to make a new one.
If you want more control, such as changing the shape of the marker, not just
the color, or if there's some order to your points that you want to also see
(for example, draw lines between points of the same z value) - you can use a
boolean mask. 
 from numpy.random import rand, randint
 import matplotlib.pyplot as plt
 x,y = rand(2,100)
 z = randint(1,6,100)
 for i,c,m in zip(range(1,6),'rgbmk', 'odp*s'):
 mask = z==i
 plt.plot(x[mask],y[mask], color=c, marker=m)
hope that helps,
--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: Paul I. <piv...@gm...> - 2010年12月23日 20:02:47
Pawel Janowski, on 2010年12月23日 10:09, wrote:
> Hi Pavel,
> 
> Thanks for your help. Matplotlib seems to be a really cool tool. Your
> response almost answered my question. What I want is for the 3D plot to be
> 2D. I mean the z-axis can only take on 5 discreet values so I don't want to
> visualize 3 dimensions but just two with the data points colored five
> different colors depending on the z value. 
Pawel,
(I'm replying back to the list, so that others may benefit -
hello there, search engine visitors from the future!)
In that case, you can either follow Goya's suggestion - if you
only want to draw points. scatter will actually rescale the color
values you give to whatever colormap you're using - and for your
case, with just five z values in range(1,6), I found a slight
tweak to the 'hsv' colormap does the trick.
 from numpy.random import rand, randint
 import matplotlib.pyplot as plt
 x,y = rand(2,100)
 z = randint(1,6,100)
 plt.scatter(x,y,c=z, vmin=-1, cmap=plt.get_cmap('hsv'))
You can see the built-in colormaps here:
http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html
and as Goyo showed, it's pretty easy to make a new one.
If you want more control, such as changing the shape of the
marker, not just the color, or if there's some order to your points
that you want to also see (for example, draw lines between points
of the same z value) - you can use a boolean mask. 
 from numpy.random import rand, randint
 import matplotlib.pyplot as plt
 x,y = rand(2,100)
 z = randint(1,6,100)
 for i,c,m in zip(range(1,6),'rgbmk', 'odp*s'):
 mask = z==i
 plt.plot(x[mask],y[mask], color=c, marker=m)
hope that helps,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: Paul I. <piv...@gm...> - 2010年12月23日 17:48:04
Attachments: twinx-sci.diff
Václav Šmilauer, on 2010年12月23日 14:51, wrote:
> Hi there,
> 
> when I use twinx() to have y1 and y2 axes and set ticklabel_format
> style to 'sci' on the y2 axis, ticks on the y2 are properly numbered,
> but the "1e-5" that is supposed to be atop y2 appears on the top of
> y1 instead. When both y1 and y2 use the exponents, they overwrite
> each other -- a minimal example (result attached in pdf):
> 
> import pylab
> 
> pylab.plot([0,1e-2,2e-2,3e-2],[1e3,5e3,6.1e3,1e3],'g-')
> 
> pylab.ticklabel_format(style='sci',scilimits=(0,0),axis='both') # this is not necessary to show the bug
> 
> pylab.twinx()
> 
> pylab.plot([1e-2,2e-2,3e-2,4e-2],[2e-5,3e-5,0,-1e-5],'r-')
> 
> pylab.ticklabel_format(style='sci',scilimits=(0,0),axis='both') # makes 1e-5 appear on the left instead of on the right
> 
> pylab.show()
> 
Hi Václav,
thanks for the bug report. As a temporary workaround - use 
plt.gca().yaxis.set_offset_position('right')
Committers: the patch attached fixes this problem. I thought that
there might be a similar problem for twiny() - but ax.xaxis does
not appear to have .set_offset_position() method.
 
> I've had this issue with versions .99, 1.0.0, running on Linux
> (Ubuntu, versions 9.04 through to 10.10).
me too, and I kept forgetting to report it.
> PS. what's wrong with the sf.net bugzilla? I was not able to post the
> issue there --
this I do not know.
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: Václav Š. <eu...@ar...> - 2010年12月23日 14:05:56
Attachments: overlap.pdf
Hi there,
when I use twinx() to have y1 and y2 axes and set ticklabel_format style 
to 'sci' on the y2 axis, ticks on the y2 are properly numbered, but the 
"1e-5" that is supposed to be atop y2 appears on the top of y1 instead. 
When both y1 and y2 use the exponents, they overwrite each other -- a 
minimal example (result attached in pdf):
import pylab
pylab.plot([0,1e-2,2e-2,3e-2],[1e3,5e3,6.1e3,1e3],'g-')
pylab.ticklabel_format(style='sci',scilimits=(0,0),axis='both') # this is not necessary to show the bug
pylab.twinx()
pylab.plot([1e-2,2e-2,3e-2,4e-2],[2e-5,3e-5,0,-1e-5],'r-')
pylab.ticklabel_format(style='sci',scilimits=(0,0),axis='both') # makes 1e-5 appear on the left instead of on the right
pylab.show()
I've had this issue with versions .99, 1.0.0, running on Linux (Ubuntu, 
versions 9.04 through to 10.10).
Cheers, Václav
PS. what's wrong with the sf.net bugzilla? I was not able to post the 
issue there --
From: Paul I. <piv...@gm...> - 2010年12月23日 02:27:25
Pawel, on 2010年12月18日 20:04, wrote:
> Hi,
> 
> I am a new user of matplotlib so maybe my question is elementary, but 
> have not been able to find an answer to my problem in the archive.
> 
> I would like to make a 2D plot of colored points of 3D data (clusters). 
> My data looks like this:
> 
> 11837.2120 -0.0858 2.0000
> 23975.2120 -0.0672 2.0000
> 37609.2120 -0.0306 2.0000
> 53263.9800 -0.0690 2.0000
> 72106.6760 0.2708 1.0000
> 92674.6760 -0.0129 3.0000
> 116758.676 -0.1245 3.0000
> ...
> 
> So I need to plot the first and second column as points on the x-y axis 
> and color the points according to the numbers in the third column (which 
> are integers ranging from 1 to5).
> 
> I'd appreciate any help. I realize something so typical should be 
> somewhere in the documentation but I was not able to find it.
Hi Paul,
welcome to matplotlib! So you need to read in those columns
somehow (as numpy arrays, or lists), but once you've got that,
it's just a matter of initiating a 3d plot, and calling scatter
with the three columns.
take a look at this example and it's source code:
http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/tutorial.html#scatter-plots
for your purposes, the code will be something like:
 from mpl_toolkits.mplot3d import Axes3D
 import matplotlib.pyplot as plt
 fig = plt.figure()
 ax = fig.add_subplot(111, projection='3d')
 ax.scatter(x,y,z)
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: Goyo <goy...@gm...> - 2010年12月23日 02:05:54
2010年12月19日 Pawel <pa...@gm...>:
> Hi,
>
> I am a new user of matplotlib so maybe my question is elementary, but
> have not been able to find an answer to my problem in the archive.
>
> I would like to make a 2D plot of colored points of 3D data (clusters).
> My data looks like this:
>
> 11837.2120  -0.0858  2.0000
> 23975.2120  -0.0672  2.0000
> 37609.2120  -0.0306  2.0000
> 53263.9800  -0.0690  2.0000
> 72106.6760  0.2708   1.0000
> 92674.6760  -0.0129  3.0000
> 116758.676  -0.1245  3.0000
> ...
>
> So I need to plot the first and second column as points on the x-y axis
> and color the points according to the numbers in the third column (which
> are integers ranging from 1 to5).
>
> I'd appreciate any help. I realize something so typical should be
> somewhere in the documentation but I was not able to find it.
Try this:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
x, y, z = np.loadtxt('data.txt', unpack=True)
cmap = ListedColormap(['b', 'g', 'r', 'c', 'm'])
plt.scatter(x, y, c=z, cmap=cmap, vmin=1, vmax=5)
plt.show()
You'll need to use a single space as column delimiter in your data
file or deal with more loadtxt arguments.
If your z data were color specifications you could just use
plt.scatter(x, y, c=z) as stated in the scatter docstring. Converting
arbitrary data to color specifications is the non trivial issue here.
You can write your own code to do this or use colormaps.
Goyo
From: Jeremy B. <jb...@no...> - 2010年12月22日 17:49:20
I ran into a nasty problem and was stuck until I realized that my numpy version was 1.3 when it should of been 1.5. But the errors never gave me an indication that this was the issue. I had added the new repository but the package was from some previous installation. 
I removed the old version of numpy and the reinstalled from the repository numpy 1.5 and matplotlib 1.0.0_15 and everything was happy crappy. I just thought I would save someone else from the headache. 
Is there a listing of incompatible versions in matplotlib for dependencies? Because even when I tried from source it didn't warn me it wouldn't work. 
iwm1-20:~/matplotlib # python setup.py install 
basedirlist is: ['/usr/local', '/usr'] 
============================================================================ 
BUILDING MATPLOTLIB 
 matplotlib: 1.0.0 
 python: 2.6 (r26:66714, May 5 2010, 14:33:49) [GCC 4.3.4 
 [gcc-4_3-branch revision 152973]] 
 platform: linux2 
REQUIRED DEPENDENCIES 
 numpy: 1.3.0 
 freetype2: found, but unknown version (no pkg-config) 
 * WARNING: Could not find 'freetype2' headers in any 
 * of '/usr/local/include', '/usr/include', '.', 
 * '/usr/local/include/freetype2', 
 * '/usr/include/freetype2', './freetype2'. 
It is working correctly just hope to save someone the headache. 
Thanks 
Jeremy 
Here is all my data and I also received this error when I tried to build from easy_install or from source. 
easy_install matplotlib 
 
src/ft2font.cpp:92: error: variable or field *draw_bitmap* declared void 
src/ft2font.cpp:92: error: *FT_Bitmap* was not declared in this scope 
src/ft2font.cpp:92: error: *bitmap* was not declared in this scope 
src/ft2font.cpp:93: error: *FT_Int* was not declared in this scope 
src/ft2font.cpp:94: error: *FT_Int* was not declared in this scope 
error: Setup script exited with error: command 'gcc' failed with exit status 1 
Exception OSError: (2, 'No such file or directory', 'src/image.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x863edec>> ignored 
Exception OSError: (2, 'No such file or directory', 'src/transforms.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x8632d4c>> ignored 
Exception OSError: (2, 'No such file or directory', 'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x863ed6c>> ignored 
or python setup.py install 
gcc -pthread -fno-strict-aliasing -DNDEBUG -march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fwrapv -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/lib/python2.6/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/lib/python2.6/site-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/include/python2.6 -c src/ft2font.cpp -o build/temp.linux-i686-2.6/src/ft2font.o 
In file included from src/ft2font.cpp:3: 
src/ft2font.h:16:22: error: ft2build.h: No such file or directory 
src/ft2font.h:17:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:18:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:19:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:20:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:21:10: error: #include expects "FILENAME" or <FILENAME> 
In file included from src/ft2font.cpp:3: 
src/ft2font.h:35: error: *FT_Bitmap* has not been declared 
src/ft2font.h:35: error: *FT_Int* has not been declared 
src/ft2font.h:35: error: *FT_Int* has not been declared 
src/ft2font.h:91: error: expected *,* or *...* before *&* token 
src/ft2font.h:91: error: ISO C++ forbids declaration of *FT_Face* with no type 
src/ft2font.h:97: error: expected *,* or *...* before *&* token 
src/ft2font.h:97: error: ISO C++ forbids declaration of *FT_Face* with no type 
src/ft2font.h:139: error: *FT_Face* does not name a type 
src/ft2font.h:140: error: *FT_Matrix* does not name a type 
src/ft2font.h:141: error: *FT_Vector* does not name a type 
src/ft2font.h:142: error: *FT_Error* does not name a type 
src/ft2font.h:143: error: *FT_Glyph* was not declared in this scope 
src/ft2font.h:143: error: template argument 1 is invalid 
src/ft2font.h:143: error: template argument 2 is invalid 
src/ft2font.h:144: error: *FT_Vector* was not declared in this scope 
src/ft2font.h:144: error: template argument 1 is invalid 
src/ft2font.h:144: error: template argument 2 is invalid 
src/ft2font.h:150: error: *FT_BBox* does not name a type 
src/ft2font.cpp:47: error: *FT_Library* does not name a type 
src/ft2font.cpp:110: error: variable or field *draw_bitmap* declared void 
src/ft2font.cpp:110: error: *FT_Bitmap* was not declared in this scope 
src/ft2font.cpp:110: error: *bitmap* was not declared in this scope 
src/ft2font.cpp:111: error: *FT_Int* was not declared in this scope 
src/ft2font.cpp:112: error: *FT_Int* was not declared in this scope 
/usr/lib/python2.6/site-packages/numpy/core/include/numpy/__multiarray_api.h:968: warning: *int _import_array()* defined but not used 
error: command 'gcc' failed with exit status 1 
iwm1-20:~/matplotlib # pip pygtk 
Here is the repository I have added with the dependencies. 
http://download.opensuse.org/repositories/science/SLE_11/ 
iwm1-20:~ # gcc --version 
gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973] 
Copyright (C) 2008 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
iwm1-20:~ # uname -a 
Linux iwm1-20 2.6.32.12-0.7-pae #1 SMP 2010年05月20日 11:14:20 +0200 i686 i686 i386 GNU/Linux 
iwm1-20:~ # python 
Python 2.6 (r26:66714, May 5 2010, 14:33:49) 
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import matplotlib; print matplotlib.__version__ 
Traceback (most recent call last): 
 File "<stdin>", line 1, in <module> 
AttributeError: 'module' object has no attribute '__version__' 
>>> 
iwm1-20:~ # zypper info python-matplotlib 
Loading repository data... 
Reading installed packages... 
Information for package python-matplotlib: 
Repository: @System 
Name: python-matplotlib 
Version: 1.0.0-15.1 
Arch: i586 
Vendor: openSUSE Build Service 
Support Level: unknown 
Installed: Yes 
Status: up-to-date 
Installed Size: 24.4 MiB 
Summary: Plotting Library for Python 
Description: 
matplotlib is a python 2D plotting library which produces publication 
quality figures in a variety of hardcopy formats and interactive 
environments across platforms. matplotlib can be used in python 
scripts, the python and ipython shell (ala matlab or mathematica), web 
application servers, and six graphical user interface toolkits. 
iwm1-20:~ # 
iwm1-20:~ # cat /etc/issue 
Welcome to SUSE Linux Enterprise Server 11 SP1 (i586) - Kernel \r (\l). 
iwm1-20:~ # 
From: Matthias M. <Mat...@gm...> - 2010年12月22日 08:12:42
Hi,
I'm not sure if you are still struggling about this problem. If you do, you 
might want to add an '.copy()' to 'y' in the pcolormesh as in the attached 
code. I think this is a matter of data vs. pointer to data field. The colorbars 
are generated in each step, but the array 'y' is somehow used for all color-
meshes at some final point.
Kind regards and merry Christmas,
Matthias 
On Tuesday December 7 2010 20:27:34 Oleksandr Huziy wrote:
> Hello all,
> 
> I am trying to plot different data using pcolormesh in subplots. But I get
> in all subplots
> data plotted in the last subplot. It seems it is being overwritten. Only
> colorbar indicates that the data should be different.
> In my opinion what is happening:
> subplot is ploted and colorbar is adjusted to its data, but when the second
> subplot is plotted, data of the first subplot is overwritten with data from
> the second subplot.
> 
> when I use contourf - it does not overwrite the data.
> 
> 
> the test code is here (result image is attached, data is the same in the
> subplots but colorbars are different so the colors are different
> but as you see in code I am changing the data):
> 
> def test():
> y = np.zeros((100,100))
> for i in range(1,7):
> plt.subplot(3, 2, i)
> plt.title('%d' % i)
> y[:,:] = i
> y[5 + 10*i, 5 + 10*i] = i * i + 10
> plt.pcolormesh(y)
> plt.colorbar()
> plt.savefig("test_subplots.png")
> 
> 
> matplotlib version: 1.0.0 (Installed using macports)
> OS: Darwin citron 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39
> PDT 2010; root:xnu-1504年9月17日~1/RELEASE_I386 i386 i386
> 
> Any help is appreciated.
> --
> Oleksandr Huziy
> PhD student, UQÀM.
From: Taja A. <taj...@gm...> - 2010年12月21日 22:58:38
Hi,
I'm trying to implement the following: x,y,z,s are arrays of same size. I'm
plotting x,y,z in Axes3D but I'm unable to change its color proportionally
with s; like to be able to change its intensity w.r.t 's' (just an example).
Please let me know the method if it is possible to do such a plot.
Thanks,
Taja
From: Russell E. O. <ro...@uw...> - 2010年12月21日 20:39:03
In article <4D0...@gm...>,
 Jose Guzman <sjm...@go...> 
 wrote:
> Hi everybody
> 
> I wanted to collect a combination of plots to insert then in a subplot. 
> I choose to create Line2D objects to use the .add_line() method of the 
> AxesSubplot class, but unfortunately this does lead to the desired results.
>...
Is the appended closer to what you had in mind?
-- Russell
from matplotlib.lines import Line2D
from matplotlib.pyplot import figure, show
import numpy as np
def subplot_foo(n):
 """ returns a the combination of 2 Line2D instances """
 x = np.arange(0, 200, 0.1)
 y = np.random.randn(len(x))
 print len(x)
 y2 = y+n
 line1 = Line2D(x, y, color = 'k')
 line2 = Line2D(x, y2, color = 'r')
 return line1, line2
fig = figure() # create Figure object
for i in range(1,5):
 ax = fig.add_subplot(2,2,i)
 subplots = subplot_foo(i)
 for subplot in subplots:
 ax.add_line(subplot)
show()
From: Benjamin R. <ben...@ou...> - 2010年12月21日 16:10:52
On Wed, Dec 15, 2010 at 9:47 AM, Benjamin Root <ben...@ou...> wrote:
> On Wed, Dec 15, 2010 at 6:25 AM, Teng Liu <lew...@gm...> wrote:
>
>> Linux 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:48:22 UTC 2010 i686
>> GNU/Linux
>> matplotlib 0.99.1.1
>> The script below is copied from
>> http://matplotlib.sourceforge.net/examples/pylab_examples/hatch_demo.html
>> It works. But it can not be saved as an eps file.
>> I have a lot of histogram plots using "hatch" needed to be saved as eps,
>> is it possible to fix this bug?
>> Thanks.
>>
>> """
>>
>>
>> Hatching (pattern filled polygons) is supported currently in the PS,
>> PDF, SVG and Agg backends only.
>> """
>> import matplotlib.pyplot as plt
>>
>>
>> from matplotlib.patches import Ellipse, Polygon
>>
>> fig = plt.figure()
>>
>>
>> ax1 = fig.add_subplot(131)
>> ax1.bar(range(1,5), range(1,5), color='red', edgecolor='black', hatch="/")
>>
>>
>> ax1.bar(range(1,5), [6] * 4, bottom=range(1,5), color='blue', edgecolor='black', hatch='//')
>>
>>
>> ax1.set_xticks([1.5,2.5,3.5,4.5])
>>
>> ax2 = fig.add_subplot(132)
>> bars = ax2.bar(range(1,5), range(1,5), color='yellow', ecolor='black') + \
>>
>>
>>
>> ax2.bar(range(1, 5), [6] * 4, bottom=range(1,5), color='green', ecolor='black')
>>
>>
>> ax2.set_xticks([1.5,2.5,3.5,4.5])
>>
>> patterns = ('-', '+', 'x', '\\', '*', 'o', 'O', '.')
>>
>>
>> for bar, pattern in zip(bars, patterns):
>>
>> bar.set_hatch(pattern)
>>
>> ax3 = fig.add_subplot(133)
>>
>>
>> ax3.fill([1,3,3,1],[1,1,2,2], fill=False, hatch='\\')
>>
>>
>> ax3.add_patch(Ellipse((4,1.5), 4, 0.5, fill=False, hatch='*'))
>>
>>
>> ax3.add_patch(Polygon([[0,0],[4,1.1],[6,2.5],[2,1.4]], closed=True,
>>
>>
>>
>> fill=False, hatch='/'))
>> ax3.set_xlim((0,6))
>> ax3.set_ylim((0,2.5))
>>
>>
>>
>> plt.show()
>>
>>
>> I was able to run this script and save the eps file just fine. However,
> the resulting image is completely wrong. I have attached a screenshot of
> the eps file as viewed in evince. Essentially, all of the hatching elements
> are not at all what they are supposed to be.
>
> Ben Root
>
>
I am re-pinging this issue. Could it be a path simplification issue?
Ben Root
From: Benoist L. <be...@ib...> - 2010年12月21日 09:34:46
Nice!
Still some stuff to enhance but got it!
Thanks a lot.
Ben
Le 19 déc. 10 à 05:30, Jae-Joon Lee a écrit :
> I don't think "polar" is a good fit for your case. Instead, you can
> simply use "data" coordinate with explicit coordinate transformation.
> Try something like;
>
> for i in xrange(5):
> theta = i*1.3+1.5
> xx = center[0]+(radius-4)*math.cos(theta)
> yy = center[1]+(radius-4)*math.sin(theta)
> pyplot.annotate(str(i+1), (xx, yy), color='g', va="center", 
> ha="center")
>
> -JJ
>
>
>
> On Thu, Dec 16, 2010 at 5:27 PM, Benoist Laurent <be...@ib...> 
> wrote:
>> Sorry for the delay.
>> This is the script is used (modified so that it include the data).
>>
>>
>>
>> Le 15 déc. 10 à 16:50, Benjamin Root a écrit :
>>
>> On Wed, Dec 15, 2010 at 9:46 AM, Benoist Laurent <be...@ib...> 
>> wrote:
>>>
>>> Hi all,
>>> I'm still a bit stuck with this probleme of polar annotation.
>>> Let me present the problem in a different way.
>>> I've got the center of my circle, its radius and even some points 
>>> on the
>>> circle.
>>> Actually, I'd like to annotate these points (red crosses in the 
>>> joined
>>> picture).
>>> How would you do that?
>>> My best try gave me the green numbers.
>>> Thanks in advance,
>>> Ben
>>>
>>
>> Can you include the source code (if it is simple) that you used to 
>> generate
>> this example, and we could probably help you out.
>>
>> Ben Root
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
From: Benjamin R. <ben...@ou...> - 2010年12月20日 23:05:47
On Monday, December 20, 2010, Jose Guzman <sjm...@go...> wrote:
>
>
>
>
>
>
>
> Hi everybody
>
> I wanted to collect a combination of plots to insert then in a subplot.
> I choose to create Line2D objects to use the .add_line() method of the
> AxesSubplot class, but unfortunately this does lead to the desired
> results.
>
> Here my dummy version:
>
> from
> matplotlib.lines import Line2D
> from matplotlib.pyplot import figure, show
>
> import numpy as np
>
> def subplot_foo(n):
>   """ returns a the combination of 2 Line2D instances """
>   x = np.arange(0, 200, 0.1)
>   y = np.random.randn(len(x))
>   print len(x)
>   #y2 = y+n
>
>   line1 = Line2D(x, y, color = 'k')
>   #line2 = Line2D(x,y2, 'r')
>
>   #return line1+line2
>   return line1
>
>
> fig = figure() # create Figure object
> for i in range(1,5):
>   ax = fig.add_subplot(2,2,i)
>
>   ax.add_line(subplot_foo(i))
>
> show()
>
> First, the Line2D object does not represent
> the plot I want to create.
> Second, I cannot collect various Line2D objects into a Subplot.
>
> Any good idea around?
>
>
>
>
You might want to look at LineCollection objects.
Ben Root
From: Jose G. <sjm...@go...> - 2010年12月20日 17:14:57
Hi everybody
I wanted to collect a combination of plots to insert then in a subplot. 
I choose to create Line2D objects to use the .add_line() method of the 
AxesSubplot class, but unfortunately this does lead to the desired results.
Here my dummy version:
from matplotlib.lines import Line2D
from matplotlib.pyplot import figure, show
import numpy as np
def subplot_foo(n):
 """ returns a the combination of 2 Line2D instances """
 x = np.arange(0, 200, 0.1)
 y = np.random.randn(len(x))
 print len(x)
 #y2 = y+n
 line1 = Line2D(x, y, color = 'k')
 #line2 = Line2D(x,y2, 'r')
 #return line1+line2
 return line1
fig = figure() # create Figure object
for i in range(1,5):
 ax = fig.add_subplot(2,2,i)
 ax.add_line(subplot_foo(i))
show()
First, the Line2D object does not represent the plot I want to create.
Second, I cannot collect various Line2D objects into a Subplot.
Any good idea around?
From: John H. <jha...@gm...> - 2010年12月20日 15:36:55
No, I'm not adding or removing axes while interacting. (A single axes
instance gets created when the figure is instantiated and remains the life
of the figure.)
Thans for the suggestion of replacing Axes.end_pan. Unfortunately I've left
on a trip since my initial post so it will be a while before I can try it.
On Dec 20, 2010 8:20 AM, "Michael Droettboom" <md...@st...> wrote:
> This is a wild guess -- sounds like a race condition where the mouse up
> event is somehow getting fired before the mouse down event.
>
> In your more complex example, are you adding/removing axes while
> interacting with the plots?
>
> You could try "papering over" this problem by replacing Axes.end_pan
> with the following (I'm not entirely sure this is a good idea, but I'm
> curious if it prevents the sluggishness):
>
> def end_pan(self):
> """
> Called when a pan operation completes (when the mouse button
> is up.)
>
> .. note::
> Intended to be overridden by new projection types.
> """
> if hasattr(self, '_pan_start'):
> del self._pan_start
>
> Mike
>
> On 12/18/2010 01:52 PM, John Haiducek wrote:
>> I have an application with two matplotlib figures, both using the gtkAgg
>> backend. One or the other is displayed on the screen depending on the
>> GUI state. Initially after creating the two figures, I can interact with
>> both of them just fine, but after switching between figures two or three
>> times the figure becomes sluggish in handling pans and zooms, and I
>> start getting errors like this while panning:
>>
>> Traceback (most recent call last):
>> File
>> "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_gtk.py", line
>> 216, in button_release_event
>> FigureCanvasBase.button_release_event(self, x, y, event.button,
>> guiEvent=event)
>> File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line
>> 1219, in button_release_event
>> self.callbacks.process(s, event)
>> File "/usr/lib/pymodules/python2.6/matplotlib/cbook.py", line 165, in
>> process
>> func(*args, **kwargs)
>> File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line
>> 2016, in release_pan
>> a.end_pan()
>> File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 2458, in
>> end_pan
>> del self._pan_start
>> AttributeError: _pan_start
>>
>> I tried to create a minimum working example but so far have been
>> unsuccessful; the problem did not recur in the simpler program I created.
>>
>> Can anyone suggest to me where I would look to find what could cause
>> this error and the (presumably related) performance degradation?
>>
>>
------------------------------------------------------------------------------
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
> --
> Michael Droettboom
> Science Software Branch
> Space Telescope Science Institute
> Baltimore, Maryland, USA
>
>
>
------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Michael D. <md...@st...> - 2010年12月20日 14:18:25
This is a wild guess -- sounds like a race condition where the mouse up 
event is somehow getting fired before the mouse down event.
In your more complex example, are you adding/removing axes while 
interacting with the plots?
You could try "papering over" this problem by replacing Axes.end_pan 
with the following (I'm not entirely sure this is a good idea, but I'm 
curious if it prevents the sluggishness):
 def end_pan(self):
 """
 Called when a pan operation completes (when the mouse button
 is up.)
 .. note::
 Intended to be overridden by new projection types.
 """
 if hasattr(self, '_pan_start'):
 del self._pan_start
Mike
On 12/18/2010 01:52 PM, John Haiducek wrote:
> I have an application with two matplotlib figures, both using the gtkAgg
> backend. One or the other is displayed on the screen depending on the
> GUI state. Initially after creating the two figures, I can interact with
> both of them just fine, but after switching between figures two or three
> times the figure becomes sluggish in handling pans and zooms, and I
> start getting errors like this while panning:
>
> Traceback (most recent call last):
> File
> "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_gtk.py", line
> 216, in button_release_event
> FigureCanvasBase.button_release_event(self, x, y, event.button,
> guiEvent=event)
> File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line
> 1219, in button_release_event
> self.callbacks.process(s, event)
> File "/usr/lib/pymodules/python2.6/matplotlib/cbook.py", line 165, in
> process
> func(*args, **kwargs)
> File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line
> 2016, in release_pan
> a.end_pan()
> File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 2458, in
> end_pan
> del self._pan_start
> AttributeError: _pan_start
>
> I tried to create a minimum working example but so far have been
> unsuccessful; the problem did not recur in the simpler program I created.
>
> Can anyone suggest to me where I would look to find what could cause
> this error and the (presumably related) performance degradation?
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Mark J. <mja...@es...> - 2010年12月20日 02:58:03
Sweet locale for sure... been pointing colleagues here for awhile now. Any word on when an "official" version for 27 is expected? Thanks much,
MJ
-----Original Message-----
From: Alan G Isaac [mailto:ala...@gm...] 
Sent: Friday, December 17, 2010 3:55 PM
To: mat...@li...
Subject: Re: [Matplotlib-users] unofficial binaries (Matplotlib, etc)
On 12/17/2010 6:28 PM, Christoph Gohlke wrote:
> http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib
Wow!
That's quite an offering.
Alan Isaac
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jae-Joon L. <lee...@gm...> - 2010年12月20日 00:37:14
When I open your eps file with ghostscript, I can see the problem.
I'm about 95% sure that this is related to the ghostscript not
correctly rendering the line.
In your ghostscript viewer, turn off "antialiasing" then you will see
straight line (of course w/o antialiasing).
This seems to be a known problem that has recently been fixed
http://www.ghostscript.com/doc/current/Changes.htm (see the entry of
2010年04月07日T13:13:57.741241Z Robin Watts)
It only happens when you use "round" join style. So, change your rc
file (or any other setting) not to use "round" style. In case you
must use "round" style, I guess you'd better upgrade your ghostscript.
Regards,
-JJ
On Mon, Dec 20, 2010 at 8:53 AM, andes <czu...@ya...> wrote:
>
> Hello JJ,
>
> Thanks so much for replying..
> I have attached the "eps" file.
>
> http://old.nabble.com/file/p30495318/figeps.eps figeps.eps
>
> c
>
>
>
> Jae-Joon Lee wrote:
>>
>> Can you post your eps file?
>> This may be related to the ps rasterizer you're using.
>> Regards,
>>
>> -JJ
>>
>>
>> On Thu, Dec 16, 2010 at 1:46 AM, andes <czu...@ya...> wrote:
>>>
>>> hello,
>>>
>>> When I save as an "eps" a figure created by matplotlib I face the problem
>>> that the inclined lines in the plot appear to be jagged when I open the
>>> "eps" (please see figure below). This problem doesn't appear when I save
>>> the
>>> figure as a pdf or png. Do you you know if there is a simple solution to
>>> this problem that I can implement in my example code (shown below)?
>>> I would greatly appreciate any advice.
>>> #----example code
>>> from numpy import *
>>> from pylab import *
>>> x=linspace(-1,1,100)
>>> y=x
>>> figure(1)
>>> p1,=plot(x,y,lw=3)
>>> savefig("figeps.eps")
>>> #---jagged line in plot
>>> http://old.nabble.com/file/p30465591/jagged.png
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/jagged-line-in-eps-from-matplitlib-tp30465591p30465591.html
>>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Lotusphere 2011
>>> Register now for Lotusphere 2011 and learn how
>>> to connect the dots, take your collaborative environment
>>> to the next level, and enter the era of Social Business.
>>> http://p.sf.net/sfu/lotusphere-d2d
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>
>> ------------------------------------------------------------------------------
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
> --
> View this message in context: http://old.nabble.com/jagged-line-in-eps-from-matplitlib-tp30465591p30495318.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: andes <czu...@ya...> - 2010年12月19日 23:53:50
Hello JJ,
Thanks so much for replying..
I have attached the "eps" file.
http://old.nabble.com/file/p30495318/figeps.eps figeps.eps 
c
Jae-Joon Lee wrote:
> 
> Can you post your eps file?
> This may be related to the ps rasterizer you're using.
> Regards,
> 
> -JJ
> 
> 
> On Thu, Dec 16, 2010 at 1:46 AM, andes <czu...@ya...> wrote:
>>
>> hello,
>>
>> When I save as an "eps" a figure created by matplotlib I face the problem
>> that the inclined lines in the plot appear to be jagged when I open the
>> "eps" (please see figure below). This problem doesn't appear when I save
>> the
>> figure as a pdf or png. Do you you know if there is a simple solution to
>> this problem that I can implement in my example code (shown below)?
>> I would greatly appreciate any advice.
>> #----example code
>> from numpy import *
>> from pylab import *
>> x=linspace(-1,1,100)
>> y=x
>> figure(1)
>> p1,=plot(x,y,lw=3)
>> savefig("figeps.eps")
>> #---jagged line in plot
>> http://old.nabble.com/file/p30465591/jagged.png
>>
>> --
>> View this message in context:
>> http://old.nabble.com/jagged-line-in-eps-from-matplitlib-tp30465591p30465591.html
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
> 
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/jagged-line-in-eps-from-matplitlib-tp30465591p30495318.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Sylvain M. <24...@gm...> - 2010年12月19日 09:34:42
Hi,
I was wondering if you ever found a solution to this problem ?
I have the exact same issue with GTK (Agg or cairo) and WX backends
... I'm also under gentoo using ipython-0.10.1 and matplotlib-1.0.0
I don't have the warnings you have but same behavior, I have to call
show (if I don't a blank 'frozen' window is all that appears) but then
the ipython doesn't have control anymore.
Cheers,
 Sylvain
From: Jae-Joon L. <lee...@gm...> - 2010年12月19日 04:36:59
Can you post your eps file?
This may be related to the ps rasterizer you're using.
Regards,
-JJ
On Thu, Dec 16, 2010 at 1:46 AM, andes <czu...@ya...> wrote:
>
> hello,
>
> When I save as an "eps" a figure created by matplotlib I face the problem
> that the inclined lines in the plot appear to be jagged when I open the
> "eps" (please see figure below). This problem doesn't appear when I save the
> figure as a pdf or png. Do you you know if there is a simple solution to
> this problem that I can implement in my example code (shown below)?
> I would greatly appreciate any advice.
> #----example code
> from numpy import *
> from pylab import *
> x=linspace(-1,1,100)
> y=x
> figure(1)
> p1,=plot(x,y,lw=3)
> savefig("figeps.eps")
> #---jagged line in plot
> http://old.nabble.com/file/p30465591/jagged.png
>
> --
> View this message in context: http://old.nabble.com/jagged-line-in-eps-from-matplitlib-tp30465591p30465591.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2010年12月19日 04:30:34
I don't think "polar" is a good fit for your case. Instead, you can
simply use "data" coordinate with explicit coordinate transformation.
Try something like;
 for i in xrange(5):
 theta = i*1.3+1.5
 xx = center[0]+(radius-4)*math.cos(theta)
 yy = center[1]+(radius-4)*math.sin(theta)
 pyplot.annotate(str(i+1), (xx, yy), color='g', va="center", ha="center")
-JJ
On Thu, Dec 16, 2010 at 5:27 PM, Benoist Laurent <be...@ib...> wrote:
> Sorry for the delay.
> This is the script is used (modified so that it include the data).
>
>
>
> Le 15 déc. 10 à 16:50, Benjamin Root a écrit :
>
> On Wed, Dec 15, 2010 at 9:46 AM, Benoist Laurent <be...@ib...> wrote:
>>
>> Hi all,
>> I'm still a bit stuck with this probleme of polar annotation.
>> Let me present the problem in a different way.
>> I've got the center of my circle, its radius and even some points on the
>> circle.
>> Actually, I'd like to annotate these points (red crosses in the joined
>> picture).
>> How would you do that?
>> My best try gave me the green numbers.
>> Thanks in advance,
>> Ben
>>
>
> Can you include the source code (if it is simple) that you used to generate
> this example, and we could probably help you out.
>
> Ben Root
>
>
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2010年12月19日 03:39:14
Glad to hear that others find that code useful.
I just want to emphasize that this is not a general solution and never meant to.
Although I'm planning to include this functionality into the
axes_grid1 toolkit, I don't think this will be integrated with the
main matplolib.
Regards,
-JJ
On Wed, Dec 15, 2010 at 4:24 AM, Daniel Hyams <dh...@gm...> wrote:
> I'm using it too, with excellent results. Thanks JJ!
>
>
>> On Tue, Dec 14, 2010 at 2:13 PM, C M <cmp...@gm...> wrote:
>>>
>>>
>>> On Thu, Sep 30, 2010 at 7:55 AM, Jae-Joon Lee <lee...@gm...>
>>> wrote:
>>>>
>>>> On Thu, Sep 23, 2010 at 10:31 AM, C M <cmp...@gm...> wrote:
>>>> > Until a more permanent solution is figured out, can anyone recommend
>>>> > any workarounds, even if they are a little clunky? I'm embedding mpl
>>>> > plots in wxPython and am also finding this issue suboptimal.
>>>> >
>>>> > Che
>>>> >
>>>>
>>>> A (partial) workaround is possible using the axes_grid1 toolkit (i.e.,
>>>> you need matplotlib 1.0).
>>>> Attached is a module I just cooked up (based on my previous attempt @
>>>>
>>>> http://www.mail-archive.com/mat...@li.../msg18129.html),
>>>> and it seems to work quite well.
>>>> The usage is simple.
>>>>
>>>>
>>>>    ax = plt.axes([0,0,1,1])
>>>>
>>>>    ax.set_yticks([0.5])
>>>>    ax.set_yticklabels(["very long label"])
>>>>
>>>>    make_axes_area_auto_adjustable(ax) # This is where axes_grid1
>>>> comes in
>>>>
>>>> Then, the axes area(including ticklabels and axis label) will be
>>>> automatically adjusted to fit in the given extent ([0, 0, 1, 1] in the
>>>> above case).
>>>>
>>>> While this is mainly for a single axes plot, you may use it with
>>>> multi-axes plot (but somewhat trickier to use). A few examples are
>>>> included in the module.
>>>>
>>>> Regards,
>>>>
>>>> -JJ
>>>
>>> This thread is a few months old now, but I just wanted to mention that I
>>> am using JJ's workaround (thanks!) in my app--with either one or two y
>>> axes--and it is just excellent.
>>>
>>> This should definitely be at least an option for matplotlib users--the
>>> quality of the appearance of the plots now is like night and day, because,
>>> to me, seeing a plot without its axes labels (I'm talking about in a
>>> resizable plot embedded in an application, not a static graph for inclusion
>>> in a publication) is a *major* look and feel demerit.
>>>
>>> Che
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Lotusphere 2011
>>> Register now for Lotusphere 2011 and learn how
>>> to connect the dots, take your collaborative environment
>>> to the next level, and enter the era of Social Business.
>>> http://p.sf.net/sfu/lotusphere-d2d
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>
>>
>>
>> --
>> Daniel Hyams
>> dh...@gm...
>
>
>
>
> --
> Daniel Hyams
> dh...@gm...
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Pawel <pa...@gm...> - 2010年12月19日 01:05:06
Hi,
I am a new user of matplotlib so maybe my question is elementary, but 
have not been able to find an answer to my problem in the archive.
I would like to make a 2D plot of colored points of 3D data (clusters). 
My data looks like this:
11837.2120 -0.0858 2.0000
23975.2120 -0.0672 2.0000
37609.2120 -0.0306 2.0000
53263.9800 -0.0690 2.0000
72106.6760 0.2708 1.0000
92674.6760 -0.0129 3.0000
116758.676 -0.1245 3.0000
...
So I need to plot the first and second column as points on the x-y axis 
and color the points according to the numbers in the third column (which 
are integers ranging from 1 to5).
I'd appreciate any help. I realize something so typical should be 
somewhere in the documentation but I was not able to find it.
Thanks,
Paul
8 messages has been excluded from this view by a project administrator.

Showing results of 194

<< < 1 2 3 4 .. 8 > >> (Page 2 of 8)
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 によって変換されたページ (->オリジナル) /