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




Showing results of 353

<< < 1 .. 9 10 11 12 13 .. 15 > >> (Page 11 of 15)
From: Johan N. <joh...@fr...> - 2006年02月08日 21:26:39
Dear group
I am rather new to matplotlib. I have a reasonably large file of complex
valued data. Today I tried out specgram and psd, and they both work
nicely. However I would like the negative frequencies to be on the
negative side of the spectrum. I tried to look around, but could not
find any parameter to set this. My question is, if this is easily
possible or do I need to do something like
a,b,c,d=pylab.specgram(y,1024)
pylab.show()
x1,y1=a.shape
q=zeros([x1,y1],'d')
q[:,x1/2:x1-1]=a[:,0:x1/2-1]
q[:,0:x1/2-1]=a[:,x1-1:x1/2:-1]
pylab.imshow(q)
Apart from that I don't get the slicing to work properly yet, it would
be nicer if there was just a parameter to set for specgram
/Johan
From: Luigi P. <lu...@la...> - 2006年02月08日 15:53:51
Hi!
I'm trying to create a customized cursor crosshair in my plot. It is 
inserted into a gtk.Window. I'm using GTKAGG backend.
In order do this, I need to create a class CursorCrosshair for a code 
like this:
** CODE **
 win = gtk.Window()
 win.connect("destroy", lambda x: gtk.main_quit())
 win.set_default_size(400,300)
 figure = Figure()
 t = arange(0.0, 1.0, 0.01)
 s = sin(2*2*pi*t)
 sub1 = figure.add_subplot(111)
 sub1.plot(t, s, 'o')
 box = gtk.VBox()
 canvas = FigureCanvasGTKAgg(figure)
 cursor = CursorCrosshair()
 connect('motion_notify_event', cursor.draw_cursor)
 toolbar = NavigationToolbar2GTK( canvas, win )
 toolbar.update()
 box.pack_start(canvas, True, True)
 box.pack_end(toolbar, False, False)
 win.add(box)
 win.show_all()
 gtk.main()
