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

Showing results of 368

<< < 1 .. 8 9 10 11 12 .. 15 > >> (Page 10 of 15)
From: Neal B. <ndb...@gm...> - 2012年03月12日 13:05:13
I have a figure with a semilogy plot. I need to make more room on the bottom to 
add a bunch of figtext, which is 4 lines of text.
With the defaults, the text overprints the x-axis.
What is a suggested way to fix this? (Ideally, mpl would calculate the 
appropriate sizes for me so things don't overprint).
From: Daniele N. <da...@gr...> - 2012年03月12日 12:49:54
On 12/03/12 13:40, Neal Becker wrote:
> Using this code:
> 
> self.pdf = PdfPages('%s.%s.pdf' % (name, str(date.today())))
> 
> Trying to output a pdf with the name 
> 
> "results.abs_aci=[10.0, nan, 10.0].rate=['2/3', '4/5', '2/3'].2012年03月12日.pdf"
> 
> produces this error
> 
> IOError: [Errno 2] No such file or directory: "results.abs_aci=[10.0, nan, 
> 10.0].rate=['2/3', '4/5', '2/3'].2012年03月12日.pdf"
> 
> Changing the file name to just 'test1.pdf' produces no error.
On Unix platforms the / character is invalid in file names, being the
path separator, along with the 0円 character, for obvious reasons.
On Windows the allowed set of valid characters is further reduced,
depending on the filesystem.
Cheers,
-- 
Daniele
From: Neal B. <ndb...@gm...> - 2012年03月12日 12:40:49
Using this code:
self.pdf = PdfPages('%s.%s.pdf' % (name, str(date.today())))
Trying to output a pdf with the name 
"results.abs_aci=[10.0, nan, 10.0].rate=['2/3', '4/5', '2/3'].2012年03月12日.pdf"
produces this error
IOError: [Errno 2] No such file or directory: "results.abs_aci=[10.0, nan, 
10.0].rate=['2/3', '4/5', '2/3'].2012年03月12日.pdf"
Changing the file name to just 'test1.pdf' produces no error.
From: Jerzy K. <jer...@un...> - 2012年03月12日 10:48:21
Mic :
> Thank you for your solutions. However, with my dataset it did not work 
> out with the following code:
>
>
> ...
>
> Please find attached the histogram. The dataset I am sending with
> next email.
>
1. You haven'sent *in.small.txt*, but *in.txt*, 70 MB, several millions 
lines. Please, be gentle wrt people who want to help you and are obliged 
to test your stuff.
2. You file is buggy, last two lines generate an exception. They contain 
a text "mean ...".
3. I corrected them, the program works, and gives the picture you 
attached. You don't say WHAT is "not working". Is it the question of 
scaling, or something else?
4 If it is scaling, and IF IF ... you want to obtain something I attach, 
then use the code:
 *hst=axes.hist(data, bins=50, normed=True)
 mxh=max(hst[0])
 plt.plot([mean,mean],[0,mxh],'r',lw=2)
 *
5. Learn something about WHAT is a normed histogram in matplotlib, how 
to get into the plotted data, and to adjust the scales. Otherwise such 
problems will repeat.
6. Finally, in our civilized world people sign their messages. Anonymous 
letters are ugly.
Jerzy Karczmarczuk
From: Catherine T. <cab...@gm...> - 2012年03月12日 07:55:47
On Sun, Mar 11, 2012 at 11:27 PM, gsal <sal...@gm...> wrote:
>
> Don't have a solution; I was just wondering if you have tried something
> else,
> like using ipython instead of IDLE. ipython may be better suited for
> threading and working with pylab, etc.
>
>
Thanks for the reply. I do like ipython might try the gui version.
From: Ignas A. <ani...@gm...> - 2012年03月12日 00:02:40
On 11/03/12 14:19, Goyo wrote:
> El día 11 de marzo de 2012 11:31, gsal <sal...@gm...> escribió:
>>
>> I am not quite sure what you are asking, but, can you simply just add your
>> own attribute to the window objects? Python is friendly that way, you know?
>> It's dynamic.
> 
> There are some dialogs not accesible using the mpl api. The save
> dialogs seem to be the standard ones for the underlying toolkit so
> reading the toolkit docs may help. Then there are the subplot params
> configuration dialogs.
> 
> Goyo
Thanks for replies. What I wanted can be achieved with following:
import gobject
gobject.set_prgname('matplotlib')
This sets the instance attribute of the window to matplotlib instead of
the name of the script matplotlib window is produced from. All the
various window attributes can be looked-upon by running xprop tool from
terminal.
Is there any way of incorporating the above 2 lines of python code into
the matplotlibrc so that whenever matplotlib produces any windows, this
code is executed and the window has a proper name?
Cheers,
Ignas A.
From: <sil...@gm...> - 2012年03月11日 18:51:42
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head> 
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
 <title>Untitled Document</title> 
 <style type="text/css">
