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

Showing results of 57

1 2 3 > >> (Page 1 of 3)
From: LUK S. <shu...@po...> - 2004年01月31日 08:13:58
John Hunter wrote:
> http://matplotlib.sourceforge.net
> 	
> What's new in matplotlib 0.42
> 
> EPS output from PS backend
> 
> Just add an eps extension
> 
> PS and EPS save from GTK and WX backends with bugs fixed
> 
[snipped]
Thanks very much. I did an upgrade via CVS and the eps output works fine.
A slight glitch though. I think John has changed the AFMPATH
environmental variable to MATPLOTLIBDATA (which is a more appropriate
name) so people installing matplotlib in non-default places will have to
set it instead.
Regards,
ST
--
From: Flavio C. C. <fcc...@ci...> - 2004年01月31日 05:59:20
Hi John,
What do you think of adding a button to the standara toolbar allowing 
the plotted data to be save in CSV format?
It woul be very convenient when the user wants to take the data to 
another plotting program, and the plot is a good place to save because 
the data is already sorted out. In some types of plots such as the 
histogram, the plot woul allow for saving the actual data that 
represents the histogram (such as class intervals or mid points and 
frequencies) instead of the raw data.
What do you think?
Talking about plots, I am writing a module to calculate Kernel density 
estimates (a kind of continuous histogram) would you be interested in 
adding it to matplotlib?
cheers,
Flavio
From: LUK S. <shu...@po...> - 2004年01月31日 03:51:13
John Hunter wrote:
> http://matplotlib.sourceforge.net
> 	
> What's new in matplotlib 0.42
> 
> EPS output from PS backend
> 
> Just add an eps extension
> 
> PS and EPS save from GTK and WX backends with bugs fixed
> 
[snipped]
Thanks very much. I did an upgrade via CVS and the eps output works fine.
A slight glitch though. I think John has changed the AFMPATH 
environmental variable to MATPLOTLIBDATA (which is a more appropriate 
name) so people installing matplotlib in non-default places will have to 
set it instead.
Regards,
ST
--
From: John H. <jdh...@ac...> - 2004年01月31日 03:47:10
>>>>> "LUK" == LUK ShunTim <shu...@po...> writes:
 LUK> A slight glitch though. I think John has changed the AFMPATH
 LUK> environmental variable to MATPLOTLIBDATA (which is a more
 LUK> appropriate name) so people installing matplotlib in
 LUK> non-default places will have to set it instead.
ps backend is setup to use both, the idea that you may have some AFM
files independent of matplotlib, and some that ship with matplotlib.
The MATPLOTLIBDATA is indeed for people installing in nonstandard
places. But if AFMPATH is not working for you, I need to know since
this is a bug.
Thanks!
John Hunter
From: John G. <jn...@eu...> - 2004年01月31日 00:23:23
First of all, thanks for matplotlib. 
This is far and away the best python plotting package I have come
across.
I've attached a patch for axes.py that allows 'stacked bar charts' to be
produced using the bar function.
The idea with a stacked bar chart is that you have several series of
data that naturally stack up on top of each other. You can achieve
this effect with a small fix to the bar function. All you have to do is
to specify the offsets along the y-axis for each value being plotted (by
default these offsets would be all zero, equivalent to the existing
function).
See stacked_bar.py for an example of how you might use this.
The patch adds an extra keyword arguement , yoff, to plot.
This allows you to supply a list of offsets for the values to be
plotted.
Using this you can 'stack' up results by using successive calls to bar,
so long as you are careful to get the offsets right.
John
From: Jean-Baptiste C. <Jea...@de...> - 2004年01月30日 23:16:11
S=E6ll !
I am trying to plot very small number for the Y-axis on semilogy but they d=
o not appear at all unless one of the value is higher
Moreover the labels on the Y axis become 0 below 0.001
>> semilogy([1.0, 2.3, 3.3],[9.4e-05, 9.4e-05, 9.4e-05]) <-- does not =
work
[<matplotlib.lines.Line2D instance at 0x935255c>]
>> semilogy([1.0, 2.3, 3.3],[9.4e-04, 9.4e-05, 9.4e-05])	<--- work
[<matplotlib.lines.Line2D instance at 0x940e964>]
Should I use a specific "long" definition of my floating number ?
Takk
Jean-Baptiste
--=20
-----------------------------
Jea...@de...
Department of Statistics
deCODE genetics Sturlugata,8
570 2993 101 Reykjav=EDk
From: John H. <jdh...@ac...> - 2004年01月30日 21:37:37
I've spent the last couple of days refactoring the matplotlib
backends, fixing bugs and adding some functionality. Here's a
synopsis of what's new. I encourage everyone to try it out so
complaints and bugs can be handled before the major release.
** Note there are some API changes so please read about this below **
** Note, GD users, GD rendering is significantly improved in my
 opinion. However, some of new functionality requires a recent
 version of gd and a patch of the latest gdmodule, see below **
