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




Showing 9 results of 9

From: Michael D. <md...@st...> - 2009年06月14日 23:46:05
You might want to try setting the rcParam pdf.fonttype to 42 (i.e. 
TrueType mode), which will avoid font subsetting.
You may also want to try using the Ps backend, which does support 
Helvetica directly. matplotlib ships all of the "standard" Ps font 
metrics as part of matplotlib. Be sure to set ps.useafm to True.
Mike
On 06/14/2009 04:54 PM, per freem wrote:
> hello all,
>
> I make my figures in matplotlib and then output them (using savefig) 
> as .pdf. I am using Fedora linux.
>
> When I try to edit the font in the figure to Helvetica using 
> Illustrator, I cannot. i am able to select the fonts, e.g. labels on 
> the axes of the figure, but when i try to change the font it does not 
> work. apparently the font information has been lost.
>
> is there a way to make the .pdf file contain the font? or is the 
> solution to export it as a different file format (if so which)?
>
> p.s. i do not have helvetica on the system that generates the plots so 
> i cannot set it programmatically... this is why i export it using the 
> default matplotlib font and then try to edit it in illustrator.
>
> thanks.
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Michael D. <md...@st...> - 2009年06月14日 23:40:11
On 06/12/2009 05:27 PM, Zane Selvans wrote:
> If I set path.simplify: False, the shape of the gaps between the
> filled polygons does change. Instead of being irregular, it becomes
> an infinitessimally thin gap of uniform width, allowing the (in this
> case white) background to show through.
> 
Just to clarify, these backs only show with the Mac OS-X gui window, not 
with the PNG or PDF output (which are actually handled by the Agg and 
PDF backends respectively, and don't use the Cocoa/Quartz-specific code 
in the macosx backend).
If that's the case, I'll forward this thread to the attention of Michiel 
de Hoon, the author of the macosx backend.
As for path.simplify = True causing irregular gaps, that's my area, and 
I'll look into that further. path.simplify should not be creating 
visible artifacts (at least in raster images such as PNG), so that's a bug.
Cheers,
Mike
> In both of these cases (path.simplify: True|False), the PNG version of
> the same figures also show representations of these gaps which are
> identical to those which appear in the PDF (though obviously
> pixelated), so I don't think it's something that's wrong in the vector
> graphics code per se.
>
> Zane
>
> On Fri, Jun 12, 2009 at 11:46 AM, Michael Droettboom<md...@st...> wrote:
> 
>> Shot in the dark here, but what if you set the rcParam "path.simplify" to
>> False? There have been recent changes to that code.
>>
>> Also, since the Agg backend doesn't have an associated GUI, you need to use
>> the savefig() command and provide a filename, rather than using show().
>>
>> Cheers,
>> Mike
>>
>> Zane Selvans wrote:
>> 
>>> Um, yeah. So my response got bounced because of the attachment. Take 2:
>>>
>>> For some reason my script bombed when I switched to the Agg backend,
>>> trying to display to the screen (it said Figure has no method show())
>>>
>>> So I output the plot as both a PDF and a PNG (still having backend:
>>> agg in my rcfile) and in both of those cases, irregular gaps are
>>> visible between the polygons making up the filled contours. This
>>> wasn't the case with my previously installed setup. It looks as if
>>> for some reason the vertices of the filled polygons are being
>>> calculated differently from different sides of the same contour,
>>> leading to overlap in some places, and gaps in others. You can download
>>> the PDF version (in which the exact geometry is much clearer).
>>> from:
>>>
>>> http://zaneselvans.org/dropbox/LinDensity_Grid.pdf
>>>
>>> Zane
>>>
>>> On Fri, Jun 12, 2009 at 5:51 AM, Michael Droettboom<md...@st...>
>>> wrote:
>>>
>>> 
>>>> So you see this behavior if you switch to the Agg backend? That's the
>>>> backend used to generate the images in the gallery. If there's a
>>>> difference
>>>> there, that would seem to suggest some tweaking of the macosx backend
>>>> (which
>>>> is still relatively new) is in order.
>>>>
>>>> Mike
>>>>
>>>> Zane Selvans wrote:
>>>>
>>>> 
>>>>> I just installed the latest SciPy Superpack in order to get access to
>>>>> the scipy.spatial.KDTree class, and discovered that for some reason
>>>>> now when I use contourf() lines get drawn at the boundaries between
>>>>> the filled contours. Additionally, there is always a single vertical
>>>>> line crossing from each contour boundary to the next. I'm guessing
>>>>> that these are the edges of the filled polygons which are getting
>>>>> drawn. This behavior doesn't seem to be consistent with the
>>>>> contourf() documentation and when I run code in griddata_demo.py it
>>>>> doesn't come out looking like the picture in the documentation/example
>>>>> gallery...
>>>>>
>>>>> Is anyone else seeing this behavior? Is there a keyword I can use to
>>>>> force the edges of the polygons not to get drawn?
>>>>>
>>>>> This is on Mac OS X 10.5.7, with
>>>>> scipy.__version__ = 0.8.0.dev5635
>>>>> matplotlib.__version__ = 0.98.6svn
>>>>> numpy.__version__=1.4.0.dev6728
>>>>>
>>>>> As installed by superpack_2009年03月28日.sh
>>>>> from http://macinscience.org/?page_id=6
>>>>>
>>>>> using:
>>>>> backend: macosx
>>>>>
>>>>> Cheers,
>>>>> Zane
>>>>>
>>>>>
>>>>>
>>>>> 
>>>> --
>>>> Michael Droettboom
>>>> Science Software Branch
>>>> Operations and Engineering Division
>>>> Space Telescope Science Institute
>>>> Operated by AURA for NASA
>>>>
>>>>
>>>>
>>>> 
>>>
>>>
>>> 
>> --
>> Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>>
>> 
>
>
>
> 
From: Dave C. <cou...@ho...> - 2009年06月14日 21:32:05
Hi
I am developing on a Desktop install Ubuntu 9.04 machine with matplotlib 0.98.5.2, 
and running the scripts on a Server install Ubuntu 8.10 machine with matplotlib 0.98.3.
I have found that the X axis layout for the same script varies between the two machines.
Both have standard matplotlib installs using apt-get. I haven't made any tweaks.
Rather than go into great detail about the problem, please see the script below and links to the resulting png files.
I hope the png files tell the story.
http://waka.freehostia.com/python/date_axis_scaling_test.py
http://waka.freehostia.com/python/date_axis_scaling_test_0_98_3.png
http://waka.freehostia.com/python/date_axis_scaling_test_0_98_5_2.png
The plot produced by matplotlib 0.98.3 isn't what I want.
Id like the plot to go edge to edge on the x axis grid, as the matplotlib 0.98.3 version does.
Help and advise would be appreciated.
PS : I'm new to python & matplotlib 
######################################################################################
#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
version = matplotlib.__version__
HOURSBACK = 365 * 24
now = datetime.now()
valueList = []
dateList = []
for i in range(HOURSBACK):
 hoursBack = timedelta( hours = (HOURSBACK - i) )
 then = now - hoursBack
 valueList.append( i )
 dateList.append( then )