*********
Into the draw_cursor method of CursorCrosshair class I'll paint the 
horizontal and vertical lines.
Well, the canvas in my example (FigureCanvasGTKAgg) inherits from 
gtk.DrawingArea, that is the GTK "real" canvas I need to paint into 
CursorCrosshair.draw_cursor(...) method. gtk.DrawingArea has a method 
named draw_line(gc, x1, y1, x2, y2) that needs the coordinates and a 
graphics context as input parameters.
OK: how can I get the graphics context? What is it? And can I really use 
FigureCanvasGTKAgg like a gtk.DrawingArea object? If I cannot, how can I 
draw a line directly on the gtk inner canvas class (gtk.DrawingArea).
Thanks in advance.
Luigi
From: Charlie M. <cw...@gm...> - 2006年02月08日 13:02:48
I just committed the changes to cvs and added a convenience function
for py2exe called get_py2exe_datafiles. The script I pasted before
now looks like this:
Begin setup.py script
---------------------------------------------------------------------------=
-----------
# For py2exe only
"""
 Run with the following command (use py2exe 0.6.2 or higher)
 python.exe -OO setup.py py2exe -b 3 -c -p numarray,pytz -e numpy
"""
import os
from distutils.core import setup
import py2exe
import glob
import matplotlib
setup( version =3D '0.9.1',
 windows =3D ['nlogui.py'],
 data_files =3D [('', ['nlo.gif', '../vtkrotate/NMA.pdb']),
 matplotlib.get_py2exe_datafiles()],
 options=3D{"py2exe":{"optimize":2}},
)
From: Charlie M. <cw...@gm...> - 2006年02月08日 12:51:50
On 2/7/06, John Hunter <jdh...@ac...> wrote:
> >>>>> "Daniel" =3D=3D Daniel McQuillen <dan...@ya...> writes:
>
> Daniel> Please be kind....poor starving newbie. I've seen this
> Daniel> question posted around but can't seem to find an answer:
> Daniel> does anybody have experience creating an .exe for a
> Daniel> matplotlib program using py2exe?
>
> Daniel> My testMPL.py application is all set to go, but when I run
> Daniel> py2exe with the suggested setup.py file, I get
> Daniel> errors. (I'm using ActiveState Python 2.4.2 Build 10)
>
> Daniel, just for our information: are you using the py2exe examples
> from the matplotlib FAQ page? I think these are probably a bit out of
> date as of the 0.86 release because of the way we recently reorganized
> the package data (fonts, thumbnails etc).
>
> Charlie, have you tested any of the new egg / package organization
> stuff with py2exe?
I just tried with an old project that I used py2exe with and it does
look like we still need the py2exe specific check in get_data_path
since py2exe zips the pure python code into a library.zip. I updated
my setup.py file for that old project and I am pasting it below. In
my specific case I was using numarray (numpy didn't exist), so now I
have to exclude numpy or errors occur for some unknown reason. I just
added the old py2exe check to get_data_path and everything worked
fine. I will add this to cvs.
Until the next release you can just uncomment the following lines in
matplotlib/__init__.py#_get_data_path():
 if sys.platform=3D=3D'win32' and sys.frozen:
 path =3D os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdat=
a')
 if os.path.isdir(path): return path
 else:
 # Try again assuming sys.path[0] is a dir not a exe
 path =3D os.path.join(sys.path[0], 'matplotlibdata')
 if os.path.isdir(path): return path
Begin setup.py script
---------------------------------------------------------------------------=
-----------
# For py2exe only
"""
 Run with the following command (use py2exe 0.6.2 or higher)
 python.exe -OO setup.py py2exe -b 3 -c -p numarray,pytz -e numpy
"""
import os
from distutils.core import setup
import py2exe
import glob
import matplotlib
mplfiles =3D glob.glob(os.sep.join([matplotlib.get_data_path(), '*']))
# Need to explicitly remove cocoa_agg nib folder or py2exe complains
mplfiles.remove(os.sep.join([matplotlib.get_data_path(), 'Matplotlib.nib'])=
)
setup( version =3D '0.9.1',
 windows =3D ['nlogui.py'],
 data_files =3D [('', ['nlo.gif', '../vtkrotate/NMA.pdb']),
 ('matplotlibdata', mplfiles)],
 options=3D{"py2exe":{"optimize":2}},
)
From: <aur...@fr...> - 2006年02月08日 11:57:48
Hi folks,
I have a question I couldn't solve so far. I'm trying to generate say 500=
 images
(png) without displaying them using imshow. I wrote a simple test functio=
n
(see below) which I call from a loop in which I create the data for the i=
mage in
a sequence. I systematically bump into a runtime error after saving about=
 188
files. After reading the (excellent) tutorial from Perry Greenfield and
Robert Jedrzejewski on interactive data analysis, I understand the need t=
o clean
up by freeing memory but I must be missing something else.
Cheers,
Aur=E9lien
def generateImshow(yarray,
 xscansize,yscansize,
 xscanstep,yscanstep,
 outputfilename,
 initimagesize =3D 10):
 '''Use this function to generate matplotlib images without displaying
them'''
 #reshape according to scan
 yarray =3D na.reshape(yarray,(yscansize,-1))
 #build image via matplotlib
 ximagesize =3D xscansize*xscanstep
 yimagesize =3D yscansize*yscanstep
 xyimageratio =3D float(ximagesize)/yimagesize
 print xyimageratio
 if xyimageratio > 1: ximagesize,yimagesize =3D
initimagesize,initimagesize*xyimageratio
 else: ximagesize,yimagesize =3D initimagesize*xyimageratio,initimages=
ize
 fig1 =3D pylab.figure(figsize=3D(ximagesize,yimagesize),dpi=3D100)
 #pylab.title('blahblah')
 im1 =3D pylab.imshow(yarray,
 origin=3D'lower',
 #aspect=3D'preserve',
 #interpolation=3D'nearest', #i.e. pixel
 interpolation=3D'bicubic', #i.e. smooth
 #cmap=3Dmpl.cm.jet, #not correct
 #vmin=3Dminvalue,
 #vmax=3Dmaxvalue
 )
 pylab.colorbar()
 pylab.bone()
 pylab.axis('off')
 #save figure
 #outputfilename =3D filename[:-4]+'.png'
 pylab.savefig(outputfilename)
 #pylab.cla()
 del im1
 pylab.close('all')
From: John H. <jdh...@ac...> - 2006年02月08日 02:55:09
>>>>> "andrea" == andrea gavana@tin it <and...@ti...> writes:
 andrea> Hello John & NG, thank you very much for your answer. It
 andrea> seems to me that using set_frame_on() just hides/shows the
 andrea> whole axes content. Probably I didn't make myself clear
 andrea> (sorry for my bad english). I attach a jpeg example of
 andrea> what I mean for bon on/off. The figure at the left if with
 andrea> box "off", while at the right the box is "on".
Ahh, now I understand what you want. Yes, this is a persistent
request and one we have not yet supported. It is on the goals page,
however. 
JDH
From: John H. <jdh...@ac...> - 2006年02月08日 02:53:56
>>>>> "Andrea" == Andrea Gavana <and...@ti...> writes:
 Andrea> Hello NG, I am having a couple of problems with Matplotlib
 Andrea> embedded in wxPython; both are related to the Pylab
 Andrea> twinx() function and its corresponding Matplotlib API
 Andrea> call.
Hi Andrea,
this is indeed a bug. When we wrote support for the axis offsets, we
forgot about the use case where you might be using right ticks.
Darren, do you think this would be reasonably easy to support?
JDH
From: John H. <jdh...@ac...> - 2006年02月08日 02:52:42
>>>>> "Daniel" == Daniel McQuillen <dan...@ya...> writes:
 Daniel> Please be kind....poor starving newbie. I've seen this
 Daniel> question posted around but can't seem to find an answer:
 Daniel> does anybody have experience creating an .exe for a
 Daniel> matplotlib program using py2exe?
 Daniel> My testMPL.py application is all set to go, but when I run
 Daniel> py2exe with the suggested setup.py file, I get
 Daniel> errors. (I'm using ActiveState Python 2.4.2 Build 10)
Daniel, just for our information: are you using the py2exe examples
from the matplotlib FAQ page? I think these are probably a bit out of
date as of the 0.86 release because of the way we recently reorganized
the package data (fonts, thumbnails etc).
Charlie, have you tested any of the new egg / package organization
stuff with py2exe?
JDH
From: Robert H. <he...@ta...> - 2006年02月07日 22:33:57
On Feb 7, 2006, at 12:38 PM, John Hunter wrote:
> if vers<'1.6':
This seemed to be the problem (perhaps vers<='1.6' is meant). I use 
version dvipng version 1.6, but the alpha hack still seems to be 
required. When I force the hack, the PNG output looks good. Three 
cheers for the MPL-users list! (Four for JDH!)
Now, if you'll bear with me, I need to get EPS (then, ultimately, 
encapsulated PDF) output. I am getting an error like (from 
verbose:helpful) :
 >>> savefig('foo.eps')
[.....]
dvips: Font ecrm1000 at 72 not found; scaling 600 instead.
dvips: Such scaling will generate extremely poor output.
This is dvips(k) 5.95b Copyright 2005 Radical Eye Software 
(www.radicaleye.com)
' TeX output 2006年02月07日:1621' -> /tmp/ 
bc5f66f5eb5ed881504e9f305289dc95.ps
<tex.pro><psfrag.pro><special.pro><color.pro>. [1
<bc5f66f5eb5ed881504e9f305289dc95.eps>]
GNU Ghostscript 8.16: Unrecoverable error, exit code 1
Any clues?
-Rob
-----
Rob Hetland, Assistant Professor
Dept of Oceanography, Texas A&M University
p: 979-458-0096, f: 979-845-6331
e: he...@ta..., w: http://pong.tamu.edu
From: John H. <jdh...@ac...> - 2006年02月07日 18:48:58
>>>>> "Robert" == Robert Hetland <he...@ta...> writes:
 Robert> dvipng is producing scaled images that look correct.
 Robert> This command (at a variety of resolutions) produces
 Robert> nice, dithered output, even when using tex files from
 Robert> tex_cache. See attached '3.0' at dpi=150. Lovely...
Try hard coding the full path to dvipng from the command line and in
texmanager to make sure you are using the version you think you are.
Also, flush the tex cache.
Find this bit of code in texmanager
 vers = self.get_dvipng_version()
 #print 'dvipng version', vers
 if vers<'1.6':
 # hack the alpha channel as described in comment above
 alpha = sqrt(1-X[:,:,0])
 else:
 alpha = X[:,:,-1]
print the dvipng version in texmanager. Also, see which part of the
conditional you are executing, and then manually try forcing both with 
 if 1:
 # hack the alpha channel as described in comment above
 alpha = sqrt(1-X[:,:,0])
 else:
 alpha = X[:,:,-1]
and
 if 0:
 # hack the alpha channel as described in comment above
 alpha = sqrt(1-X[:,:,0])
 else:
 alpha = X[:,:,-1]
Make sure you flush the tex cache and rerun matplotlib from the shell
(not ipython) with each test.
JDH
From: Robert H. <he...@ta...> - 2006年02月07日 18:29:15
On Feb 7, 2006, at 11:06 AM, Darren Dale wrote:
> Are you using NumPy, Numeric, or numarray, and what version? What =20
> backend,
> GTKAgg, WXAgg? I'm grasping at straws here, maybe there is a =20
> problem with
> backen_agg's draw_image on your platform or with your =20
> configuration, but I
> can't investigate because I can't reproduce the problem.
NumPy (0.9.5.2044) and backend TkAgg
>
> Also, please try running dvipng -bg Transparent -D dpi -T tight =20
> dvifile,
> replacing dpi with numbers like 60, 80, 100, 140, just to make sure =20=
> that
> dvipng is producing scaled images that look correct.
This command (at a variety of resolutions) produces nice, dithered =20
output, even when using tex files from tex_cache. See attached '3.0' =20=
at dpi=3D150. Lovely...
-Rob.
=EF=BF=BC
-----
Rob Hetland, Assistant Professor
Dept of Oceanography, Texas A&M University
p: 979-458-0096, f: 979-845-6331
e: he...@ta..., w: http://pong.tamu.edu
From: Darren D. <dd...@co...> - 2006年02月07日 18:09:15
Are you using NumPy, Numeric, or numarray, and what version? What backend, 
GTKAgg, WXAgg? I'm grasping at straws here, maybe there is a problem with 
backen_agg's draw_image on your platform or with your configuration, but I 
can't investigate because I can't reproduce the problem.
Also, please try running dvipng -bg Transparent -D dpi -T tight dvifile, 
replacing dpi with numbers like 60, 80, 100, 140, just to make sure that 
dvipng is producing scaled images that look correct.
Darren
On Tuesday 07 February 2006 11:19, Robert Hetland wrote:
> I have tried the key utilities by hand (latex & dvipng). I even went
> into the tex_cache and processed one of those tex files by hand as
> well. This all works for me. In particular, the font rendered in
> png is dithered, while in the matplotlib, on my screen and using
> savefile, the font is *not* dithered on either the axis or in text
> (). The file Darren sent is also nicely dithered. See the attached
> zoomed sample of non-dithered text. Oh, so ugly...
>
> I am using Mac OS X 10.4, a recent distribution of teTeX from the i-
> Installer (the same as recommended by TeXShop), gnu-gs 8.16, CVS
> matplotlib 0.86.2, etc. (I think this is all the relevant info for
> now..)
>
> relevant rc stuff:
>
> text.usetex : True # use latex for all text handling. See
>
> ps.papersize : letter # executive, letter, legal, ledger, A0-
> A10, B0-B6, C0-C6
> ps.useafm : False # use of afm fonts -- breaks mathtext
> but results in small files
> ps.usedistiller : None # can be: None, ghostscript or xpdf
> # Experimental: may
> produce smaller files.
> # xpdf intended for
> production of publication quality files,
> # but requires
> ghostscript, xpdf and ps2eps
> ps.distiller.res : 6000 # dpi
>
>
> -Rob.
>
> p.s. Ryan - I think the web page should be clear now. My sysadmin
> had gone a little overboard on blocking IPs after a hacker
> infestation... (my guess is you were surfing from home, right?)
-- 
Darren S. Dale, Ph.D.
Cornell High Energy Synchrotron Source
Cornell University
200L Wilson Lab
Rt. 366 & Pine Tree Road
Ithaca, NY 14853
dd...@co...
office: (607) 255-9894
fax: (607) 255-9001
From: Christopher B. <Chr...@no...> - 2006年02月07日 17:40:15
Ryan Krauss wrote:
> I would like to draw one arrow on a plot as part of a label. 
> Does anyone have a better way to do this?
I've enclosed a message sent to matplotlib-devel, including the attached 
code. maybe it will help, I haven't had a chance to try it out yet.
-Chris
-------- Original Message --------
Subject: Fancy arrows for matplotlib
Date: 2006年1月31日 16:03:13 -0700
From: Fernando Perez <Fer...@co...>
Organization: Applied Mathematics, University of Colorado at Boulder
To: matplotlib development list 
<mat...@li...>, Chris Barker 
<Chr...@no...>, Rob Knight <ro...@sp...>
Hi all,
I thought I had sent this code on Sunday, but apparently it didn't make 
it to
the list. Apologies if it arrives twice.
This code was contributed by Rob Knight, from the biochemistry dept. at CU
Boulder, to draw nice arrows with a lot of control.
You can see an example here (just paste the example data):
http://bayes.colorado.edu/cgi-bin/arrows/arrow_cgi.py
Both a CGI and a command line demo are attached, as well as the underlying
arrow-drawing code. It would be great if this could be integrated into mpl
for the future.
Cheers,
f
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Daniel M. <dan...@ya...> - 2006年02月07日 16:26:32
Please be kind....poor starving newbie.
I've seen this question posted around but can't seem to find an answer: does anybody have experience creating an .exe for a matplotlib program using py2exe? 
My testMPL.py application is all set to go, but when I run py2exe with the suggested setup.py file, I get errors. (I'm using ActiveState Python 2.4.2 Build 10)
Setup.py is as follows:
from distutils.core import setup
import glob
import py2exe
opts = {
 'py2exe': { 'includes': 'matplotlib.numerix.random_array',
 'excludes': ['_gtkagg', '_tkagg'],
 'dll_excludes': ['libgdk-win32-2.0-0.dll',
 'libgobject-2.0-0.dll']
 }
 }
 
data = glob.glob("C:\\Python24\\Lib\\site-packages\\matplotlib\\*")
data.append("C:\\Python24\\Lib\\site-packages\\matplotlib\\matplotlibrc")
setup ( console = ["testWX.py"], 
 data_files=[("matplotlibdata",data)])
 
Now, when I run this, setup.py ends with an error as follows:
*** copy extensions ***
*** copy dlls ***
*** copy data files ***
error: can't copy 'C:\Python24\Lib\site-packages\matplotlib\backends': doesn't e
xist or not a regular file
Is this error because glob can't load files recursively? I get confused because all of the other examples out there use a different file structure, loading matplotlib files like so...
 data_files = [(r'matplotlibdata', glob.glob(r'c:\python24\share\matplotlib\*')),
 (r'matplotlibdata', [r'c:\python24\share\matplotlib\.matplotlibrc'])],
But my python build doesn't have a /share directory at all. Why the discrepency?
Thanks for any help...
- Daniel
 
===================================== 
Daniel McQuillen, 
Oakland, CA 
www.bluepattern.com
From: Robert H. <he...@ta...> - 2006年02月07日 16:17:13
I have tried the key utilities by hand (latex & dvipng). I even went 
into the tex_cache and processed one of those tex files by hand as 
well. This all works for me. In particular, the font rendered in 
png is dithered, while in the matplotlib, on my screen and using 
savefile, the font is *not* dithered on either the axis or in text 
(). The file Darren sent is also nicely dithered. See the attached 
zoomed sample of non-dithered text. Oh, so ugly...
I am using Mac OS X 10.4, a recent distribution of teTeX from the i- 
Installer (the same as recommended by TeXShop), gnu-gs 8.16, CVS 
matplotlib 0.86.2, etc. (I think this is all the relevant info for 
now..)
relevant rc stuff:
text.usetex : True # use latex for all text handling. See
ps.papersize : letter # executive, letter, legal, ledger, A0- 
A10, B0-B6, C0-C6
ps.useafm : False # use of afm fonts -- breaks mathtext 
but results in small files
ps.usedistiller : None # can be: None, ghostscript or xpdf
 # Experimental: may 
produce smaller files.
 # xpdf intended for 
production of publication quality files,
 # but requires 
ghostscript, xpdf and ps2eps
ps.distiller.res : 6000 # dpi
-Rob.
p.s. Ryan - I think the web page should be clear now. My sysadmin 
had gone a little overboard on blocking IPs after a hacker 
infestation... (my guess is you were surfing from home, right?)
From: Ryan K. <rya...@gm...> - 2006年02月07日 01:34:16
I would like to draw one arrow on a plot as part of a label. I am
currently doing the following:
ax=3Dgca()
myarrow=3Dpylab.Arrow(-30,60,10,10,width=3D10)
ax.add_patch(myarrow)
pylab.show()
If I leave width=3D1, my arrow head is not visible due to the scale of
my plot, with width=3D10, the arrow head is visible, but the overall
arrow is wider than I would like. Is there another way to do this?=20
Can I get seperate control over the width of the arrowhead and the
width of the arrow. I wouldn't mind if the arrow itself was just a
thin line, but I would like a fancy arrow head than just doing this
-----> by drawing three lines.
Does anyone have a better way to do this?
Ryan
From: Darren D. <dd...@co...> - 2006年02月06日 23:57:49
Attachments: dsd.png
On Monday 06 February 2006 16:04, Robert Hetland wrote:
> I have been following the discussions about getting LaTeX text
> processing, I have tried it myself, and I have been unsuccessful. I
> gave gnu-ghostscript, I have tried a number of different rc settings,
> but nothing seems to work well. PNG output has very poor quality
> text, EPS output chokes ghostscript, and PS output appears as nothing.
I would start by clearing your .matplotlib/tex.cache directory. Then set 
verbose.level : helpful in your matplotlibrc settings. This will cause mpl to 
spit out the important messages that are produced during the calls to latex, 
dvips, ghostscript, etc. For the time being, set your ps.usedistiller rc 
option to either none or ghostscript. Once you get that working, you can move 
on to using xpdf like Ryan suggested.
I dont understand why png output would be bad. Does the text look bad on the 
screen as well? What OS are you using, what version of latex, and what 
version of dvipng? Try making a very simple latex file, like:
\documentclass[10pt]{article}
\pagestyle{empty}
\begin{document}
Hello, world! $e^{i\pi\theta}$
\end{document}
make a dvi, and then make a png using dvipng. My guess is that the problem is 
dvipng, because the text that mpl shows you on screen and in png output comes 
straight from dvipng. Incidentally, my png output looks fine, see attached.
> Is there a place where all of the important issues are laid out? I
> would like to see someone who understands all of the important issues
> start a HOWTO on the scipy Wiki. 
Let me know what you found confusing about the existing usetex wiki page at 
SciPy, so I can improve it.
Darren
From: Christopher B. <Chr...@no...> - 2006年02月06日 23:24:07
Attachments: wxMplTwinx.py
Andrea Gavana wrote:
> BTW, I didn't receive any answer on this thread:
> 
> http://sourceforge.net/mailarchive/forum.php?thread_id=9639992&forum_id=33405
> 
> Do you happen to have some suggestion on how to solve this issue?
Well, you got me curious, so what I did was start by writing an OO 
version of the script that worked:
#!/usr/bin/env python
import matplotlib, pylab
import matplotlib.numerix as N
Fig = pylab.figure()
ax1 = Fig.add_subplot(111)
t = N.arange(0.01, 10.0, 0.01)
s2 = N.sin(2*N.pi*t)
ax1.plot(t, s2, 'r.')
ax1.set_ylabel('sin')
#Create second axes with ticks on right
# code adapted from pylab.twinx
ax2 = Fig.add_axes(ax1.get_position(), sharex=ax1, frameon=False)
ax2.yaxis.tick_right()
ax2.yaxis.set_label_position('right')
s1 = N.exp(t)
ax2.plot(t, s1, 'b-')
ax2.set_xlabel('time (s)')
ax2.set_ylabel('exp')
pylab.show()
Then I put it in my simple wxmpl example. It works. I've enclosed that. 
You need to click the "plot" button to make it plot.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Christopher B. <Chr...@no...> - 2006年02月06日 23:13:25
Andrea Gavana wrote:
> Thanks a bunch Chris, it really helps...
No problem.
> bit backend_wx.py and backend_bases.py to include a mouse double click. For
> the moment it's working like a charm. Let's cross the fingers ;-)
Make sure you send the patch to John or matplotlib-devel, it might make 
sense to add teh double click events to all the back-ends.
> BTW, I didn't receive any answer on this thread:
> 
> http://sourceforge.net/mailarchive/forum.php?thread_id=9639992&forum_id=33405
> 
> Do you happen to have some suggestion on how to solve this issue?
well, no. but the first thing I'd do is make a wx-free script that used 
the OO interface. That keeps the embedded in wx stuff out of it, and it 
it doesn't work you can have a simple example to send to the group to 
get help.
OK. I've done some of that. first your first problem. There is a bug in 
axes.tick_right. Here's a script:
#!/usr/bin/env python
import pylab
import matplotlib.numerix as N
Fig = pylab.figure()
ax2 = Fig.add_subplot(111)
ax2.yaxis.tick_right()
ax2.yaxis.set_label_position('right')
t = N.arange(0.01, 10.0, 0.01)
s1 = N.exp(t)
ax2.plot(t, s1, 'b-')
ax2.set_xlabel('time (s)')
ax2.set_ylabel('exp')
pylab.show()
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Christopher B. <Chr...@no...> - 2006年02月06日 23:11:41
Hi all,
As follow on to a post by Andre Gavana, I think we've identified a bug 
in axes.tick_right. If you run the following script:
#!/usr/bin/env python
import pylab
import matplotlib.numerix as N
Fig = pylab.figure()
ax2 = Fig.add_subplot(111)
ax2.yaxis.tick_right()
ax2.yaxis.set_label_position('right')
t = N.arange(0.01, 10.0, 0.01)
s1 = N.exp(t)
ax2.plot(t, s1, 'b-')
ax2.set_xlabel('time (s)')
ax2.set_ylabel('exp')
pylab.show()
You get a nice plot with the y-axis on the right, but the x1e4 ends up 
at the top of the left side, rather than the right. Is there another 
call to say where to put that? It seems that it should always be on the 
same side as the ticks.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Ryan K. <rya...@gm...> - 2006年02月06日 22:00:30
Hey Robert,
I think this is a great idea. I am using the usetex option on my
system with great success and I would love to help others create these
beautiful plots with gorgeous Latex fonts.
The process depends on a few outside tools right now and that is where
I would guess the problem is. I am using the xpdf option for
distiller option:
ps.usedistiller : xpdf
Darren may have a better idea, but my suggestion would be to go
through each of the steps in the figure generation process yourself
and see if one particular tool or setting is causing your font
ugliness. If you wanted to try this approach, go into
python-root/site-packages/matplotlib/backends/backend_ps.py and put a
pdb.set_trace() around line 1162, just before this line:
if rcParams['ps.usedistiller'] =3D=3D 'xpdf':
Then, when you call savefig, it will stop with a figure started in
your temp directory (the value of psfile from the pdb prompt will tell
you the exact location).
There will be a ps file and a tex file in that location. If that ps
file looks bad, you are going to need Darren's help. If the ps file
looks good, the savefig process is basically going to call ps2pdf,
pdftops, and then epstopdf (assuming you saved with a .eps extension).
 If you can take the ps file from the start of this process and
execute each of these commands in turn, you should be able to see
where things are going wrong.
But, you may not be comfortable with all this, may not want to invest
the time, or Darren may have a better idea.
By the way, your website is linked as a how to on the scipy install
and when I try and go there, I get a access forbidden error. (I get
the same error if I try to follow the link in your signature
pong.tamu.edu).
Ryan
On 2/6/06, Robert Hetland <he...@ta...> wrote:
>
> I have been following the discussions about getting LaTeX text
> processing, I have tried it myself, and I have been unsuccessful. I
> gave gnu-ghostscript, I have tried a number of different rc settings,
> but nothing seems to work well. PNG output has very poor quality
> text, EPS output chokes ghostscript, and PS output appears as nothing.
>
> I am sure I am doing something stupid. I just don't know which
> stupid thing it is.
>
> Is there a place where all of the important issues are laid out? I
> would like to see someone who understands all of the important issues
> start a HOWTO on the scipy Wiki. I would contribute, after I get
> going..
>
> Short of that, any sort of conglomeration of information would be
> very helpful. Thanks,
>
> -Rob
>
> -----
> Rob Hetland, Assistant Professor
> Dept of Oceanography, Texas A&M University
> p: 979-458-0096, f: 979-845-6331
> e: he...@ta..., w: http://pong.tamu.edu
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat=
=3D121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Eric F. <ef...@ha...> - 2006年02月06日 21:48:27
Christopher Barker wrote:
> Eric Firing wrote:
> 
>> rcParams['xtick.direction'] = 'out'
>> rcParams['ytick.direction'] = 'out'
> 
> 
> Not that I need this at the moment, but can you have them be both in and 
> out?
Chris,
No, that would require changes to the present code.
Eric
From: Andrea G. <and...@ti...> - 2006年02月06日 21:09:00
Thanks a bunch Chris, it really helps... however I have just hacked a little
bit backend_wx.py and backend_bases.py to include a mouse double click. For
the moment it's working like a charm. Let's cross the fingers ;-)
BTW, I didn't receive any answer on this thread:
http://sourceforge.net/mailarchive/forum.php?thread_id=9639992&forum_id=33405
Do you happen to have some suggestion on how to solve this issue?
Thank you very much for your help.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77
From: Robert H. <he...@ta...> - 2006年02月06日 21:02:52
I have been following the discussions about getting LaTeX text 
processing, I have tried it myself, and I have been unsuccessful. I 
gave gnu-ghostscript, I have tried a number of different rc settings, 
but nothing seems to work well. PNG output has very poor quality 
text, EPS output chokes ghostscript, and PS output appears as nothing.
I am sure I am doing something stupid. I just don't know which 
stupid thing it is.
Is there a place where all of the important issues are laid out? I 
would like to see someone who understands all of the important issues 
start a HOWTO on the scipy Wiki. I would contribute, after I get 
going..
Short of that, any sort of conglomeration of information would be 
very helpful. Thanks,
-Rob
-----
Rob Hetland, Assistant Professor
Dept of Oceanography, Texas A&M University
p: 979-458-0096, f: 979-845-6331
e: he...@ta..., w: http://pong.tamu.edu
From: Christopher B. <Chr...@no...> - 2006年02月06日 20:53:32
Attachments: wxMplSample.py
Andrea Gavana wrote:
> I have checked wxmpl, but it seems to me that it has the same mouse events
> as matplotlib has (button down/up/motion) and nothing more.
wxmpl provides a subclass of wxPanel, so it's there somewhere. I haven't 
done mouse events, so I I don't know where yet. I do think wxmpl could 
use some more work.
> matplotlib and wxmpl fail to get the mouse_down event if you click very fast
> on the figure canvas.
I'm guessing that what's happening is that the two mouse clicks close 
together are getting caught as a double-click, so the second one doesn't 
show up as a single click.
> So I ended up in a dirty
> hack of a MPL single mouse_down to transform it in a double-click,
ugh. I'd poke around more in the wxmpl code. Maybe I'll do that myself.
OK-- I started doing that, but first I just tried binding a event to a 
wxmpl.PlotPanel, and it works fine. I've enclosed a little sample. It 
should write to the console when you left, right or double-left click on 
the PlotPanel.
Note that when you double click, you get one left click event and one 
double click event, but not two left click events.
Of course, you'll now need to figure out how to query the FigureCanvas 
to see what the axes coords are, but I'm sure you can find code on MPL 
that will give you hints.
By the way, you could hack backend_wx.py to add the double click events, 
but that would be ugly if it wasn't added everywhere else in MPL -- 
which is kind of why I think that way lies madness ;-)
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
5 messages has been excluded from this view by a project administrator.

Showing results of 353

<< < 1 .. 9 10 11 12 13 .. 15 > >> (Page 11 of 15)
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 によって変換されたページ (->オリジナル) /