What's new in matplotlib 0.50e
 GD supports clipping and antialiased line drawing. The line object
 has a new 'antialiased' property, that if true, the backend will
 render the line antialiased if supported. **You will need to
 upgrade to gd-2.0.15 or later and gdmodule-0.51. You will also need
 to replace _gdmodule.c with the code as described at
 http://matplotlib.sourceforge.net/backends.html#GD.
wild and wonderful bar charts
 You can provide an optional argument 'bottom' to the bar command to
 determine where the bottom of each bar is, default 0 for all. This
 enables stacked bar plots and candelstick plots --
 examples/bar_stacked.py. Thanks to David Moore and John Gill for
 suggestions and code.
Bugfixes (by backend)
 * All : the yticks on the right hand side were placed incorrectly,
 now fixed
 * All : ticklabels now make a more intelligent choice about how
 many significant digits to display
 * GD : An int truncation bug was causing the dotted lines to
 disappear
 * GD and GTK : Fixed line width to scale with DPI
 * GD : Fixed small text layout bug
 * GD : Fixed the constant for GD which maps pixels per inch - this
 should give better agreement with other backends witht he
 relative sizes of objects
 * GTK : Dash spacing was not properly scaling with DPI
Figure backend refactored
 The figure functionality was split into a backend independent
 component Figure and a backend dependent component
 FigureCanvasBase. This completes the transition to a totally
 abstract figure interface and improves the ability the switch
 backends. See the file
 http://matplotlib.sourceforge.net/API_CHANGES that comes with the
 src distro for information on migrating applications to the new API.
 All the backend specific examples have been updated to the new API.
Enjoy,
John Hunter
From: John H. <jdh...@ac...> - 2004年01月30日 18:05:32
>>>>> "Nils" == Nils Wagner <nw...@me...> writes:
 Nils> ~/cvs/matplotlib/htdocs> /usr/bin/python process_docs.py
 Nils> Converting matplotlib.afm.html to template Converting
 Nils> matplotlib.artist.html to template Converting
 Nils> matplotlib.axes.html to template Converting
 Nils> matplotlib.axis.html to template Converting
 Nils> matplotlib.backend_bases.html to template Converting
 Nils> matplotlib.backends.backend_gd.html to template Traceback
 Nils> (most recent call last): File "process_docs.py", line 28, in
 Nils> ? s = file('../docs/' + fname).read() IOError: [Errno 2] No
 Nils> such file or directory:
 Nils> '../docs/matplotlib.backends.backend_gd.html'
Are you aware that the htdocs build the matplotlib web page, which can
be found at http://matplotlib.sourceforge.net. In other words, unless
you want to edit the web page docs, there is not much need to build
them yourself since they are available online.
If all you want is the pydoc documentation, this is online at
 http://matplotlib.sourceforge.net/matlab_commands.html and
 http://matplotlib.sourceforge.net/classdocs.html
If you really want to build the html docs yourself, from your error
message it looks like you do not have gd module properly installed.
Can you do this?
 >> import matplotlib
 >> matplotlib.use('GD')
 >> from matplotlib.matlab import *
If not, then GD is not installed properly and you need to follow the
install instructions at
http://matplotlib.sourceforge.net/backends.html#GD.
You will need to have all backends working before you can build the
htdocs.
One last word of warning, since you are building htdocs, you are using
CVS, right? CVS has undergone a lot of changes in the last 2 days,
particularly the GD backend, and if you have the latest CVS version,
GD won't run properly without a patched gdmodule. Stay tuned for
another post with all the required info for using the latest CVS.
JDH
From: Nils W. <nw...@me...> - 2004年01月30日 17:56:19
~/cvs/matplotlib/htdocs> /usr/bin/python process_docs.py
 Converting matplotlib.afm.html to template
 Converting matplotlib.artist.html to template
 Converting matplotlib.axes.html to template
 Converting matplotlib.axis.html to template
 Converting matplotlib.backend_bases.html to template
 Converting matplotlib.backends.backend_gd.html to template