<!--
a:link {
	text-decoration: none;
	color: #000000;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: none;
	color: #000000;
}
a:active {
	text-decoration: none;
	color: #000000;
}
-->
 
 
 </style> 
 </head> 
 <body> 
 <p>Hi,</p> 
 <p>Planning to study abroad?<a href="http://site2.way2sms.com/user/OpenLink.jsp?id=sm2Z3MU4jKaCFpd6S/24DNPfnJOOaOWDlh5vOI6Os6YveBZ9od0fW5p8TE2CGWpA+1nhahaa/96K
70UgTuis3IZVWbeu/SIFi6zIKpFFPOY="> <strong><u>Click here </u></strong></a>to get all the right information you need.</p> 
 <p>- Get detailed information on destinations to study abroad<br /> - Know everything about the courses of your choice<br /> - Find out more about the tests you need to give to take admission abroad<br /> - Get tips on how to prepare the best CV and Statement of Purpose (SOP)<br /> - Find out how you can get the scholarship you need to study abroad<br /> - Get all your queries answered from our experts</p> 
 <a href="http://site2.way2sms.com/user/OpenLink.jsp?id=sm2Z3MU4jKaCFpd6S/24DNPfnJOOaOWDlh5vOI6Os6YveBZ9od0fW5p8TE2CGWpA+1nhahaa/96K
70UgTuis3IZVWbeu/SIFi6zIKpFFPOY="><p><strong><u>Click here to get started</u></strong></p></a> 
 <p>If you are looking to take admission within India, <a href="http://site2.way2sms.com/user/OpenLink.jsp?id=sm2Z3MU4jKaCFpd6S/24DNPfnJOOaOWDlh5vOI6Os6YveBZ9od0fW5p8TE2CGWpA+1nhahaa/96K
70UgTuis3IZVWbeu/SIFi6zIKpFFPOY="><strong><u>Click here</u></strong></a></p> 
 <p>We look forward to helping you make the right decision for a brighter future.</p> 
 <p>Regards</p> 
 <div> 
 <br /> Ambika Singh 
 </div> 
 <img src="http://labssx.way2sms.com/newsletters/1_HTcampusabroad_Tyroo_Camp1/a.gif" border="0" /> 
 <img alt="" src="http://site2.way2sms.com/LoadImage?id=sm2Z3MU4jKaCFpd6S/24DNPfnJOOaOWDlh5vOI6Os6YveBZ9od0fW5p8TE2CGWpA+1nhahaa/96K
70UgTuis3AZFFMll1u7l1167g0VB0eM=" height="0px" width="0px" /> 
 </body>
</html>
From: Tony Yu <ts...@gm...> - 2012年03月11日 18:13:19
Is it possible to draw an arrow with a dashed line?
I tried using a fancy arrow patch and set the linestyle:
#~~~
import matplotlib.pyplot as plt
fix, ax = plt.subplots()
ax.set_xlim((-1,5))
ax.set_ylim((-5,3))
ax.annotate('simple', xy=(2., -1), xycoords='data',
 xytext=(100, 60), textcoords='offset points',
 size=20,
 arrowprops=dict(arrowstyle="simple",
 fc="0.6", ec="none", linestyle='dashed',
 connectionstyle="arc3,rad=0.3"),
 )