fig = plt.figure( figsize=(12, 9), dpi=100 )
ax = fig.add_subplot(111)
ax.plot(dateList, valueList)
plt.title('Date axis scaling test for matplotlib version : %s' % ( version ) )
plt.grid(True)
plt.ylabel('Widgets')
plt.xlabel('Date')
fig.autofmt_xdate()
plt.savefig( "date_axis_scaling_test_%s.png" % version.replace('.','_'), format='png' ) 
quit()
######################################################################################
_________________________________________________________________
Get the best of MSN on your mobile
http://clk.atdmt.com/UKM/go/147991039/direct/01/ 
From: per f. <per...@gm...> - 2009年06月14日 20:55:36
hello all,
I make my figures in matplotlib and then output them (using savefig) as
.pdf. I am using Fedora linux.
When I try to edit the font in the figure to Helvetica using Illustrator, I
cannot. i am able to select the fonts, e.g. labels on the axes of the
figure, but when i try to change the font it does not work. apparently the
font information has been lost.
is there a way to make the .pdf file contain the font? or is the solution to
export it as a different file format (if so which)?
p.s. i do not have helvetica on the system that generates the plots so i
cannot set it programmatically... this is why i export it using the default
matplotlib font and then try to edit it in illustrator.
thanks.
From: John H. <jd...@gm...> - 2009年06月14日 17:11:57
On Fri, Jun 12, 2009 at 6:44 PM, Christoph Gohlke<cg...@uc...> wrote:
> Here are the Windows installer and egg produced by "setup.py bdist_wininst"
> respectively "setupegg.py bdist_egg":
Thanks Christoph -- I've uploaded these to the sf site. After the
next trunk release, I may ask you again to provide some visual studio
builds if you have the time, since the mingw/python2.6 problems have
not been solved yet.
JDH
From: John H. <jd...@gm...> - 2009年06月14日 17:09:42
The windows binaries for the latest matplotlib release are now
available for download at
 https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