Traceback (most recent call last):
 File "process_docs.py", line 28, in ?
 s = file('../docs/' + fname).read()
IOError: [Errno 2] No such file or directory:
'../docs/matplotlib.backends.backend_gd.html'
From: LUK S. <shu...@po...> - 2004年01月30日 16:14:43
John Hunter wrote:
>>>>>>"LUK" == LUK ShunTim <shu...@po...> writes:
> 
> 
> LUK> Yes. I did "python log_demo.py", got the gtk GUI and clicked
> LUK> on the "save" icon to produce the eps file. So it is as you
> LUK> said, it comes from the GUI backend. No warning when I did
> LUK> "python log_demo.py -dPS"
> 
> OK, now we at least know where the problem is. I don't get such an
> error message on my system (rhl9, pygtk-2.0.0). What platform are you
> on, and what versions of GTK and pygtk are you running?
> 
> JDH
> 
> 
> 
W2K, Enthought python 2.3, pygtk 2.0, gtk 2.0
Regards,
ST
From: John H. <jdh...@ac...> - 2004年01月30日 16:00:31
>>>>> "LUK" == LUK ShunTim <shu...@po...> writes:
 LUK> Yes. I did "python log_demo.py", got the gtk GUI and clicked
 LUK> on the "save" icon to produce the eps file. So it is as you
 LUK> said, it comes from the GUI backend. No warning when I did
 LUK> "python log_demo.py -dPS"
OK, now we at least know where the problem is. I don't get such an
error message on my system (rhl9, pygtk-2.0.0). What platform are you
on, and what versions of GTK and pygtk are you running?
JDH
From: LUK S. <shu...@po...> - 2004年01月30日 15:47:22
John Hunter wrote:
>>>>>>"LUK" == LUK ShunTim <shu...@po...> writes:
> 
> LUK> ** (log_demo.py:1264): WARNING **: Couldn't load font "Times
> LUK> 9.599609375" falling back to "Sans 9.599609375"
> 
> LUK> CVS.
> 
> Are you sure you are getting this message from the PS backend??? This
> looks more like a message coming from one of the GUI backends. I
> don't generate any error messages like this in matplotlib.
> 
> With a fresh cvs checkout:
> 
> hunter:~/tmp/matplotlib> grep -ri 'falling back to' .
> 
> turns up nothing.
> 
> JDH
> 
> 
> 
> 
Yes. I did "python log_demo.py", got the gtk GUI and clicked on the "save" icon 
to produce the eps file. So it is as you said, it comes from the GUI backend. No 
warning when I did "python log_demo.py -dPS"
Regards,
ST
--
From: John H. <jdh...@ac...> - 2004年01月30日 15:30:52
>>>>> "LUK" == LUK ShunTim <shu...@po...> writes:
 LUK> ** (log_demo.py:1264): WARNING **: Couldn't load font "Times
 LUK> 9.599609375" falling back to "Sans 9.599609375"
 LUK> CVS.