plt.show()
#~~~
But the linestyle argument just gets ignored.
Is there a way to grab the connection path object and then change that to a
dashed line? Actually, I'm not even sure it's possible to set a linestyle
for a Path (since dashed lines are normally Line2D). Suggestions?
Thanks,
-Tony
From: aa <tel...@gm...> - 2012年03月11日 15:14:28
How to Get symmetric plotting in pylab....
i tried this code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 10 20:33:32 2012
@author: fajar
"""
from numpy import linspace, meshgrid, array
import matplotlib.pyplot as pl
import matplotlib.ticker as tc
from scipy.integrate import odeint
# membuat vektor
u = linspace(-5,5,25)
v = linspace(-5,5,25)
U,V = meshgrid(u,v)
def fu(u,v): return 2*u-2*v
def fv(u,v): return 2*u-3*v
FU = fu(U,V)
FV = fv(U,V)
# sistem Persamaan:
def g(x,t):
y1 = 2*x[0]-1*x[1]
y2 = 1*x[0]-2*x[1]
return [y1, y2]
time = linspace(-1,-.6,100)
con = array([[1,2],[1.5,-3],[-1.5,3],[-1.5,-3]])
pl.figure()
Q = pl.quiver(U,V,FU,FV, units='height', hold=True)
#sol = odeint(g, con[0], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='y')
#
#sol = odeint(g, con[1], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1,color='b')
#
#sol = odeint(g, con[2], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='m')
#
#sol = odeint(g, con[3], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='r')
#
pl.autoscale(enable=True,axis='Both', tight=True)
#tc.AutoLocator()
tc.MaxNLocator(9,symmetric=True)
#pl.xlabel('u', weight='bold')
#pl.ylabel('v', weight='bold')
#pl.title('u\'=u dan v\'=-2v',weight='bold')
#pl.autoscale()z
pl.show()
---
but i get picture like in this attach... (aa.png)
what i need is to Make side of figure stright... not oblique...
like this attach (ab.png)...
with coresponding code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 10 20:33:32 2012
@author: fajar
"""
from numpy import linspace, meshgrid, array
import pylab as pl
from scipy.integrate import odeint
# membuat vektor
u = linspace(-5,5,21)
v = linspace(-5,5,21)
U,V = meshgrid(u,v)
def fu(u,v):return u
def fv(u,v):return -2*v
FU = fu(U,V)
FV = fv(U,V)
# sistem Persamaan:
def g(x,t):
y1 = x[0]
y2 = -2*x[1]
return [y1, y2]
time = linspace(0,1,100)
con = array([[1.5,3],[1.5,-3],[-1.5,3],[-1.5,-3]])
pl.figure()
Q = pl.quiver(U,V,FU,FV, units='height', hold=True)
sol = odeint(g, con[0], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='y')
sol = odeint(g, con[1], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1,color='b')
sol = odeint(g, con[2], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='m')
sol = odeint(g, con[3], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='r')
pl.autoscale(enable=True,axis='Both', tight =True)
pl.xlabel('u', weight='bold')
pl.ylabel('v', weight='bold')
pl.title('u\'=u dan v\'=-2v',weight='bold')
pl.show()
-- 
i'm sorry, i didn't well to speak english, but i guess you know what 
mean... thanks before....
aa.png
ab.png
From: aa <tel...@gm...> - 2012年03月11日 15:09:07
Attachments: aa.png ab.png
How to Get symmetric plotting in pylab....
i tried this code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 10 20:33:32 2012
@author: fajar
"""
from numpy import linspace, meshgrid, array
import matplotlib.pyplot as pl
import matplotlib.ticker as tc
from scipy.integrate import odeint
# membuat vektor
u = linspace(-5,5,25)
v = linspace(-5,5,25)
U,V = meshgrid(u,v)
def fu(u,v): return 2*u-2*v
def fv(u,v): return 2*u-3*v
FU = fu(U,V)
FV = fv(U,V)
# sistem Persamaan:
def g(x,t):
y1 = 2*x[0]-1*x[1]
y2 = 1*x[0]-2*x[1]
return [y1, y2]
time = linspace(-1,-.6,100)
con = array([[1,2],[1.5,-3],[-1.5,3],[-1.5,-3]])
pl.figure()
Q = pl.quiver(U,V,FU,FV, units='height', hold=True)
#sol = odeint(g, con[0], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='y')
#
#sol = odeint(g, con[1], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1,color='b')
#
#sol = odeint(g, con[2], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='m')
#
#sol = odeint(g, con[3], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='r')
#
pl.autoscale(enable=True,axis='Both', tight=True)
#tc.AutoLocator()
tc.MaxNLocator(9,symmetric=True)
#pl.xlabel('u', weight='bold')
#pl.ylabel('v', weight='bold')
#pl.title('u\'=u dan v\'=-2v',weight='bold')
#pl.autoscale()z
pl.show()
---
but i get picture like in this attach... (aa.png)
what i need is to Make side of figure stright... not oblique...
like this attach (ab.png)...
with coresponding code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 10 20:33:32 2012
@author: fajar
"""
from numpy import linspace, meshgrid, array
import pylab as pl
from scipy.integrate import odeint
# membuat vektor
u = linspace(-5,5,21)
v = linspace(-5,5,21)
U,V = meshgrid(u,v)
def fu(u,v):return u
def fv(u,v):return -2*v
FU = fu(U,V)
FV = fv(U,V)
# sistem Persamaan:
def g(x,t):
y1 = x[0]
y2 = -2*x[1]
return [y1, y2]
time = linspace(0,1,100)
con = array([[1.5,3],[1.5,-3],[-1.5,3],[-1.5,-3]])
pl.figure()
Q = pl.quiver(U,V,FU,FV, units='height', hold=True)
sol = odeint(g, con[0], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='y')
sol = odeint(g, con[1], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1,color='b')
sol = odeint(g, con[2], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='m')
sol = odeint(g, con[3], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='r')
pl.autoscale(enable=True,axis='Both', tight =True)
pl.xlabel('u', weight='bold')
pl.ylabel('v', weight='bold')
pl.title('u\'=u dan v\'=-2v',weight='bold')
pl.show()
--
i'm sorry, i didn't well to speak english, but i guess you know what 
mean... thanks before.... :)
From: aa <tel...@gm...> - 2012年03月11日 15:07:35
Attachments: aa.png ab.png
How to Get symmetric plotting in pylab....
i tried this code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 10 20:33:32 2012
@author: fajar
"""
from numpy import linspace, meshgrid, array
import matplotlib.pyplot as pl
import matplotlib.ticker as tc
from scipy.integrate import odeint
# membuat vektor
u = linspace(-5,5,25)
v = linspace(-5,5,25)
U,V = meshgrid(u,v)
def fu(u,v): return 2*u-2*v
def fv(u,v): return 2*u-3*v
FU = fu(U,V)
FV = fv(U,V)
# sistem Persamaan:
def g(x,t):
y1 = 2*x[0]-1*x[1]
y2 = 1*x[0]-2*x[1]
return [y1, y2]
time = linspace(-1,-.6,100)
con = array([[1,2],[1.5,-3],[-1.5,3],[-1.5,-3]])
pl.figure()
Q = pl.quiver(U,V,FU,FV, units='height', hold=True)
#sol = odeint(g, con[0], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='y')
#
#sol = odeint(g, con[1], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1,color='b')
#
#sol = odeint(g, con[2], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='m')
#
#sol = odeint(g, con[3], time)
#pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='r')
#
pl.autoscale(enable=True,axis='Both', tight=True)
#tc.AutoLocator()
tc.MaxNLocator(9,symmetric=True)
#pl.xlabel('u', weight='bold')
#pl.ylabel('v', weight='bold')
#pl.title('u\'=u dan v\'=-2v',weight='bold')
#pl.autoscale()z
pl.show()
---
but i get picture like in this attach... (aa.png)
what i need is to Make side of figure stright... not oblique...
like this attach (ab.png)...
with coresponding code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 10 20:33:32 2012
@author: fajar
"""
from numpy import linspace, meshgrid, array
import pylab as pl
from scipy.integrate import odeint
# membuat vektor
u = linspace(-5,5,21)
v = linspace(-5,5,21)
U,V = meshgrid(u,v)
def fu(u,v):return u
def fv(u,v):return -2*v
FU = fu(U,V)
FV = fv(U,V)
# sistem Persamaan:
def g(x,t):
y1 = x[0]
y2 = -2*x[1]
return [y1, y2]
time = linspace(0,1,100)
con = array([[1.5,3],[1.5,-3],[-1.5,3],[-1.5,-3]])
pl.figure()
Q = pl.quiver(U,V,FU,FV, units='height', hold=True)
sol = odeint(g, con[0], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='y')
sol = odeint(g, con[1], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1,color='b')
sol = odeint(g, con[2], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='m')
sol = odeint(g, con[3], time)
pl.plot(sol[:,0], sol[:,1], linewidth=2.1 , color='r')
pl.autoscale(enable=True,axis='Both', tight =True)
pl.xlabel('u', weight='bold')
pl.ylabel('v', weight='bold')
pl.title('u\'=u dan v\'=-2v',weight='bold')
pl.show()
--
i'm sorry, i didn't well to speak english, but i guess you know what 
mean... thanks before.... :)
From: Goyo <goy...@gm...> - 2012年03月11日 14:19:54
El día 11 de marzo de 2012 11:31, gsal <sal...@gm...> escribió:
>
> I am not quite sure what you are asking, but, can you simply just add your
> own attribute to the window objects? Python is friendly that way, you know?
> It's dynamic.
There are some dialogs not accesible using the mpl api. The save
dialogs seem to be the standard ones for the underlying toolkit so
reading the toolkit docs may help. Then there are the subplot params
configuration dialogs.
Goyo
From: Goyo <goy...@gm...> - 2012年03月11日 14:13:00
El día 11 de marzo de 2012 12:08, todd rme <tod...@gm...> escribió:
> I am interested in making a python GUI that includes an axis. Qt's
> python bindings offers most of the GUI elements I need, and Qt
> designer provides a great graphical design tool for making python user
> interfaces. However, I notice that matplotlib is not integrated with
> Qt Designer. Qt Designer allows other programs to integrate with it
> by using plugins. However, matplotlib does not ship a Qt Designer
> plugin. It seems that it is possible to use one, since python (x,y)
> has a matplotlib Qt Designer plugin, but that is windows and I am
> using Linux. Is there any chance that matplotlib could ship a Qt
> Designer plugin?
You should be able to use the plugin anyway. This thread is a bit
disapointing but can be useful:
https://groups.google.com/forum/?fromgroups#!topic/pythonxy/xSQkvxEygYE
There's also a tutorial in the scipy cookbook --maybe obsolete.
http://www.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer
Goyo
From: Christopher G. <chr...@gm...> - 2012年03月11日 13:33:03
On Sun, Mar 11, 2012 at 2:06 PM, Mike Kaufman <mc...@gm...> wrote:
> On 3/11/12 8:14 AM, cgraves wrote:
>
>>
>> Hi, here is an example script which places minor ticks with 2 per major
>> tick
>> (minor tick spacing is "fractional" of major tick spacing with relative
>> interval of 1/2):
>>
>> from pylab import *
>> fig=figure()
>> ax=subplot(111)
>> ax.autoscale(tight=True)
>> plot([1,2,4],[1,2,3])
>> x_ticks_maj_spacing =
>> float(abs(ax.xaxis.get_**ticklocs()[0]-ax.xaxis.get_**ticklocs()[1]))
>> x_ticks_min_spacing = x_ticks_maj_spacing/2
>> ax.xaxis.set_minor_locator(**MultipleLocator(x_ticks_min_**spacing))
>> y_ticks_maj_spacing =
>> float(abs(ax.yaxis.get_**ticklocs()[0]-ax.yaxis.get_**ticklocs()[1]))
>> y_ticks_min_spacing = y_ticks_maj_spacing/2
>> ax.yaxis.set_minor_locator(**MultipleLocator(y_ticks_min_**spacing))
>> show()
>>
>> This works fine. However, if one changes the axes limits then the major
>> ticks get automatically adjusted to a different interval but the minor
>> ticks
>> remain at the positions they were already at. To see this, either use the
>> zoom tools or do the following after running the above:
>>
>> xlim(1,2.5)
>> fig.canvas.draw()
>>
>> The question is, what is the best way to maintain the fractional minor
>> tick
>> spacing? I suppose one could set up a way to update the set_minor_locator
>> and redraw the figure each time the figure axes limits are adjusted, but
>> is
>> there a better way?
>>
>
> Try this:
>
> from pylab import *
> from matplotlib.ticker import AutoMinorLocator
>
> clf()
> ax=subplot(111)
> ax.autoscale(tight=True)
> plot([1,2,4],[1,2,3])
> ax.xaxis.set_minor_locator(**AutoMinorLocator(2))
> ax.yaxis.set_minor_locator(**AutoMinorLocator(2))
> draw()
>
> M
>
> PS: I believe this is a fairly new feature...
>
Thanks! Great news that AutoMinorLocator has been added and accomplishes
this. Regarding the P.S. I can confirm that the feature was not in
matplotlib 1.0.1 - I had to update to 1.1.0 to use it.
Best /Chris
From: Mike K. <mc...@gm...> - 2012年03月11日 13:06:46
On 3/11/12 8:14 AM, cgraves wrote:
>
> Hi, here is an example script which places minor ticks with 2 per major tick
> (minor tick spacing is "fractional" of major tick spacing with relative
> interval of 1/2):
>
> from pylab import *
> fig=figure()
> ax=subplot(111)
> ax.autoscale(tight=True)
> plot([1,2,4],[1,2,3])
> x_ticks_maj_spacing =
> float(abs(ax.xaxis.get_ticklocs()[0]-ax.xaxis.get_ticklocs()[1]))
> x_ticks_min_spacing = x_ticks_maj_spacing/2
> ax.xaxis.set_minor_locator(MultipleLocator(x_ticks_min_spacing))
> y_ticks_maj_spacing =
> float(abs(ax.yaxis.get_ticklocs()[0]-ax.yaxis.get_ticklocs()[1]))
> y_ticks_min_spacing = y_ticks_maj_spacing/2
> ax.yaxis.set_minor_locator(MultipleLocator(y_ticks_min_spacing))
> show()
>
> This works fine. However, if one changes the axes limits then the major
> ticks get automatically adjusted to a different interval but the minor ticks
> remain at the positions they were already at. To see this, either use the
> zoom tools or do the following after running the above:
>
> xlim(1,2.5)
> fig.canvas.draw()
>
> The question is, what is the best way to maintain the fractional minor tick
> spacing? I suppose one could set up a way to update the set_minor_locator
> and redraw the figure each time the figure axes limits are adjusted, but is
> there a better way?
Try this:
from pylab import *
from matplotlib.ticker import AutoMinorLocator
clf()
ax=subplot(111)
ax.autoscale(tight=True)
plot([1,2,4],[1,2,3])
ax.xaxis.set_minor_locator(AutoMinorLocator(2))
ax.yaxis.set_minor_locator(AutoMinorLocator(2))
draw()
M
PS: I believe this is a fairly new feature...
From: cgraves <chr...@gm...> - 2012年03月11日 12:14:14
Hi, here is an example script which places minor ticks with 2 per major tick
(minor tick spacing is "fractional" of major tick spacing with relative
interval of 1/2):
from pylab import *
fig=figure()
ax=subplot(111)
ax.autoscale(tight=True) 
plot([1,2,4],[1,2,3])
x_ticks_maj_spacing =
float(abs(ax.xaxis.get_ticklocs()[0]-ax.xaxis.get_ticklocs()[1]))
x_ticks_min_spacing = x_ticks_maj_spacing/2
ax.xaxis.set_minor_locator(MultipleLocator(x_ticks_min_spacing))
y_ticks_maj_spacing =
float(abs(ax.yaxis.get_ticklocs()[0]-ax.yaxis.get_ticklocs()[1]))
y_ticks_min_spacing = y_ticks_maj_spacing/2
ax.yaxis.set_minor_locator(MultipleLocator(y_ticks_min_spacing))
show()
This works fine. However, if one changes the axes limits then the major
ticks get automatically adjusted to a different interval but the minor ticks
remain at the positions they were already at. To see this, either use the
zoom tools or do the following after running the above:
xlim(1,2.5)
fig.canvas.draw()
The question is, what is the best way to maintain the fractional minor tick
spacing? I suppose one could set up a way to update the set_minor_locator
and redraw the figure each time the figure axes limits are adjusted, but is
there a better way?
Best,
Chris
-- 
View this message in context: http://old.nabble.com/how-to-maintain-fractional-minor-tick-spacing-tp33480612p33480612.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: todd r. <tod...@gm...> - 2012年03月11日 11:09:05
I am interested in making a python GUI that includes an axis. Qt's
python bindings offers most of the GUI elements I need, and Qt
designer provides a great graphical design tool for making python user
interfaces. However, I notice that matplotlib is not integrated with
Qt Designer. Qt Designer allows other programs to integrate with it
by using plugins. However, matplotlib does not ship a Qt Designer
plugin. It seems that it is possible to use one, since python (x,y)
has a matplotlib Qt Designer plugin, but that is windows and I am
using Linux. Is there any chance that matplotlib could ship a Qt
Designer plugin?
-Todd
From: gsal <sal...@gm...> - 2012年03月11日 10:31:50
I am not quite sure what you are asking, but, can you simply just add your
own attribute to the window objects? Python is friendly that way, you know?
It's dynamic. 
-- 
View this message in context: http://old.nabble.com/Set-various-parameters-of-a-plot-window.-tp33479160p33480317.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: gsal <sal...@gm...> - 2012年03月11日 10:27:19
Don't have a solution; I was just wondering if you have tried something else,
like using ipython instead of IDLE. ipython may be better suited for
threading and working with pylab, etc. 
-- 
View this message in context: http://old.nabble.com/Runtime-error-with-matplotlib-in-IDLE-tp33478456p33480306.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Ignas A. <ani...@gm...> - 2012年03月10日 23:53:14
Hello everybody,
I am trying to write a rule for AwesomeWM, so that all matplotlib
related windows would be floating and not tiled. For this purpose I want
to filter matplotlib windows by some window attribute, like class,
instance or title. Is there a way to modify the window class or instance
easily?
I already know how to modify the title of the window, but this is not
sufficient as any dialogs, which would be created from the toolbar on
the plot window will not have the same title and the filtering can not
be applied to them.
If I have not explained this clearly enough, please let me know, what
I need to clarify.
All best,
Ignas A.
From: Catherine T. <cab...@gm...> - 2012年03月10日 20:10:37
I have an error when running my script using matplotlib using IDLE. I
suspect it is something to do with either numpy or matplotlib and I was
wondering if any other users have had a similar problem. I have recently
installed Python, matplotlib and numpy, I have not had it working correctly
using IDLE on this machine. The error message is:
Runtime Error!
Program: C:\Python27\pythonw.exe
This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's supporter team for more information.
The window header says Microsoft Visual C++ Runtime Library (which seems to
be about debugging). The error occurs about 50% of the time. When I run my
script in the command line it runs fine everytime. I am using matplotlib
and generating a pdf. If I remove the pdf generation step I still get the
error. But running another script (on the csv module) don't seem to
generate the error. I have searched on the internet without luck
(suggestion of installing visual studio which I have got) or posting to the
scipy list (well Im not using scipy).
I am using Win7 32 bit and matplotlib 1.1 and numpy 1.6.1 and python 2.7.
Has anyone else had similar message?
Catherine
From: stetogias <ste...@gm...> - 2012年03月10日 17:53:19
Not sure if this is the right place to post this...please instruct if wrong
I'm plotting some audio data, which can get big, and alongside I have
subplots of barcharts that represent onsets, RMS etc...
Since I have many onsets plotting the whole thing at once results in such
dense barcharts that the 
graph is useless.
So currently I am plotting 5 seconds of audio with the respective barcharts
and use forward/backward buttons to skim through the data. Show next 5
seconds etc. The whole thing is embedded in PyQt.
It works but I just learned about the ScrollArea widget so I thought why not
plot the whole thing and just use scroll to move around the plot.
My main question is which is the common practice for doing this sort of
thing?
I know the data beforehand so I don't need dynamic updating. Seems scrolling
should be the easiest way to do this but I haven't found example and my code
doesn't work yet.
Thanks
Stelios
-- 
View this message in context: http://old.nabble.com/Scrolling-window-tp33477938p33477938.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2012年03月10日 15:09:32
One way to use images as a marker would be to use offsetbox module.
Here is an example adopted from
http://matplotlib.sourceforge.net/examples/pylab_examples/demo_annotation_box.html
Regards,
-JJ
import matplotlib.pyplot as plt
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
from matplotlib.cbook import get_sample_data
import numpy as np
if 1:
 fig = plt.gcf()
 fig.clf()
 ax = plt.subplot(111)
 xy = [0.3, 0.55]
 arr = np.arange(100).reshape((10,10))
 im = OffsetImage(arr, zoom=2)
 ab = AnnotationBbox(im, xy,
 xycoords='data',
 pad=0.3,
 )
 ax.add_artist(ab)
 # another image
 from matplotlib._png import read_png
 fn = get_sample_data("lena.png", asfileobj=False)
 arr_lena = read_png(fn)
 imagebox = OffsetImage(arr_lena, zoom=0.1)
 xy = (0.7, 0.4)
 ab = AnnotationBbox(imagebox, xy,
 xycoords='data',
 pad=0.5,
 )
 ax.add_artist(ab)
 ax.set_xlim(0, 1)
 ax.set_ylim(0, 1)
 plt.draw()
 plt.show()