for python2.5 and 2.6 (if you need 2.4 please respond here). Sorry
for the delay, but we hit a nasty python2.6/libpng/mingw that held us
up. Thanks to Christoph Gohlke
for the visual studio builds and Charlie Moad for the MingW framework.
Please let us know if you have any troubles.
JDH
From: Sebastian B. <web...@th...> - 2009年06月14日 14:06:18
Attachments: signature.asc tex_demo.py
Hey everyone,
this is more a how-to / feature request than a question... Normally, my
workflow for embedding images in LaTeX is as follows:
1) produce ps-file
2) use pstoedit (xfig) to separate text/math (LaTeX-typesettable) from
the image
3) save as pdf_t and pdf, respectively
4) \input this in the LaTeX document -- pdflatex will then set the text
at every compilation.
This has the advantage that I can change fonts etc without having to
redo all the figures.
I was trying to do so with matplotlib 0.98.3 and pstoedit 3.45 on a
64bit Ubuntu 8.10. I followed the instructions in the matplotlib
cookbook but kept experiencing problems when calling pstoedit [1], the
xlabels and ylabels were somehow converted to Courier but not put in the
"text" part, "." would become ":" and so on.
Solution brought this thread
http://www.nabble.com/Switching-between-different-font-settings-ts21279388.html
which suggested using OldScalarFormatter (thanks at this point also from
my side, Jouni) -- which works, see attached example.
So much for the "how-to-part" -- obviously, my suggestion is now to not
force users to have math-labels. I have to admit that I am not aware of
the drawbacks of OldScalarFormatter, but alone the name makes me think
that it might be not the best solution...
Thanks and best regards,
Sebastian.
P.S.: why actually does
ax.yaxis.get_ticklabels()[1].get_text()
return an empty string when called before savefig?
P.P.S.: I expect to be offline several days, so please excuse me if I
won't be answering timely.
[1]
pstoedit: version 3.45 / DLL interface 108 (build Jun 17 2008 - release
build - g++ 4.3.1) : Copyright (C) 1993 - 2007 Wolfgang Glunz
Warning: Level 2 version of image and imagemask not supported for this
backend (due to lack of support for bitmaps on intermediate files)
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font MCSZLR+CMMI12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font MCSZLR+CMMI12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font MCSZLR+CMMI12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font MCSZLR+CMMI12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
Warning, unsupported font MCSZLR+CMMI12, using Courier instead.
Warning, unsupported font YBFHZA+CMR12, using Courier instead.
From: Steve N. <ema...@ya...> - 2009年06月14日 03:32:42
Thanks John. This doesn't seem to be the cause of my problem, but I appreciate the correction. I wasn't aware that this was such bad practice. I guess it is better to import numpy and matplotlib functions separately then? 
Thanks again
--- On Fri, 6/12/09, John Hunter <jd...@gm...> wrote:
From: John Hunter <jd...@gm...>
Subject: Re: [Matplotlib-users] MPL with PyQt: different behavior on Windows vs. Linux
To: "Steve Nicholes" <ema...@ya...>
Cc: mat...@li...
Date: Friday, June 12, 2009, 7:02 AM
On Wed, Jun 10, 2009 at 12:55 AM, Steve
Nicholes<ema...@ya...> wrote:
> Thanks John. I hope you aren't receiving this reply twice (my email kicked
> me out when I hit send). I actually am importing pylab so it isn't an
> entirely qt app. I didn't post all of the code originally b/c it is long
> (and it would reveal how poor of a programmer I am :) ), but here are the
> relevant sections. The problematic section is in blue. Please let me know
> if you need anything else.
Importing pylab or pyplot into a GUI app is simply not supported.
There is never a reason to do it, and it is fraught with perils. I
don't know if this has anything to do with the problem you are
experiencing, but you need to remove these imports before we can
proceed.
JDH
 
From: Steve N. <ema...@ya...> - 2009年06月14日 03:29:33
Thanks for the tip Darren. Adding this line seems to have done the trick! Very much appreciated.
--- On Fri, 6/12/09, Darren Dale <dsd...@gm...> wrote:
From: Darren Dale <dsd...@gm...>
Subject: Re: [Matplotlib-users] MPL with PyQt: different behavior on Windows vs. Linux
To: "Steve Nicholes" <ema...@ya...>
Cc: mat...@li...
Date: Friday, June 12, 2009, 6:24 AM
On Tue, Jun 9, 2009 at 6:17 PM, Steve Nicholes <ema...@ya...> wrote:
Hi,
I am writing some code for automated testing via GPIB using MPL and PyQt. To simulate automated data collection while debugging the program, I have added a for loop (see below) after reading in a data file that plots each point one by one. When I run the program in Linux, I see each point appear on the canvas one by one as designed, but when I run the same code in Windows, nothing shows up on the canvas during the for loop. Instead, once the loop has completed, all points appear simulataneously. Is there any reason the why calls to canvas.draw() show nothing when run in Windows? 
I have seen similar discrepancies between PyQt4 behavior on linux and windows in a few situations. In my experience, a call to PyQt4.QtGui.qApp.processEvents() is sufficient to force an update in your view.
Darren
 

Showing 9 results of 9

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