Are you sure you are getting this message from the PS backend??? This
looks more like a message coming from one of the GUI backends. I
don't generate any error messages like this in matplotlib.
With a fresh cvs checkout:
hunter:~/tmp/matplotlib> grep -ri 'falling back to' .
turns up nothing.
JDH
From: LUK S. <shu...@po...> - 2004年01月30日 14:54:15
John Hunter wrote:
>>>>>>"LUK" == LUK ShunTim <shu...@po...> writes:
> 
> 
> LUK> I have tex installed so I hope I can use quite a lot more
> LUK> fonts now. Is the path to the .afm files all that is needed?
> LUK> Do I have to set anything else, for example where to find the
> LUK> pfa/pfb files? I found that matplotlib spits out warnings
> LUK> like
> 
> All matplotlib needs is the *.afm files. It uses this to compute text
> lengths, etc, for layout. You'll just need to provide the right font
> names to the text commands, perhaps using a font dictionary as in
> examples/text_themes.py. Your postscript output device will still
> need to know about the fonts of course. Note that I use a custom font
> matching scheme in backend_ps and I certainly don't claim that it is
> ideal. So if you encounter strange behavior, let me know.
> 
> LUK> ** (log_demo.py:1264): WARNING **: Couldn't load font "Times
> LUK> 9.599609375" falling back to "Sans 9.599609375"
> 
> This doesn't look like a backend_ps error. Have you upgraded to
> matplotlib-0.42.2? I've reworked text handling in the backends so
> it's hard for me to compare what I've got now without knowing what
> version of matplotlib you're using.
> 
> JDH
> 
CVS.
ST
From: John H. <jdh...@ac...> - 2004年01月30日 14:08:07
>>>>> "LUK" == LUK ShunTim <shu...@po...> writes:
 LUK> I have tex installed so I hope I can use quite a lot more
 LUK> fonts now. Is the path to the .afm files all that is needed?
 LUK> Do I have to set anything else, for example where to find the
 LUK> pfa/pfb files? I found that matplotlib spits out warnings
 LUK> like
All matplotlib needs is the *.afm files. It uses this to compute text
lengths, etc, for layout. You'll just need to provide the right font
names to the text commands, perhaps using a font dictionary as in
examples/text_themes.py. Your postscript output device will still
need to know about the fonts of course. Note that I use a custom font
matching scheme in backend_ps and I certainly don't claim that it is
ideal. So if you encounter strange behavior, let me know.
 LUK> ** (log_demo.py:1264): WARNING **: Couldn't load font "Times
 LUK> 9.599609375" falling back to "Sans 9.599609375"
This doesn't look like a backend_ps error. Have you upgraded to
matplotlib-0.42.2? I've reworked text handling in the backends so
it's hard for me to compare what I've got now without knowing what
version of matplotlib you're using.
JDH
From: LUK S. <shu...@po...> - 2004年01月30日 13:57:57
John Hunter wrote:
>>>>>>"LUK" == LUK ShunTim <shu...@po...> writes:
> 
> 
> LUK> A slight glitch though. I think John has changed the AFMPATH
> LUK> environmental variable to MATPLOTLIBDATA (which is a more
> LUK> appropriate name) so people installing matplotlib in
> LUK> non-default places will have to set it instead.
> 
> ps backend is setup to use both, the idea that you may have some AFM
> files independent of matplotlib, and some that ship with matplotlib.
> The MATPLOTLIBDATA is indeed for people installing in nonstandard
> places. But if AFMPATH is not working for you, I need to know since
> this is a bug.
> 
> Thanks!
> John Hunter
> 
I think that's an oversight of mine. I had AFMPATH set to point to the directory 
which holds the afm, xpm files etc before I upgrade. After upgrading I got the 
error described above and I found out that I have to set MATPLOTLIBDATA. I did 
not realize that AFMPATH is *still* used.
I have tex installed so I hope I can use quite a lot more fonts now. Is the path 
to the .afm files all that is needed? Do I have to set anything else, for 
example where to find the pfa/pfb files? I found that matplotlib spits out 
warnings like
** (log_demo.py:1264): WARNING **: Couldn't load font "Times 9.599609375"
falling back to "Sans 9.599609375"
Regards,
ST
From: Kuzminski, S. R <SKu...@fa...> - 2004年01月29日 12:20:11
Some notes on compiling GD backend for windows.
1) _gdmodule.c needs to be modified in 2 places to compile on windows=20
	a) line 1888 PyObject_HEAD_INIT() needs to passed a NULL. This
is in the Python docs.
=09
....
	static PyTypeObject Imagetype =3D {
 		PyObject_HEAD_INIT(NULL)
 		0, /*ob_size*/
....
	b) the init_gd function ( line 1957 ) needs to have
'_declspec(dllexport)' added to the declaration.=20
.....
/* Initialization function for the module (*must* be called init_gd) */
void _declspec(dllexport) init_gd(void)
{=20
....
2) This one took me a long time to figure out. For some reason opening
a windows file in Python with 'wb' permission will cause the png files
to be corrupted above a certain image size. If you pass the filename to
gdmodule, then the gdmodule opens the file and it works. I imagine that
the python call "open( 'filename', 'wb' )" just calls fopen, furthermore
I thought that binary mode only applied to reading files. At any rate,
I have no idea why this doesn't work in this case but it doesn't. To
get it to work, I had to change line 261 in backends_gd.py to pass the
filename rather than a file object, this is the only modification to
Matplotlib I had to make.
 im.writePng( filename )