On Thu, Mar 8, 2012 at 4:25 AM, Michael Droettboom <md...@st...> wrote:
> It would be a nice idea. I'm not sure it's something that would work
> terribly well in vector backends as the images may not scale well. I should
> mention that there is already support to use arbitrary Unicode characters or
> math expressions as markers already, which does work well in vector
> backends.
>
> Mike
>
>
> On 03/07/2012 01:59 PM, C M wrote:
>
> I've for now taken a different approach that means I won't need custom
> markers from images.
>
> But I'm just curious: is there any wish/plans in Matplotlib to add support
> for this? I think it could do a lot to expand what's possible in terms of
> the look and feel of plots (even without things drifing into USA Today
> territory!).
>
> Just my 0ドル.02
>
> Che
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Patrick M. <pat...@gm...> - 2012年03月10日 14:55:12
Hi, JJ,
I wonder why the simple text command does not work for you? e.g.,
>
> def add_center_text(ax):
> ax.text(0.5, 0.9075, "Centered Title", ha='center', va='center',
> fontsize=18,
> bbox=dict(boxstyle='round, pad=0.5, rounding_size=0.25',
> fc="white",
> ec="k", lw=2),
> transform=ax.transAxes)
>
>
The simple answer here is that I didn't understand what the transform
keyword argument was doing. I'm not entirely sure, still, but I gather it
has something to do with handling the changing of the axes coordinates.
 Man, I still have so much to learn about MPL....
