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


Showing 4 results of 4

From: Paul B. <ba...@st...> - 2005年03月20日 15:08:01
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
 <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Yang Yang wrote:
<blockquote
 cite="mid...@ms..."
 type="cite">
 <meta http-equiv="Content-Type" content="text/html; ">
 <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
 <style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
 /* Page Definitions */
 @page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	layout-grid:15.6pt;}
div.Section1
	{page:Section1;}
-->
 </style>
 <div class="Section1" style="">
 <p class="MsoNormal"><font face="Arial" size="1"><span
 style="font-size: 9pt; font-family: Arial;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I
have a long annoying problem: how can I make the installer compile for
numarray
instead of Numeric? For compatibility reason I have both on my machine
and
prefer numarray (and an installer</span></font><font face="Wingdings"
 size="1"><span style="font-size: 9pt; font-family: Wingdings;"
 lang="EN-US">J</span></font><font face="Arial" size="1"><span
 style="font-size: 9pt; font-family: Arial;" lang="EN-US">).
It seems the installer detects the presence of Numeric prior to
numarray. Is
there any configuration available? Thanks.<o:p></o:p></span></font></p>
 </div>
</blockquote>
The matplotlib setup.py file looks for both Numeric and Numarray and
sets the build configuration to 'both', if you have them. This is your
situation, so you should have access to both of them. If it is not
finding Numarray, then you'll have to modify your PYTHONPATH variable
to point to the numarray library. Also make sure you have the numarray
include files.<br>
<br>
To use numarray, set the numerix keyword to numarray in your
.matplotlibrc file.<br>
<br>
&nbsp;-- Paul<br>
<pre class="moz-signature" cols="72">-- 
Paul Barrett, PhD Space Telescope Science Institute
Phone: 410-338-4475 ESS/Science Software Branch
FAX: 410-338-4767 Baltimore, MD 21218
</pre>
</body>
</html>
From: Ondrej C. <ond...@gm...> - 2005年03月20日 12:29:23
Hello,
in case someone has the same problem as me -- to display accented
letters in matplotlib -- this is how to do it:
#! /usr/bin/python
# -*- coding: iso-8859-2; -*-
import matplotlib
matplotlib.use('GTK')
from pylab import *
plot([1,2,3])
title(u'some accented letters: =C4=9B=C5=A1=C4=8D=C5=99=C5=BE=C3=BD=C3=A1=
=C3=A1=C3=AD=C3=A9')
#savefig("pokus.eps")
show()
Important is "use('GTK')" (Agg backend only shows rectangles instead of
accented letters) and "title(u'some..." (the "u" -- without it it
doesn't work either).
You can save the figure to *.png, unfortunately saving to *.eps or *.ps
doesn't work (even using different backend).
Ondrej Certik
From: Yang Y. <f-...@ms...> - 2005年03月20日 09:00:23
Hi,
 I have a long annoying problem: how can I make the installer
compile for numarray instead of Numeric? For compatibility reason I have
both on my machine and prefer numarray (and an installer:-)). It seems
the installer detects the presence of Numeric prior to numarray. Is
there any configuration available? Thanks.
=20
Cheers,
Yang
=20
John,
Below is a version of the script that works. The problem is windows does 
not put out binary. The example in the matplotlib documentation should 
be updated to point out this machine compatibility issue unless someone 
knows a better way.
#!d:/apps/Python23/python
import os, sys, msvcrt
from pylab import *
plot([1,2,3,4])
print "Content-type: image/png\n"
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
savefig(sys.stdout)
Best wishes, Simon
Simon Hook wrote:
> John,
>
> I have reduced the python script to 4 lines which no longer includes 
> matplotlib but it still does not work (see below). I have tried many 
> permutations - none work. If you can get this to work, under 
> Apache-windows. I would really appreciate knowing how. This capability 
> would be useful for displaying images from matplotlib.
>
> #!d:/apps/Python23/python.exe
>
> fp = open('tmp.png','rb')
> print "Content-type: image/png\n"
> print fp.read()
> fp.close()
>
> Tthe script generates is:
>
> The image "http://shook-m2/cgi-bin/plot.py" cannot be displayed, 
> because it contains errors.
>
> plot.py is the name of the script, tmp.png is a png in the cgi-bin 
> directory.
>
> I am using:
> Python 2.3 (Enthought version)
> Apache 2.0.53
> Windows XP Sp2
>
> The script is in cgi-bin. Other python scripts work fine e.g. hello 
> world.
>
> Cheers, Simon
>
> John Hunter wrote:
>
>>>>>>> "Simon" == Simon Hook <sim...@jp...> writes:
>>>>>>> 
>>>>>>
>>
>> Simon> Hi, The code below when run from a file in the cgi-bin
>> Simon> directory should generate a plot but it does not work:
>>
>> It would help to have more information. What do you mean "does not
>> work"? Are there any errors displayed to the terminal or apache
>> logs. I know people have used mpl with apache, but it can be a little
>> tricky to get all the data paths set up properly. 
>> matplotlib uses a couple of environment variables to find it's data
>> and store cache information. For example, if your fonts and
>> .matplotlibrc are in a nonstandard place, you need to set the env var
>> MATPLOTLIBDATA to point to them. Also, mpl tries to create a cache
>> file .ttffont.cache in your HOME dir by default, and in an apache
>> config HOME may not exist or may not be writable. If there is no
>> HOME, matplotlib will fall back on the MATPLOTLIBDATA dir, so make
>> sure env var is set, that it points to the directory that contains
>> Vera.ttf and the other mpl fonts, and that it is writable by the user
>> under which apache runs.
>>
>> If you get this to work, please write a HOWTO and submit it to the list.
>>
>>
>> Simon> #!d:/apps/Python23/python
>>
>> Simon> import sys import matplotlib matplotlib.use('Agg') from
>> Simon> pylab import *
>>
>> Simon> plot([1,2,3,4])
>>
>> Simon> #print "Content-type: text/html\n\n" #print "<html>Hello
>> Simon> world!</html>"
>>
>> Simon> print "Content-type: image/png\n\n" Simon> print 
>> savefig(sys.stdout)
>>
>> This looks wrong. Doing
>>
>> print savefig(sys.stdout)
>>
>> will also print the return value of savefig, which is None I believe.
>> I think you just want
>>
>> savefig(sys.stdout)
>>
>> But I can't vouch for the overall approach (setting the content type
>> and then dumping in a binary stream of the png). It may be correct,
>> but I haven't used it. Somehow I would expect the stream to be mime
>> or base64 encoded in an ascii file.
>>
>> Simon> However, it does not work and I am really struggling to get
>> Simon> matplotlib to generate a plot dynamically in a
>> Simon> cgi-script. If anyone has done this successfully I would
>> Simon> really appreciate some help or a simple example. I am using
>> Simon> Windows XP and Apache 2.0.53.
>>
>> Hope this helps a little -- let us know if you have any more details
>> on the problem you are experiencing or if you make any progress.
>>
>> JDH
>> 
>>
-- 
+++++++++++++++++++++++++++++++++++++++++
Simon J. Hook, MSc, PhD
Jet Propulsion Laboratory 
MS 183-501
Pasadena, CA 91109
Office: 818-354-0974
Fax: 818-354-0966
Email: sim...@jp...
http://asterweb.jpl.nasa.gov
http://masterweb.jpl.nasa.gov
http://laketahoe.jpl.nasa.gov
+++++++++++++++++++++++++++++++++++++++++ 

Showing 4 results of 4

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