#2 above is the answer to the problem in my original post. However I
have another question. When I set the ylabel rotation to be horizontal,
the beginning of the text is truncated ( the width of the border does
not compensate ). I'm happy to set it wider but am wondering how ( what
controls the width of the area where the labels gets written ). I also
noticed that title of the graph ( with the horizontal alignment set to
bottom ) is too close to the top of the graph itself, is there a way to
pad that?
thanks,
Stefan
-----Original Message-----
From: John Hunter [mailto:jdh...@ni...]=20
Sent: Friday, January 23, 2004 6:58 AM
To: Kuzminski, Stefan R
Cc: mat...@li...
Subject: Re: [Matplotlib-users] broken PNG files with GD backend
>>>>> "Kuzminski," =3D=3D Kuzminski, Stefan R <SKu...@fa...>
writes:
 Kuzminski> Now on to my specific problem. I'm using the GD
 Kuzminski> backend on Windows with Matplotlib 0.41. =20
First things first -- I haven't succeeded in getting the gd backend
compiled on windows. If you have some expertise here and are willing
to share, or better yet build a gdmodule and gd installer that I can
put on the website, I would be very much obliged! I contacted the
gdmodule maintainer some time ago over this issue and he had never
built it on windows either. In my googling, I discovered the perl gd
module for windows and following their lead, succeeded in building gd
lib, but ran into some troubles (can't remember what) building
gdmodule.
 Kuzminski> If I set the dpi to over 60 the png file that gets
 Kuzminski> generated is 'empty', it's only 17 bytes long. As soon
 Kuzminski> as I drop he DPI to below 65 or so, I get the image
 Kuzminski> file correctly. This is with the simple_plot.py
 Kuzminski> example.
Now on to your problem. Is there a typo here? You say over 60 is
empty and under 65 is ok ?? Can you send me a script which replicates
the problem, with the two calls to savefig, one which has the problem
and which does not. Then I can begin to diagnose the problem; see if
it occurs under linux, see if it's a gd problem, see if it's a problem
on my end, etc....
Are you using matplotlib + GD for a web app server? =20
John Hunter=20
=20
From: Kuzminski, S. R <SKu...@fa...> - 2004年01月29日 07:08:53
The windows GD build is bear. I had it completely working, then I
upgraded to 0.41 and took a few steps back. =20
First a little background. I'm building a reporting tool for a
commercial analytics platform. This tool takes an XML specification and
data, and outputs HTML tables and plots. The larger platform is all
Java, I am providing the reporting as an stand alone ( Python )
executable on Win32, Linux and Solaris. So my overall requirements are
to create HTML ( and hence .png images ) on all three platforms with a
distribution of a single binary file ( one for each platform ).
Here are some quick notes on what I have had to do, once it is working,
I will provide at least the MSVC makefiles an maybe a binary build, time
permitting. =20
the GD backend has these dependencies..
libpng
zlib
gd
freetype
gdmodule
The 2 main problems I seem to have are that the dll release of GD does
not include a gd.lib. ( MSVC needs a .lib to link with a .dll ) GD does
not seem to come with a windows make file, so I made one. =20
The other problem is that _gdmodule.c needs to have line 1882 changed to
pass a NULL to PYObject_HEAD_INIT=20
...
static PyTypeObject Imagetype =3D {
 PyObject_HEAD_INIT(NULL)
...
I am working on this currently and will post more results as I get them.
thanks,
Stefan
-----Original Message-----
From: John Hunter [mailto:jdh...@ni...]=20
Sent: Friday, January 23, 2004 6:58 AM
To: Kuzminski, Stefan R
Cc: mat...@li...
Subject: Re: [Matplotlib-users] broken PNG files with GD backend
>>>>> "Kuzminski," =3D=3D Kuzminski, Stefan R <SKu...@fa...>
writes:
 Kuzminski> Now on to my specific problem. I'm using the GD
 Kuzminski> backend on Windows with Matplotlib 0.41. =20
First things first -- I haven't succeeded in getting the gd backend
compiled on windows. If you have some expertise here and are willing
to share, or better yet build a gdmodule and gd installer that I can
put on the website, I would be very much obliged! I contacted the
gdmodule maintainer some time ago over this issue and he had never
built it on windows either. In my googling, I discovered the perl gd
module for windows and following their lead, succeeded in building gd
lib, but ran into some troubles (can't remember what) building
gdmodule.
 Kuzminski> If I set the dpi to over 60 the png file that gets
 Kuzminski> generated is 'empty', it's only 17 bytes long. As soon
 Kuzminski> as I drop he DPI to below 65 or so, I get the image
 Kuzminski> file correctly. This is with the simple_plot.py
 Kuzminski> example.
Now on to your problem. Is there a typo here? You say over 60 is
empty and under 65 is ok ?? Can you send me a script which replicates
the problem, with the two calls to savefig, one which has the problem
and which does not. Then I can begin to diagnose the problem; see if
it occurs under linux, see if it's a gd problem, see if it's a problem
on my end, etc....
Are you using matplotlib + GD for a web app server? =20
John Hunter=20
=20
From: John H. <jdh...@ac...> - 2004年01月27日 18:35:44
 http://matplotlib.sourceforge.net
 	
What's new in matplotlib 0.42
EPS output from PS backend
 Just add an eps extension
PS and EPS save from GTK and WX backends with bugs fixed
 A few of the bugs that were lingering in the PS output from the GTK
 backend have been cleared up. A fairly substantial refactoring of
 the Text class enabled this. Text is now backend independent and
 behaves like the other artists in the figure (lines, patches,
 etc). Additionally, PS and EPS save from WX backend work
Object picker example
 The file examples/object_picker.py is a template showing how to
 select objects in the figure with the mouse(eg, text, lines). If you
 click on the line, a properties dialog will pop up. You can edit the
 line properties. This is just a template for those who want to
 develop a GUI properties dialog. If interested, contact the mailing
 list. It would be straight forward to extend this example to allow
 you to move objects in the figure, etc
From: John H. <jdh...@ac...> - 2004年01月26日 21:38:53
>>>>> "matthew" == matthew arnison <ma...@ca...> writes:
 matthew> * when saving from the GTK window into a .ps file, the
 matthew> lines are not clipped by the edge of the plot area: see
 matthew> the top left plot in the attached code
I've made a number of changes to matplotlib to improve the PS
functionality -- those of you who are interested should take this
version for a test drive and let me know of any problems so I can fix
them for the next release.
 http://nitace.bsd.uchicago.edu:8080/files/share/matplotlib-0.42g.tar.gz
Note WX is not working (but will be soon) with this snapshot so wx
users please do not download.
Added:
 * I think I've fixed all the backend switching problems, you can now
 output PS from the GTK backend by adding the PS extension. This
 will be available in WX soon. Let me know if you find any
 lingering bugs.
 * EPS (at long last!). Just use an 'eps' extension and the bounding
 box will be added to the PS output. 
 matthew> * xaxis and yaxis labels often land on top of adjacent
 matthew> subplot titles and plot areas in savefig('blah.ps')
 matthew> output (I've had trouble with this in the -dPS output
 matthew> too)
Yep, axes don't communicate with one another for text layout. A few
things which you can do to help
 1) Turn off redundant x labels. If 2 subplots use the same x axis,
 turn off the tick labels in all but the lower one with 
 set(gca(), 'xticklabels', [])
 2) Make the tick labels and titles smaller
 t = get(gca(), 'xticklabels')
 set(t, 'fontsize', 8)
 t = title('my title')
 set(t, 'fontsize', 10)
 3) control the placement of the title manually
 t = title('my title')
 t.set_y(0.95)
 1.0 is the top of the y axis. 1.02 is the default. Numbers less
 than 1 will be below the y axis. Eg, to make the title top
 aligned and below the top of the y axis, do
 t = title('my title', verticalalignment='top')
 t.set_y(0.99)