Also, annotate command gives you more flexibility in text positioning.
>
> The axes location is supposed to be known during the drawing time. To
> get the axes position, you may do something like
>
> ax1._axes_locator(ax1, fig._cachedRenderer)
>
> Of course, this need to be done after the figure is properly drawn
> (e.g., after calling draw()) or during the drawing time.
>
>
Excellent. Thank you fot taking the time to explain how this works.
Although your first suggestion is what I need for the moment, I'm glad to
know how to get the axes positions, should I ever need them.
Thanks again!
Patrick
From: Jae-Joon L. <lee...@gm...> - 2012年03月10日 14:33:03
I wonder why the simple text command does not work for you? e.g.,
def add_center_text(ax):
 ax.text(0.5, 0.9075, "Centered Title", ha='center', va='center',
fontsize=18,
 bbox=dict(boxstyle='round, pad=0.5, rounding_size=0.25', fc="white",
 ec="k", lw=2),
 transform=ax.transAxes)
Also, annotate command gives you more flexibility in text positioning.
The axes location is supposed to be known during the drawing time. To
get the axes position, you may do something like
 ax1._axes_locator(ax1, fig._cachedRenderer)
Of course, this need to be done after the figure is properly drawn
(e.g., after calling draw()) or during the drawing time.
Regards,
-JJ
On Sat, Mar 10, 2012 at 1:00 PM, Patrick Marsh <pat...@gm...> wrote:
> Hi, All,
>
> Here's an update to the problem I submitted last night.
>
> I was able to utilize anchored text to work for centering a title, which is
> ultimately what I'm wanting to do now. (Although, I'd still like to know the
> proper way to get the axes bounds when using axes_divider). The new problem
> lies how to horizontally align the text inside the anchored box. When the
> horizontal alignment is "left", the text lines up in the anchored box.
> However, as the updated example below shows, then you use "center" or
> "right", the text is now positioned outside the anchored box. Is this a bug
> in how the text is aligned? If so, how might I go about tracking it down?
>
>
> https://gist.github.com/2004869 (rev: b984ca)
>
>
> Cheers,
> Patrick
> ---
> Patrick Marsh
> Ph.D. Student / Liaison to the HWT
> School of Meteorology / University of Oklahoma
> Cooperative Institute for Mesoscale Meteorological Studies
> National Severe Storms Laboratory
> http://www.patricktmarsh.com
>
>
>
> On Fri, Mar 9, 2012 at 12:12 AM, Patrick Marsh <pat...@gm...>
> wrote:
>>
>> Greetings,
>>
>> Let me begin by saying that I've fallen in love with ImageGrid. I love the
>> control it gives me in setting up plots, and I really like the control it
>> offers for setting up a colorbar. Unfortunately, like all relationships,
>> ImageGrid and I have hit a rough patch.
>>
>> I like to manually place titles and other boxes of texts on plots that I
>> make using ImageGrid. However, to center things I have to know what the axes
>> bounds are so I can do the centering calculations. Unfortunately, when using
>> ImageGrid, or axes_divider, I have yet to find a way to get the axes bounds
>> that are actually used to do the plotting. When I try to use
>>
>> ax.get_position().bounds
>>
>> I get the pre-adjusted bounds, even if I use plt.draw() before requesting
>> the axes_positions. This means the only way I can center the text is by
>> guessing what the final axes bounds will be. Is there any way of getting
>> the final bounds? It appears anchored text is able to do it, but I haven't
>> been able to...
>>
>>
>> Here's a self-contained example script that demonstrates the problem. I
>> don't use ImageGrid, instead using axes_divider, however this is the same
>> problem that AxesGrid has. (I'm guessing this is because ImageGrid
>> ultimately does what I did here behind the scenes.)
>>
>> https://gist.github.com/2004869
>>
>>
>> Thanks for any help!
>>
>>
>> Patrick
>> ---
>> Patrick Marsh
>> Ph.D. Student / Liaison to the HWT
>> School of Meteorology / University of Oklahoma
>> Cooperative Institute for Mesoscale Meteorological Studies
>> National Severe Storms Laboratory
>> http://www.patricktmarsh.com
>>
>>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
9 messages has been excluded from this view by a project administrator.

Showing results of 368

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