I'm open to suggestions for changing the defaults (eg making the
default fonts smaller) if people are having these kinds of problems
regularly.
JDH 
From: John H. <jdh...@ac...> - 2004年01月26日 21:24:18
>>>>> "John" == John Hunter <jdh...@ac...> writes:
 Kuzminski> #2 above is the answer to the problem in my original
 Kuzminski> post. However I have another question. When I set the
 Kuzminski> ylabel rotation to be horizontal, the beginning of the
 Kuzminski> text is truncated ( the width of the border does not
 Kuzminski> compensate ). I'm happy to set it wider but am
 Kuzminski> wondering how ( what controls the width of the area
 Kuzminski> where the labels gets written ). 
In this case the placement of the ylabel is determined by the
horizontalalignment and the left side of the y tick labels. If it is
being truncated, you have a few choices.
 1) Use a different alignment or smaller fontsize for the label
 2) Use a smaller font size for the y tick labels or turn them off
 entirely -- the position of the ylabel will automatically adjust
 based upon the size of the tick labels.
 3) Probably best, make a custom axes where the 'left' parameter is
 larger and the width parameter is smaller. This will give you
 more room for your ylabel.
 Kuzminski> I also noticed that title of the graph ( with the
 Kuzminski> horizontal alignment set to bottom ) is too close to
 Kuzminski> the top of the graph itself, is there a way to pad
 Kuzminski> that?
When you set the title, do
 t = title('my title')
 t.set_y(1.05) # relative axes coords
1.0 is the top of the axes, so the larger the number the higher the
title will be. 1.02 is the default.
Hope this helps,
JDH
From: John H. <jdh...@ac...> - 2004年01月26日 06:30:00
>>>>> "Kuzminski," == Kuzminski, Stefan R <SKu...@fa...> writes:
 Kuzminski> I attached a '_gd.dll'. This is the C python
 Kuzminski> extension that the gd.py module from gdmodule imports.
 Kuzminski> It goes directly in site-packages. I built it
 Kuzminski> statically linked to zlib, libpng, freetype and the gd
 Kuzminski> lib. I don't have the time at the moment to fuss with
 Kuzminski> getting it to use the dlls. ( or to add the jpeg
 Kuzminski> support ) The precompiled windows GD dll in particular
 Kuzminski> seems to not export a few functions that gdmodule
 Kuzminski> wants which is a real pain.
Excellent, the easier the better...
 Kuzminski> 2) This one took me a long time to figure out. For
 Kuzminski> some reason opening a windows file in Python with 'wb'
 Kuzminski> permission will cause the png files to be corrupted
 Kuzminski> above a certain image size. If you pass the filename
 Kuzminski> to gdmodule, then the gdmodule opens the file and it
 Kuzminski> works. I imagine that the python call "open(
 Kuzminski> 'filename', 'wb' )" just calls fopen, furthermore I
 Kuzminski> thought that binary mode only applied to reading
 Kuzminski> files. At any rate, I have no idea why this doesn't
 Kuzminski> work in this case but it doesn't. To get it to work,
 Kuzminski> I had to change line 261 in backends_gd.py to pass the
 Kuzminski> filename rather than a file object, this is the only
 Kuzminski> modification to Matplotlib I had to make.
Could be that I don't have the text bounding boxes exactly right in
gdmodule. In axes.py there is a line on or around line 454
if 0:
if you replace that with 
if 1:
the text bounding boxes will be displayed. If they are not exactly
right, then the text layout will also be off. I'll take a look when I
get some time, but in the mean time you may want to see for yourself.
Re: gdmodule on windows. What did you do for fonttools? Did you also
build this yourself? If I recall correctly I built it once on windows
without too much difficulty (back when I was trying to get gd working
on windows) but it's been a while and I didn't keep notes. I didn't
see an installer on the sf site.
JDH
 Kuzminski> im.writePng( filename )
 Kuzminski> #2 above is the answer to the problem in my original
 Kuzminski> post. However I have another question. When I set the
 Kuzminski> ylabel rotation to be horizontal, the beginning of the
 Kuzminski> text is truncated ( the width of the border does not
 Kuzminski> compensate ). I'm happy to set it wider but am
 Kuzminski> wondering how ( what controls the width of the area
 Kuzminski> where the labels gets written ). I also noticed that
 Kuzminski> title of the graph ( with the horizontal alignment set
 Kuzminski> to bottom ) is too close to the top of the graph
 Kuzminski> itself, is there a way to pad that?
 Kuzminski> thanks, Stefan
 Kuzminski> -----Original Message----- From: John Hunter
 Kuzminski> [mailto:jdh...@ni...] Sent:
 Kuzminski> Friday, January 23, 2004 6:58 AM To: Kuzminski, Stefan
 Kuzminski> R Cc: mat...@li... Subject:
 Kuzminski> Re: [Matplotlib-users] broken PNG files with GD
 Kuzminski> backend
>>>>> "Kuzminski," == Kuzminski, Stefan R <SKu...@fa...>
 Kuzminski> writes:
 Kuzminski> Now on to my specific problem. I'm using the GD
 Kuzminski> backend on Windows with Matplotlib 0.41.
 Kuzminski> First things first -- I haven't succeeded in getting
 Kuzminski> the gd backend compiled on windows. If you have some
 Kuzminski> expertise here and are willing to share, or better yet
 Kuzminski> build a gdmodule and gd installer that I can put on
 Kuzminski> the website, I would be very much obliged! I
 Kuzminski> contacted the gdmodule maintainer some time ago over
 Kuzminski> this issue and he had never built it on windows
 Kuzminski> either. In my googling, I discovered the perl gd
 Kuzminski> module for windows and following their lead, succeeded
 Kuzminski> in building gd lib, but ran into some troubles (can't
 Kuzminski> remember what) building gdmodule.
 Kuzminski> If I set the dpi to over 60 the png file that gets
 Kuzminski> generated is 'empty', it's only 17 bytes long. As soon
 Kuzminski> as I drop he DPI to below 65 or so, I get the image
 Kuzminski> file correctly. This is with the simple_plot.py
 Kuzminski> example.
 Kuzminski> Now on to your problem. Is there a typo here? You say
 Kuzminski> over 60 is empty and under 65 is ok ?? Can you send
 Kuzminski> me a script which replicates the problem, with the two
 Kuzminski> calls to savefig, one which has the problem and which
 Kuzminski> does not. Then I can begin to diagnose the problem;
 Kuzminski> see if it occurs under linux, see if it's a gd
 Kuzminski> problem, see if it's a problem on my end, etc....
 Kuzminski> Are you using matplotlib + GD for a web app server?
 Kuzminski> John Hunter
 
From: John H. <jdh...@ac...> - 2004年01月23日 15:36:35
>>>>> "Kuzminski," == Kuzminski, Stefan R <SKu...@fa...> writes:
 Kuzminski> Now on to my specific problem. I'm using the GD
 Kuzminski> backend on Windows with Matplotlib 0.41. 
First things first -- I haven't succeeded in getting the gd backend
compiled on windows. If you have some expertise here and are willing
to share, or better yet build a gdmodule and gd installer that I can
put on the website, I would be very much obliged! I contacted the
gdmodule maintainer some time ago over this issue and he had never
built it on windows either. In my googling, I discovered the perl gd
module for windows and following their lead, succeeded in building gd
lib, but ran into some troubles (can't remember what) building
gdmodule.
 Kuzminski> If I set the dpi to over 60 the png file that gets
 Kuzminski> generated is 'empty', it's only 17 bytes long. As soon
 Kuzminski> as I drop he DPI to below 65 or so, I get the image
 Kuzminski> file correctly. This is with the simple_plot.py
 Kuzminski> example.
Now on to your problem. Is there a typo here? You say over 60 is
empty and under 65 is ok ?? Can you send me a script which replicates
the problem, with the two calls to savefig, one which has the problem
and which does not. Then I can begin to diagnose the problem; see if
it occurs under linux, see if it's a gd problem, see if it's a problem
on my end, etc....
Are you using matplotlib + GD for a web app server? 
John Hunter 
 
From: Kuzminski, S. R <SKu...@fa...> - 2004年01月23日 13:13:18
Hi,
=20
First off, a very nice piece of software, thanks for creating it. =20
=20
Now on to my specific problem. I'm using the GD backend on Windows with
Matplotlib 0.41. If I set the dpi to over 60 the png file that gets
generated is 'empty', it's only 17 bytes long. As soon as I drop he DPI
to below 65 or so, I get the image file correctly. This is with the
simple_plot.py example.=20
=20
Any help would be appreciated.
=20
thanks,
Stefan =20
=20
From: Nordquest, D. A <NOR...@ga...> - 2004年01月23日 01:14:21
Thanks, John & Randy. Matplotlib is working fine, now!
Dave Nordquest
2 messages has been excluded from this view by a project administrator.

Showing results of 57

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