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
(19) |
2
(30) |
3
(14) |
4
(1) |
5
(16) |
6
(7) |
7
(12) |
8
(14) |
9
(35) |
10
(16) |
11
(31) |
12
(6) |
13
(14) |
14
(13) |
15
(20) |
16
(15) |
17
(27) |
18
(5) |
19
(10) |
20
(22) |
21
(20) |
22
(30) |
23
(25) |
24
(11) |
25
(2) |
26
(2) |
27
(23) |
28
(20) |
29
(26) |
30
(25) |
31
(7) |
|
On Thu, Jul 9, 2009 at 10:05 AM, Mustafa Sakalsiz <sak...@gm...>wrote: > Hi all, > > I have a PyQt application and want to show some charts on it. However, I > don't want to show the charts on a classic widget, instead I need to show > the charts on a QGraphicsView/QGraphicsScene object. Because I am using > graphics view's zoom properties. > > Therefore I want to paint the charts on a QPicture object. I looked at the > Qt backend examples and realized that the examples paints the charts on a > image, then converts the image to the a QImage object. > > Drawing on a SVG is also enough for me, because I can show SVG items on > graphics view framework, however SVG backend doesn't draw well numbers and > texts. > > Please help me, All I want is resolution and machine independant charts > that can be drawn on Qt objects. > > I don't think this is currently possible without using the output from the svg backend. The qt backend is only designed to render images produced by AGG, native qt rendering is not implemented. Darren
On Thu, Jul 9, 2009 at 3:40 AM, guillaume ranquet <gra...@wy...>wrote: > Hi again. > > I found out that removing the resize handler of the wxpanel gives me a > nice animated plot that works as expected (but with no resize :-/) > > def _SetSize(self): > pixels = tuple(self.parent.GetClientSize()) > self.SetSize(pixels) > self.canvas.SetSize(pixels) > self.figure.set_size_inches(float(pixels[0])/self.figure.get_dpi(), > float(pixels[1])/self.figure.get_dpi(),forward=True) > > > I took that code from: > http://www.scipy.org/Matplotlib_figure_in_a_wx_panel > any hints on what to do from there? > I have run your code and I am not sure what your issue is. What is wrong with how it is behaving? You say in the first post, "the resizing of the window make the plot look terribly broken", but I am not seeing that. And what platform and version of wx and mpl are you using? Che > > guillaume ranquet wrote: > > Hi list (yes, me, again :D) > > > > I'm having difficulties with matplotlib svn (rev 7249) and animations. > > I'm a bit lost on what I have to do to get my animation running smoothly? > > > > I had various attempts, It seems that the best result I can have is by > > totally skipping the canvas.restore_region(self.background) shown in the > > examples : the resizing of the window make the plot look terribly broken > > > > sorry for this question that seems well covered by documentation and > > examples :S > > I'm attaching a sample code that reproduces the behavior of my app, It's > > a bit long but I hope there's some good things in it that can be usefull > > to others :) > > > > > > ===code snippet=== > > import wxversion > > wxversion.ensureMinimal('2.8') > > > > import numpy as np > > import matplotlib.pyplot as plt > > > > from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as > > FigureCanvas > > > > import wx > > import wx.aui > > > > from matplotlib.figure import Figure > > import sys > > import getopt > > from threading import * > > from itertools import izip > > import time > > > > class myplotData(Figure): > > def __init__(self,name,width=5,height=4,dpi=60,x_axis=None): > > Figure.__init__(self,figsize=(width, height),dpi=dpi) > > self.name = name > > self.ax = self.add_subplot(111,label=name,animated=True) > > self.bg = None > > self.mdirty = False > > > > def refreshbg(self): > > self.bg = self.canvas.copy_from_bbox(self.ax.bbox) > > > > def feed(self,n): > > timestamp = n[0] > > self.n = 0 > > if self.bg == None: > > self.canvas = self.ax.figure.canvas > > self.canvas.draw() > > self.bg = self.canvas.copy_from_bbox(self.ax.bbox) > > for xs in n[1:]: > > self.ax.plot([timestamp],[xs],animated=True) > > return > > #self.canvas.restore_region(self.bg) > > mylines = self.ax.get_lines() > > for xs,line in izip(n[1:],mylines): > > x,y = line.get_data() > > x = np.concatenate((x,[timestamp])) > > y = np.concatenate((y,[xs])) > > line.set_data([x,y]) > > self.ax.set_xlim(xmax=timestamp) > > curyminlim,curymaxlim = self.ax.get_ylim() > > > > self.ax.set_ylim(ymin=min(xs,curyminlim),ymax=max(xs,curymaxlim)) > > self.ax.draw_artist(line) > > self.mdirty = True > > wx.WakeUpIdle() > > > > def blit(self): > > if self.mdirty: > > self.mdirty = False > > self.canvas.blit(self.ax.get_figure().bbox) > > > > class CanvasPanel(wx.Panel): > > def __init__(self,name,callback=None,parent=None): > > wx.Panel.__init__(self, parent) > > self.SetSize((120, 80)) > > self.figure = myplotData(name) > > self.canvas = FigureCanvas(self,-1,self.figure) > > self.parent = parent > > self.callback = callback > > color = (255,255,255) > > self.SetColor(color) > > self._SetSize() > > self._resizeflag = False > > self.Bind(wx.EVT_IDLE, self._onIdle) > > self.Bind(wx.EVT_SIZE, self._onSize) > > > > def SetColor(self,rgbtuple=None): > > """Set figure and canvas colours to be the same.""" > > if rgbtuple is None: > > rgbtuple = > > wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE).Get() > > clr = [c/255. for c in rgbtuple] > > self.figure.set_facecolor(clr) > > self.figure.set_edgecolor(clr) > > self.canvas.SetBackgroundColour(wx.Colour(*rgbtuple)) > > > > def _onSize(self,event): > > self._resizeflag = True > > > > def _onIdle(self,evt): > > if self._resizeflag: > > self._resizeflag = False > > self._SetSize() > > self.figure.blit() > > > > def _SetSize(self): > > pixels = tuple(self.parent.GetClientSize()) > > self.SetSize(pixels) > > self.canvas.SetSize(pixels) > > > self.figure.set_size_inches(float(pixels[0])/self.figure.get_dpi(), > > > float(pixels[1])/self.figure.get_dpi()) > > #self.figure.refreshbg() > > > > def process(self,data): > > if self.callback != None: > > x = self.callback(data) > > self.figure.feed(x) > > else: > > self.figure.feed(data) > > > > # Define notification event for thread notifications > > EVT_RESULT_ID = wx.NewId() > > > > def EVT_RESULT(win, func): > > """Define Result Event.""" > > win.Connect(-1, -1, EVT_RESULT_ID, func) > > > > class ResultEvent(wx.PyEvent): > > """Simple event to carry arbitrary result data.""" > > def __init__(self, data): > > """Init Result Event.""" > > wx.PyEvent.__init__(self) > > self.SetEventType(EVT_RESULT_ID) > > self.data = data > > > > class ParserThread(Thread): > > def __init__(self,source,notify_window): > > Thread.__init__(self) > > self._notify_window = notify_window > > self.data = np.arange(0,2*np.pi,0.01) > > self.n = 0 > > self.round = 0 > > self.start() > > > > def run(self): > > while(1): > > mbuff = {} > > mbuff['name'] = "My Sin Plot" > > mbuff['x'] = self.data[self.n] + self.round*2*np.pi > > mbuff['y1'] = np.sin(mbuff['x']) > > mbuff['y2'] = np.sin(mbuff['x'] + np.pi/2) > > self.n+=1 > > if self.n == len(self.data): > > self.n = 0 > > self.round += 1 > > wx.PostEvent(self._notify_window, > ResultEvent(('test',[mbuff]))) > > time.sleep(.1) > > > > def mycback(data): > > return data['x'],data['y1'],data['y2'] > > > > class MyApp(wx.Frame): > > > > def __init__(self,parent=None, > > id=wx.ID_ANY,pos=wx.DefaultPosition,size=wx.DefaultSize, > > style=wx.DEFAULT_FRAME_STYLE): > > wx.Frame.__init__(self, parent) > > self.bestsize = (120,75) > > self.SetSize(self.GetBestSize()) > > self.panel = wx.Panel(self,wx.ID_ANY) > > self.panel.nb = wx.aui.AuiNotebook(self.panel) > > self.label = > wx.StaticText(self.panel.nb,wx.ID_ANY,"\n\n\n\naaa\n") > > self.panel.nb.AddPage(self.label, "txt") > > sizer = wx.BoxSizer() > > sizer.Add(self.panel.nb, 1, wx.EXPAND) > > self.panel.SetSizer(sizer) > > self.plotlist = {} > > self.Fit() > > EVT_RESULT(self,self.OnResult) > > self.worker = ParserThread(5758,self) > > > > def OnResult(self,event): > > tag,mbuff = event.data > > if tag == -1: > > return > > for buff in mbuff: > > if not self.plotlist.has_key(buff['name']): > > cback = mycback > > page = CanvasPanel(buff['name'],mycback,self.panel.nb) > > self.panel.nb.AddPage(page,buff['name']) > > self.plotlist[buff['name']] = page > > myPlot = self.plotlist[buff['name']] > > myPlot.process(buff) > > > > def main(argv=None): > > if argv != None: > > sys.argv = argv > > app = wx.App() > > frame = MyApp() > > frame.Show() > > app.MainLoop() > > > > if __name__ == "__main__": > > main() > > ===code snippet=== > > ---- > > This message contains confidential information and may contain > information that is legally privileged. If you have received this message > by mistake, please immediately notify us and delete the original message. > Thank you. > > > > Ce message contient des informations confidentielles. S'il vous est > parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en > faire aucun usage et de n'en garder aucune copie. > > ---- > > > > > ------------------------------------------------------------------------------ > > Enter the BlackBerry Developer Challenge > > This is your chance to win up to 100,000ドル in prizes! For a limited time, > > vendors submitting new applications to BlackBerry App World(TM) will have > > the opportunity to enter the BlackBerry Developer Challenge. See full > prize > > details at: http://p.sf.net/sfu/Challenge > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ---- > This message contains confidential information and may contain information > that is legally privileged. If you have received this message by mistake, > please immediately notify us and delete the original message. Thank you. > > Ce message contient des informations confidentielles. S'il vous est > parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en > faire aucun usage et de n'en garder aucune copie. > ---- > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
I believe most of the plots have been made using this: http://people.csail.mit.edu/rasmus/summon/index.shtml#download I'm currently playing around with 2D OpenGL visualization of large datasets and stumbled upon this... which reminded me of this post... may be of use to someone j. Gökhan SEVER-2 wrote: > > For those who haven't seen the article on slashdot: > > A Visual Expedition Inside the Linux File > Systems<http://cs.jhu.edu/%7Erazvanm/fs-expedition/> > > Some figures are highly eye-catching. Some of which I haven't seen in > matplotlib gallery nor could be produced with. > > Gökhan > > ------------------------------------------------------------------------------ > 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 > > -- View this message in context: http://www.nabble.com/Visuals-for-linux-file-systems-tp24083209p24410969.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hello, how can I center axis tick labels, so that the labels ends up at the center between 2 ticks. thanks in advance, Johann
Hi all, I have a PyQt application and want to show some charts on it. However, I don't want to show the charts on a classic widget, instead I need to show the charts on a QGraphicsView/QGraphicsScene object. Because I am using graphics view's zoom properties. Therefore I want to paint the charts on a QPicture object. I looked at the Qt backend examples and realized that the examples paints the charts on a image, then converts the image to the a QImage object. Drawing on a SVG is also enough for me, because I can show SVG items on graphics view framework, however SVG backend doesn't draw well numbers and texts. Please help me, All I want is resolution and machine independant charts that can be drawn on Qt objects. Saki
In your example, you are adding the axes to the figure twice: axes = self.figure.add_subplot(1, 1, 1) self.figure.add_axes(axes) add_subplot both creates and adds the axes to the figure, so it is unnecessary to later add it. add_axes is intended for axes that have been created directly from the Axes constructor. Unfortunately, special care needs to be taken for overlapping axes (something that matplotlib could maybe improve on), so as you saw, the zooming happens twice. Also, perhaps we should consider raising an exception when the same Axes is added to the Figure twice. (First I'll have to ensure there's no legitimate reason to do so.) In any case, simply removing the second line above appears to be enough to get this to work correctly. Cheers, Mike Jervis Whitley wrote: > Hi, > > Could anyone help me with the following problem I am having. > > http://dpaste.com/64913/ > > The code listed above should be enough to reproduce the problem. > > I on using the zoom function from the toolbar, I find that the figure limits > are set to a smaller size than the zoom i selected - a kind of 'double zoom'. > > > I was able to track down the problem to backend_bases.py in the matplotlib > distribution (current release). > > Inside this file there is a member called 'release_zoom' > > there is a section of code that says.. > > for cur_xypress in self._xypress: > > lastx, lasty, a, ind, lim, trans = cur_xypress > # code > a.transData.inverted() > # code > a.set_xlim((x0, x1)) # etc.. > > > I am finding that there are two items in self._xypress, and that > the 'a' in both of them (axes i think) are the same object > i.e a1 is a2 == True > > this means that a.transData.inverted() is called twice on the same axes. > The first time through the for loop it gets the limits correct, the > second time, they are incorrect > because of the second call to inverted. > > I have implemented a shoddy fix where i check that if the axes is the same > as one that is seen before, I just continue. > > Is anyone else able to see this, or is it just something in the way > i've set up my > original pasted code? > > Cheers, > > Jervis > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Robin wrote: > PS - some minor comments about the sourceforge download page (I dont > know if these can be changed): > On the summary page ( http://sourceforge.net/projects/matplotlib/ ) > the "download now" link which I would think should point to the > latest release point to 0.91. Then when you do 'view all files' > matplotlib-maintenance is the default expanded branch of the tree with > latest version 0.91.4. To get the real new version you have to close > this tree or scroll down to the normal matplotlib branch. If I didn't > know the versions to look for beforehand I think this would be really > confusing - can you make matplotlib the default instead of > matplotlib-maintenance? > This appears to be a bug in the recent updates to the SourceForge interface: https://sourceforge.net/apps/trac/sourceforge/ticket/1748 I have set the default download file to 0.98.5, however, the setting doesn't seem to stick. Hopefully SF will resolve this on their own. > Also I went to the Developer page to find the svn repo > http://sourceforge.net/projects/matplotlib/develop and followed the > instructions there which of course started to pull in the whole repo. > When I found it taking a long time I noticed that I was getting > branches etc I didnt need. I know this is covered with the correct > command in the install page, but I thought it would be handy to change > it here as well to avoid someone else making the mistake I made. > These are very minor things and normally I wouldn't bother mentioning, > but since the matplotlib website etc. seems so nice I figured there is > someone who cares about this stuff - although I'm not sure whether its > possible to change this stuff in sourceforge. > Unfortunately, I don't think this is changeable. It does include the easy-to-miss caveat right underneath it (on certain pages, but not on others, depending on how you get to it): Warning This is a generic Subversion checkout command which will pull all modules, tags and/or branches of the project. Please refer to project home page for specific SVN instructions, or use "Browse Repository" link; in most cases, you will want to add '/trunk' to the HTTPS URL above to check out only trunk (main development line). It's nice to see Sourceforge putting some effort into usability improvements again (though the roll-out has been less than perfect). Hopefully these sorts of things will finally get addressed. Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
This is arguably a "bug" that the dash descriptors aren't being scaled along with the line width. However, I'm loathe to "fix" it as it's been this way a long time, and all backends are at least consistent with one another in this behavior. Note, however, that inkscape, and I suspect other vector graphics tools, don't behave like matplotlib -- the dashes are scaled with the line width -- even though the underlying format, in this case SVG, doesn't behave that way. As a workaround, you can explicitly set the dash sequence, e.g.: plot([1,2,3], lw=6, dashes=(6, 6)) See here: http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.lines.Line2D.set_dashes Cheers, Mike Robin wrote: > Again, apologies if this is an obvious question but I couldn't find the answer. > > With a lw=1 dotted (:) line the dots are square and it looks very > nice. But when I put lw up say to 2 or 3, the dots become rectangular, > which looks a bit odd, particularly at points where the underlying > graph curves sharply compared to the spacing of the dots. > > Is there anyway to keep the dots square (ie as lw=2 for both > dimensions) instead of rectangular? > > Cheers > > Robin > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
hey there! Pau wrote: > ... > 0.00e+00 1.00e-04 81039 > 1.00e-04 2.00e-04 4472 > 2.00e-04 3.00e-04 2033 > ... > > The bins are given by the two first number columns. > > For instance, the first bin is from 0.00e+00 to 1.00e-04 and has the > number of data 81039 hey pau! i do not understand hist well myself, but i think it might be doing something different from what you want. i think that if you run hist on e.g. the numbers 100, 11, 10, 9, 0, 0, 0, 0, 0 and make 10 bins, it will give you x y 0 5 10 3 20 0 30 0 40 0 50 0 60 0 70 0 80 0 90 0 100 1 if you histogram the data on the y-axis, there is no reason why this should be still connected to the x-axis. you have already a histogramm -- if you want to rebin, i guess you should use "histogram" on the x-axis and weight with the y-data. > H = load ( './histo3.dat') > h = H[:, 2] # the third column > > n, bins, patches = hist(h, 997, normed=0, log=0, > facecolor='lightblue', alpha=0.75) > 0 - 90000 --> on x axis > Notice in the data file that x does not get further than 9.96e-02 > So the maximum should be 0.0996 and I am getting 90000 if you pass only the third column to hist, it is a bit unfair to expect it to know the other two ;) good luck, sebastian.
setupext.py was indeed not reading the macosx build information from setup.cfg. I've put a patch here: http://sourceforge.net/tracker/?func=detail&atid=560722&aid=2818964&group_id=80706 (patch number 2818964). The error you're seeing is described in this technical note from Apple: http://developer.apple.com/qa/qa2007/qa1567.html One thing that changed between 0.98.5.3 and the current SVN version is that we're now using matplotlib's path cleanup code, which is in C++. Maybe the linker is picking up different libraries with C++? Though I haven't seen this error on Mac OS X 10.4 or 10.5. --Michiel. --- On Thu, 7/9/09, Robin <ro...@gm...> wrote: > From: Robin <ro...@gm...> > Subject: [Matplotlib-users] current svn fails to build on mac > To: mat...@li... > Date: Thursday, July 9, 2009, 6:11 AM > Hi, > > Just to let folks know the current SVN version fails to > build on a > mac. I built the release (0.98.5.3) successfully from > source so I > think my environment, dependencies etc. should be OK. > > The problem seems to be building mac os x native backend: > building 'matplotlib.backends._macosx' extension > gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk > -fno-strict-aliasing -Wno-long-double -no-cpp-precomp > -mno-fused-madd > -fno-common -dynamic -DNDEBUG -g -O3 > -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API > -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include > -I/usr/local/include -I/usr/include -I/usr/X11R6/include > -I. > -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include > -Isrc -Iagg24/include -I. > -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 > -c src/_macosx.m -o > build/temp.macosx-10.3-i386-2.5/src/_macosx.o > g++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g > -bundle > -undefined dynamic_lookup > build/temp.macosx-10.3-i386-2.5/src/_macosx.o > build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o > build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o > build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o > build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o > build/temp.macosx-10.3-i386-2.5/src/agg_py_transforms.o > build/temp.macosx-10.3-i386-2.5/src/path_cleanup.o > -L/usr/local/lib > -L/usr/lib -L/usr/X11R6/lib -lstdc++ -lm -o > build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so > -framework Cocoa > ld: cycle in dylib re-exports with > /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libGL.dylib > collect2: ld returned 1 exit status > error: command 'g++' failed with exit status 1 > > How can I disable building the mac os x backend. I copied > setup.cfg.example to setup.cfg and have "macosx = False" > but it > doesn't seem to have any effect. "python setup.py config" > still > reports "Mac OS X native: yes". > > Thanks > > Robin > > PS - some minor comments about the sourceforge download > page (I dont > know if these can be changed): > On the summary page ( http://sourceforge.net/projects/matplotlib/ ) > the "download now" link which I would think should > point to the > latest release point to 0.91. Then when you do 'view all > files' > matplotlib-maintenance is the default expanded branch of > the tree with > latest version 0.91.4. To get the real new version you have > to close > this tree or scroll down to the normal matplotlib branch. > If I didn't > know the versions to look for beforehand I think this would > be really > confusing - can you make matplotlib the default instead of > matplotlib-maintenance? > Also I went to the Developer page to find the svn repo > http://sourceforge.net/projects/matplotlib/develop and > followed the > instructions there which of course started to pull in the > whole repo. > When I found it taking a long time I noticed that I was > getting > branches etc I didnt need. I know this is covered with the > correct > command in the install page, but I thought it would be > handy to change > it here as well to avoid someone else making the mistake I > made. > These are very minor things and normally I wouldn't bother > mentioning, > but since the matplotlib website etc. seems so nice I > figured there is > someone who cares about this stuff - although I'm not sure > whether its > possible to change this stuff in sourceforge. > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a > limited time, > vendors submitting new applications to BlackBerry App > World(TM) will have > the opportunity to enter the BlackBerry Developer > Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
> On Wed, Jul 8, 2009 at 10:57 PM, Jae-Joon Lee<lee...@gm...> wrote: >> If you use the svn version of matplotlib, you may use axes_grid toolkit. >> >> http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#insetlocator Wow - this is really amazing. Sometimes it can be a bit frustrating when I'm working to a deadline to figure out the details of Bbox's and such but when I find something like this it really makes it worth while! It does exactly what I want, really easy to use and only took about 5 lines! (It would be nice if there were some docstrings in there though :)) On Thu, Jul 9, 2009 at 4:02 AM, Jae-Joon Lee<lee...@gm...> wrote: > However, It is possible to specify the location of the axes in > normalized axes coordinate. > > http://thread.gmane.org/gmane.comp.python.matplotlib.general/16373 I'm afraid I didn't really understand how to apply this in my case... I guess I would have to set the position and everything by hand instead of using the zoom helper. I preferred to use the zoom helper, but found the legend loc settings put it slightly too close to the edge of the surrounding axes for my taste. So after checking the docstrings for how to position legends I came up with something that works, but it required a minor change to the inset_locator.py to pass the bbox_to_anchor and bbox_transform (it looks like this was intended since they have None default values): robin-mbp-3:~ robince$ diff /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mpl_toolkits/axes_grid/inset_locator.py code/scipy_build/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py 288c288 < axes_locator = AnchoredZoomLocator(parent_axes, zoom=zoom, loc=loc, bbox_to_anchor=bbox_to_anchor,bbox_transform=bbox_transform) --- > axes_locator = AnchoredZoomLocator(parent_axes, zoom=zoom, loc=loc) With this minor change I get exactly what I want! ax1ins = zoomed_inset_axes(ax1, 3, bbox_to_anchor=(0.1,0,1,1),bbox_transform=ax1.transAxes, loc=6) plot_trial_dists(res515[0],8,ax=ax1ins) ax1ins.set_xlim([5, 50]) ax1ins.set_ylim([0, 0.04]) ax1ins.set_xticks([]) ax1ins.set_yticks([]) mark_inset(ax1, ax1ins, loc1=2, loc2=4, fc="none", ec="0.5") thanks again, this is really terrific! Cheers Robin
On Thu, Jul 9, 2009 at 12:15 PM, Robin<ro...@gm...> wrote: > On Thu, Jul 9, 2009 at 12:06 PM, Michiel de Hoon<mjl...@ya...> wrote: >> >> One thing that changed between 0.98.5.3 and the current SVN version is that we're now using matplotlib's path cleanup code, which is in C++. Maybe the linker is picking up different libraries with C++? Though I haven't seen this error on Mac OS X 10.4 or 10.5. >> > > I should have specified I'm on OS X 10.5.7. Xcode 3.0. > As do many others I consistently forget to reply to all on this list. This is the only list I follow that doesn't set the reply-to to go to the list! Cheers Robin
On Thu, Jul 9, 2009 at 11:11 AM, Robin<ro...@gm...> wrote: > How can I disable building the mac os x backend. I copied > setup.cfg.example to setup.cfg and have "macosx = False" but it > doesn't seem to have any effect. "python setup.py config" still > reports "Mac OS X native: yes". I disabled macosx building by commenting out the if options['build_macosx']: clause in setup.py. Cheers Robin
Hi, Just to let folks know the current SVN version fails to build on a mac. I built the release (0.98.5.3) successfully from source so I think my environment, dependencies etc. should be OK. The problem seems to be building mac os x native backend: building 'matplotlib.backends._macosx' extension gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I/usr/X11R6/include -I. -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/_macosx.m -o build/temp.macosx-10.3-i386-2.5/src/_macosx.o g++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.5/src/_macosx.o build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-i386-2.5/src/agg_py_transforms.o build/temp.macosx-10.3-i386-2.5/src/path_cleanup.o -L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib -lstdc++ -lm -o build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so -framework Cocoa ld: cycle in dylib re-exports with /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libGL.dylib collect2: ld returned 1 exit status error: command 'g++' failed with exit status 1 How can I disable building the mac os x backend. I copied setup.cfg.example to setup.cfg and have "macosx = False" but it doesn't seem to have any effect. "python setup.py config" still reports "Mac OS X native: yes". Thanks Robin PS - some minor comments about the sourceforge download page (I dont know if these can be changed): On the summary page ( http://sourceforge.net/projects/matplotlib/ ) the "download now" link which I would think should point to the latest release point to 0.91. Then when you do 'view all files' matplotlib-maintenance is the default expanded branch of the tree with latest version 0.91.4. To get the real new version you have to close this tree or scroll down to the normal matplotlib branch. If I didn't know the versions to look for beforehand I think this would be really confusing - can you make matplotlib the default instead of matplotlib-maintenance? Also I went to the Developer page to find the svn repo http://sourceforge.net/projects/matplotlib/develop and followed the instructions there which of course started to pull in the whole repo. When I found it taking a long time I noticed that I was getting branches etc I didnt need. I know this is covered with the correct command in the install page, but I thought it would be handy to change it here as well to avoid someone else making the mistake I made. These are very minor things and normally I wouldn't bother mentioning, but since the matplotlib website etc. seems so nice I figured there is someone who cares about this stuff - although I'm not sure whether its possible to change this stuff in sourceforge.
Hi Robin, On Wednesday 08 July 2009 18:48:04 Robin wrote: > On Wed, Jul 8, 2009 at 4:00 PM, Matthias Michler<Mat...@gm...> wrote: > > What version of matplotlib do you use? > > I think I am up to date. > > > For me the following works: > > > > ax.set_position(ax.get_position()) > > That works for me to - the problem is I wanted to change the numbers a > little once I saw them. I see now the thing to do (I think) is > print ax.get_position() # have a look > from matplotlib.transforms import Bbox > ax.set_position(Bbox([ [a, b], [c, d] ])) # with numbers changed > slightly from the printed ones > > At the time I thought Bbox was a more internal thing so wanted a way > to convert Bbox to the format described in the docstring ([left, > bottom, width, height]). I think it would be nice if Bbox had some > method to give this (is Bbox.to_pos() ) or something... perhaps there > already is but I couldn't find it. In the docstring of set_position it is also mentioned that a Bbox can be given as pos. Just one additional remark: You can also modify the returned Bbox and pass it in again into set_position - something like bb = ax.get_position() # get an array holding the points: a = bb.get_points() # ... modify a ... bb.set_points(a) ax.set_position(bb) best regards Matthias > Anyway now I learned Bbox I think it is actually a nicer way to think > about when doing it by hand (bottom left corner, top right corner). > > Thanks for your help, > > Robin > > > The object returned by get_position is "A mutable bounding box.", which > > is also supported in set_position. Nevertheless set_position supports > > lists with '[left, bottom, width, height]', too. E.g. > > ax.set_position([0.2, .4, 0.4, .5]) > > > > best regards Matthias > > > > On Wednesday 08 July 2009 16:10:37 Robin wrote: > >> Hi, > >> > >> After quite a bit of trial and error I realised that ax.get_position() > >> is returning numbers in the form a Bbox which are very different to > >> the numbers you need for ax.set_position(). > >> > >> Often I want to use the subplot positioning first, then get the > >> positions that sets up for some manual tweaking. Is there a way to > >> convert the output of get_position into the same form as for > >> set_position? > >> > >> Cheers > >> > >> Robin
Hi again. I found out that removing the resize handler of the wxpanel gives me a nice animated plot that works as expected (but with no resize :-/) def _SetSize(self): pixels = tuple(self.parent.GetClientSize()) self.SetSize(pixels) self.canvas.SetSize(pixels) self.figure.set_size_inches(float(pixels[0])/self.figure.get_dpi(), float(pixels[1])/self.figure.get_dpi(),forward=True) I took that code from: http://www.scipy.org/Matplotlib_figure_in_a_wx_panel any hints on what to do from there? guillaume ranquet wrote: > Hi list (yes, me, again :D) > > I'm having difficulties with matplotlib svn (rev 7249) and animations. > I'm a bit lost on what I have to do to get my animation running smoothly? > > I had various attempts, It seems that the best result I can have is by > totally skipping the canvas.restore_region(self.background) shown in the > examples : the resizing of the window make the plot look terribly broken > > sorry for this question that seems well covered by documentation and > examples :S > I'm attaching a sample code that reproduces the behavior of my app, It's > a bit long but I hope there's some good things in it that can be usefull > to others :) > > > ===code snippet=== > import wxversion > wxversion.ensureMinimal('2.8') > > import numpy as np > import matplotlib.pyplot as plt > > from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as > FigureCanvas > > import wx > import wx.aui > > from matplotlib.figure import Figure > import sys > import getopt > from threading import * > from itertools import izip > import time > > class myplotData(Figure): > def __init__(self,name,width=5,height=4,dpi=60,x_axis=None): > Figure.__init__(self,figsize=(width, height),dpi=dpi) > self.name = name > self.ax = self.add_subplot(111,label=name,animated=True) > self.bg = None > self.mdirty = False > > def refreshbg(self): > self.bg = self.canvas.copy_from_bbox(self.ax.bbox) > > def feed(self,n): > timestamp = n[0] > self.n = 0 > if self.bg == None: > self.canvas = self.ax.figure.canvas > self.canvas.draw() > self.bg = self.canvas.copy_from_bbox(self.ax.bbox) > for xs in n[1:]: > self.ax.plot([timestamp],[xs],animated=True) > return > #self.canvas.restore_region(self.bg) > mylines = self.ax.get_lines() > for xs,line in izip(n[1:],mylines): > x,y = line.get_data() > x = np.concatenate((x,[timestamp])) > y = np.concatenate((y,[xs])) > line.set_data([x,y]) > self.ax.set_xlim(xmax=timestamp) > curyminlim,curymaxlim = self.ax.get_ylim() > > self.ax.set_ylim(ymin=min(xs,curyminlim),ymax=max(xs,curymaxlim)) > self.ax.draw_artist(line) > self.mdirty = True > wx.WakeUpIdle() > > def blit(self): > if self.mdirty: > self.mdirty = False > self.canvas.blit(self.ax.get_figure().bbox) > > class CanvasPanel(wx.Panel): > def __init__(self,name,callback=None,parent=None): > wx.Panel.__init__(self, parent) > self.SetSize((120, 80)) > self.figure = myplotData(name) > self.canvas = FigureCanvas(self,-1,self.figure) > self.parent = parent > self.callback = callback > color = (255,255,255) > self.SetColor(color) > self._SetSize() > self._resizeflag = False > self.Bind(wx.EVT_IDLE, self._onIdle) > self.Bind(wx.EVT_SIZE, self._onSize) > > def SetColor(self,rgbtuple=None): > """Set figure and canvas colours to be the same.""" > if rgbtuple is None: > rgbtuple = > wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE).Get() > clr = [c/255. for c in rgbtuple] > self.figure.set_facecolor(clr) > self.figure.set_edgecolor(clr) > self.canvas.SetBackgroundColour(wx.Colour(*rgbtuple)) > > def _onSize(self,event): > self._resizeflag = True > > def _onIdle(self,evt): > if self._resizeflag: > self._resizeflag = False > self._SetSize() > self.figure.blit() > > def _SetSize(self): > pixels = tuple(self.parent.GetClientSize()) > self.SetSize(pixels) > self.canvas.SetSize(pixels) > self.figure.set_size_inches(float(pixels[0])/self.figure.get_dpi(), > float(pixels[1])/self.figure.get_dpi()) > #self.figure.refreshbg() > > def process(self,data): > if self.callback != None: > x = self.callback(data) > self.figure.feed(x) > else: > self.figure.feed(data) > > # Define notification event for thread notifications > EVT_RESULT_ID = wx.NewId() > > def EVT_RESULT(win, func): > """Define Result Event.""" > win.Connect(-1, -1, EVT_RESULT_ID, func) > > class ResultEvent(wx.PyEvent): > """Simple event to carry arbitrary result data.""" > def __init__(self, data): > """Init Result Event.""" > wx.PyEvent.__init__(self) > self.SetEventType(EVT_RESULT_ID) > self.data = data > > class ParserThread(Thread): > def __init__(self,source,notify_window): > Thread.__init__(self) > self._notify_window = notify_window > self.data = np.arange(0,2*np.pi,0.01) > self.n = 0 > self.round = 0 > self.start() > > def run(self): > while(1): > mbuff = {} > mbuff['name'] = "My Sin Plot" > mbuff['x'] = self.data[self.n] + self.round*2*np.pi > mbuff['y1'] = np.sin(mbuff['x']) > mbuff['y2'] = np.sin(mbuff['x'] + np.pi/2) > self.n+=1 > if self.n == len(self.data): > self.n = 0 > self.round += 1 > wx.PostEvent(self._notify_window, ResultEvent(('test',[mbuff]))) > time.sleep(.1) > > def mycback(data): > return data['x'],data['y1'],data['y2'] > > class MyApp(wx.Frame): > > def __init__(self,parent=None, > id=wx.ID_ANY,pos=wx.DefaultPosition,size=wx.DefaultSize, > style=wx.DEFAULT_FRAME_STYLE): > wx.Frame.__init__(self, parent) > self.bestsize = (120,75) > self.SetSize(self.GetBestSize()) > self.panel = wx.Panel(self,wx.ID_ANY) > self.panel.nb = wx.aui.AuiNotebook(self.panel) > self.label = wx.StaticText(self.panel.nb,wx.ID_ANY,"\n\n\n\naaa\n") > self.panel.nb.AddPage(self.label, "txt") > sizer = wx.BoxSizer() > sizer.Add(self.panel.nb, 1, wx.EXPAND) > self.panel.SetSizer(sizer) > self.plotlist = {} > self.Fit() > EVT_RESULT(self,self.OnResult) > self.worker = ParserThread(5758,self) > > def OnResult(self,event): > tag,mbuff = event.data > if tag == -1: > return > for buff in mbuff: > if not self.plotlist.has_key(buff['name']): > cback = mycback > page = CanvasPanel(buff['name'],mycback,self.panel.nb) > self.panel.nb.AddPage(page,buff['name']) > self.plotlist[buff['name']] = page > myPlot = self.plotlist[buff['name']] > myPlot.process(buff) > > def main(argv=None): > if argv != None: > sys.argv = argv > app = wx.App() > frame = MyApp() > frame.Show() > app.MainLoop() > > if __name__ == "__main__": > main() > ===code snippet=== > ---- > This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. > > Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie. > ---- > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ---- This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie. ----
Hi, Could anyone help me with the following problem I am having. http://dpaste.com/64913/ The code listed above should be enough to reproduce the problem. I on using the zoom function from the toolbar, I find that the figure limits are set to a smaller size than the zoom i selected - a kind of 'double zoom'. I was able to track down the problem to backend_bases.py in the matplotlib distribution (current release). Inside this file there is a member called 'release_zoom' there is a section of code that says.. for cur_xypress in self._xypress: lastx, lasty, a, ind, lim, trans = cur_xypress # code a.transData.inverted() # code a.set_xlim((x0, x1)) # etc.. I am finding that there are two items in self._xypress, and that the 'a' in both of them (axes i think) are the same object i.e a1 is a2 == True this means that a.transData.inverted() is called twice on the same axes. The first time through the for loop it gets the limits correct, the second time, they are incorrect because of the second call to inverted. I have implemented a shoddy fix where i check that if the axes is the same as one that is seen before, I just continue. Is anyone else able to see this, or is it just something in the way i've set up my original pasted code? Cheers, Jervis
Hello, any hint about this? If somebody wants to understand better what I mean, my data are here: www.aei.mpg.de/~pau/histo3.dat thanks Pau 2009年7月8日 Pau <vim...@go...>: > Hello, > > two days ago Sebastian helped me to finish in a hurry a histogram with bar() > > I would like now to understand how to make the plot with hist() > > First of all, my data (after a massage) looks like : > > ----------------------------------------- > 0.00e+00 1.00e-04 81039 > 1.00e-04 2.00e-04 4472 > 2.00e-04 3.00e-04 2033 > 3.00e-04 4.00e-04 1155 > 4.00e-04 5.00e-04 823 > 5.00e-04 6.00e-04 643 > 6.00e-04 7.00e-04 534 > 7.00e-04 8.00e-04 361 > 8.00e-04 9.00e-04 313 > 9.00e-04 1.00e-03 269 > 1.00e-03 1.10e-03 230 > 1.10e-03 1.20e-03 195 > 1.20e-03 1.30e-03 178 > 1.30e-03 1.40e-03 165 > 1.40e-03 1.50e-03 175 > 1.50e-03 1.60e-03 125 > 1.60e-03 1.70e-03 109 > 1.70e-03 1.80e-03 112 > 1.80e-03 1.90e-03 90 > . > . > . > . > 9.86e-02 9.87e-02 0 > 9.87e-02 9.88e-02 0 > 9.88e-02 9.89e-02 0 > 9.89e-02 9.90e-02 0 > 9.90e-02 9.91e-02 0 > 9.91e-02 9.92e-02 0 > 9.92e-02 9.93e-02 0 > 9.93e-02 9.94e-02 0 > 9.94e-02 9.95e-02 0 > 9.95e-02 9.96e-02 1 > ----------------------------------------- > > The bins are given by the two first number columns. > > For instance, the first bin is from 0.00e+00 to 1.00e-04 and has the > number of data 81039 > > Then I run the following script on them: > > ---------------------------------------------- > #!/usr/bin/env python > > from pylab import * > > H = load ( './histo3.dat') > > h = H[:, 2] # the third column > > n, bins, patches = hist(h, 997, normed=0, log=0, > facecolor='lightblue', alpha=0.75) > > show() > ---------------------------------------------- > > The number 997 is because this is the number of lines I have in my > file (and, thus, the number of bins) > > But the plot is ranging between > > 0 - 90000 --> on x axis > 0 - 1000 --> on y axis > > Notice in the data file that x does not get further than 9.96e-02 > > So the maximum should be 0.0996 and I am getting 90000 > > Why is that? > > What am I doing wrong? > > I have tried to substitute lower-case e with E in the data file but > this did not help > > Any help would be appreciated. > > thanks, > > Pau >
Hi Darren, Darren Dale <dsd...@gm...> writes: > On Thu, Jul 2, 2009 at 9:46 AM, Ole Streicher < > ole...@gm...> wrote: > Run it, move the second diagram below the first, adjust their sizes so > that they take roughly the same size: [...] > and then move the slider between the diagrams and the "Hello World" > label. There is a good chance that the program will segfault. If it does > not, increase the number of points in the diagrams. > I can't reproduce the problem. The diagrams update properly and I don't see a > segfault. Maybe it is an issue that was fixed in Qt-4.5.[1,2] or PyQt-4.5.1. Your bugfix of the resize problem seems to fix that crash, too; at least on SuSE 11.1. However, I will test it on Ubuntu, too. Regards Ole
On Wed, Jul 8, 2009 at 9:47 PM, Jae-Joon Lee <lee...@gm...> wrote: > axes_grid toolkit uses slightly customized version of axes and > different kind of artists are used to draw ticks and ticklabels, and > some of the commands from original mpl do not work. > But not changing fontsize and not showing up gridlines are things that > should be fixed (I'll work on these in a few days). > Meanwhile, there are workarounds. > > For fontsize, try to directly set the font size of the label object. > Unfortunately, the padding between the label and the axis get messed > up, and you need to adjust the padding manually. > > host.axis["bottom"].label.set_size(30) > host.axis["bottom"].LABELPAD=10 > > For grid, it is a bit more tricky. > > host.xaxis.set_visible(True) > host.yaxis.set_visible(True) > host.xaxis.get_label().set_visible(False) > host.yaxis.get_label().set_visible(False) > for a in host.xaxis.majorTicks + host.yaxis.majorTicks: > a.gridOn=True > a.tick1On=False > a.tick2On=False > a.label1On=False > a.label2On=False > > I hope these workarounds are useful. > Thanks for reporting the problems and I;ll try to fix them soon. > Regards, > > -JJ > > > > > On Wed, Jul 8, 2009 at 10:00 PM, Gökhan SEVER<gok...@gm...> > wrote: > > Hello, > > > > I am using axes_grid toolkit to create multiple axes. The labels' colors > are > > nicely being updated, however size or fontsize has no effect on the > > resulting figure :( Are they functional, or is it something wrong with my > > implementation? Oh also I couldn't make the grids switched on my figures. > > > > Here is the snippet that I use: > > > > fig = plt.figure(1) > > host = SubplotHost(fig, 111) > > fig.add_subplot(host) > > par = host.twinx() > > host.set_xlabel("Time [sfm]", size=50) > > host.set_ylabel("DMT CCN Concentration [#/cm^3]", fontsize=20) > > par.set_ylabel("Supersaturation [%]", fontsize=20) > > > > p1, = host.plot(Time, dccnConc, label="dccnConc") > > p2, = host.plot(Time, dccnConAmb, label="dccnConAmb") > > p3, = host.plot(Time, dccnConSTP, label="dccnConSTP") > > p4, = par.plot(Time, dccnSS, label="dccnSS") > > p5, = par.plot(Time, dccnSS_Amb, label="dccnSS_Amb") > > > > host.axis["left"].label.set_color(p1.get_color()) > > par.axis["right"].label.set_color(p5.get_color()) > > > > host.axis["left"].label.set_label(p1.get_label()) > > host.legend() > > plt.show() > > > > > > These are my current system properties: > > > > Linux 2.6.27.19-170.2.35.fc10.i686.PAE (Fedora 11) > > Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) > > IPython 0.10.bzr.r1174 (with --pylab) > > and a very recent Matplotlib svn version. > > > > Thanks. > > > > -- > > Gökhan > > > > > ------------------------------------------------------------------------------ > > Enter the BlackBerry Developer Challenge > > This is your chance to win up to 100,000ドル in prizes! For a limited time, > > vendors submitting new applications to BlackBerry App World(TM) will have > > the opportunity to enter the BlackBerry Developer Challenge. See full > prize > > details at: http://p.sf.net/sfu/Challenge > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > Jae-Joon, Your suggested work-arounds worked like a charming. See my before and after plots at the given links: http://img34.imageshack.us/img34/3899/dccnplot1.png http://img27.imageshack.us/img27/6274/dccnplot2.png I have one tiny question left working on these figures; that is: how to make mathtext font and a regular label font at the same size? For instance: host.set_ylabel(r"DMT CCN Concentration [ #/$cm^3$]") but as it is seen from the figure they look a bit weird. Thank you. PS: I am glad I could add a little bit into this great piece of visualization toolkit. -- Gökhan
Arrrg, it depends on other module in axes_grid toolkit. So, you need svn version of mpl. However, It is possible to specify the location of the axes in normalized axes coordinate. http://thread.gmane.org/gmane.comp.python.matplotlib.general/16373 -JJ On Wed, Jul 8, 2009 at 10:57 PM, Jae-Joon Lee<lee...@gm...> wrote: > If you use the svn version of matplotlib, you may use axes_grid toolkit. > > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#insetlocator > > I think the required inset_locator module actually does not depend on > other modules in axes_grid, so if you're not using svn, you may just > download inset_locator.py and use it. > But still, you need to have 0.98.5.3 installed. > > http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py?view=markup > > -JJ > > > On Wed, Jul 8, 2009 at 6:24 AM, Robin<ro...@gm...> wrote: >> Hi, >> >> I'm sure its a bit lazy to ask but I can't think of the right keywords >> to search for... >> >> I would like to produce a plot with a zoomed in box detail section. >> What I have in mind is a plot of an exponentially decaying line with >> some fine detail, so I would like the main plot to show the scale of >> the exponential decay, but then in the large space in the >> center/top/right of the plot I would like to have a zoomed in box >> showing more detail of a particular bit to show the level of the noise >> etc. >> >> No idea where to start with acheiving this so I thought I'd ask if >> anyone has done anything similar or if there would be any examples on >> the web site - or whether it would be easier just to produce 2 plots >> at different scales then chop them together in a graphics editing >> program. (I thought of inkscape, but in the past when I've tried to >> edit matplotlib vector output it messed up the fonts - or at least >> changed them - so I'm not sure if theres a better program, or some >> trick to using it). >> >> Cheers >> >> Robin >> >> ------------------------------------------------------------------------------ >> Enter the BlackBerry Developer Challenge >> This is your chance to win up to 100,000ドル in prizes! For a limited time, >> vendors submitting new applications to BlackBerry App World(TM) will have >> the opportunity to enter the BlackBerry Developer Challenge. See full prize >> details at: http://p.sf.net/sfu/Challenge >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >
If you use the svn version of matplotlib, you may use axes_grid toolkit. http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#insetlocator I think the required inset_locator module actually does not depend on other modules in axes_grid, so if you're not using svn, you may just download inset_locator.py and use it. But still, you need to have 0.98.5.3 installed. http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py?view=markup -JJ On Wed, Jul 8, 2009 at 6:24 AM, Robin<ro...@gm...> wrote: > Hi, > > I'm sure its a bit lazy to ask but I can't think of the right keywords > to search for... > > I would like to produce a plot with a zoomed in box detail section. > What I have in mind is a plot of an exponentially decaying line with > some fine detail, so I would like the main plot to show the scale of > the exponential decay, but then in the large space in the > center/top/right of the plot I would like to have a zoomed in box > showing more detail of a particular bit to show the level of the noise > etc. > > No idea where to start with acheiving this so I thought I'd ask if > anyone has done anything similar or if there would be any examples on > the web site - or whether it would be easier just to produce 2 plots > at different scales then chop them together in a graphics editing > program. (I thought of inkscape, but in the past when I've tried to > edit matplotlib vector output it messed up the fonts - or at least > changed them - so I'm not sure if theres a better program, or some > trick to using it). > > Cheers > > Robin > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
axes_grid toolkit uses slightly customized version of axes and different kind of artists are used to draw ticks and ticklabels, and some of the commands from original mpl do not work. But not changing fontsize and not showing up gridlines are things that should be fixed (I'll work on these in a few days). Meanwhile, there are workarounds. For fontsize, try to directly set the font size of the label object. Unfortunately, the padding between the label and the axis get messed up, and you need to adjust the padding manually. host.axis["bottom"].label.set_size(30) host.axis["bottom"].LABELPAD=10 For grid, it is a bit more tricky. host.xaxis.set_visible(True) host.yaxis.set_visible(True) host.xaxis.get_label().set_visible(False) host.yaxis.get_label().set_visible(False) for a in host.xaxis.majorTicks + host.yaxis.majorTicks: a.gridOn=True a.tick1On=False a.tick2On=False a.label1On=False a.label2On=False I hope these workarounds are useful. Thanks for reporting the problems and I;ll try to fix them soon. Regards, -JJ On Wed, Jul 8, 2009 at 10:00 PM, Gökhan SEVER<gok...@gm...> wrote: > Hello, > > I am using axes_grid toolkit to create multiple axes. The labels' colors are > nicely being updated, however size or fontsize has no effect on the > resulting figure :( Are they functional, or is it something wrong with my > implementation? Oh also I couldn't make the grids switched on my figures. > > Here is the snippet that I use: > > fig = plt.figure(1) > host = SubplotHost(fig, 111) > fig.add_subplot(host) > par = host.twinx() > host.set_xlabel("Time [sfm]", size=50) > host.set_ylabel("DMT CCN Concentration [#/cm^3]", fontsize=20) > par.set_ylabel("Supersaturation [%]", fontsize=20) > > p1, = host.plot(Time, dccnConc, label="dccnConc") > p2, = host.plot(Time, dccnConAmb, label="dccnConAmb") > p3, = host.plot(Time, dccnConSTP, label="dccnConSTP") > p4, = par.plot(Time, dccnSS, label="dccnSS") > p5, = par.plot(Time, dccnSS_Amb, label="dccnSS_Amb") > > host.axis["left"].label.set_color(p1.get_color()) > par.axis["right"].label.set_color(p5.get_color()) > > host.axis["left"].label.set_label(p1.get_label()) > host.legend() > plt.show() > > > These are my current system properties: > > Linux 2.6.27.19-170.2.35.fc10.i686.PAE (Fedora 11) > Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) > IPython 0.10.bzr.r1174 (with --pylab) > and a very recent Matplotlib svn version. > > Thanks. > > -- > Gökhan > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Hello, I am using axes_grid toolkit to create multiple axes. The labels' colors are nicely being updated, however size or fontsize has no effect on the resulting figure :( Are they functional, or is it something wrong with my implementation? Oh also I couldn't make the grids switched on my figures. Here is the snippet that I use: fig = plt.figure(1) host = SubplotHost(fig, 111) fig.add_subplot(host) par = host.twinx() host.set_xlabel("Time [sfm]", size=50) host.set_ylabel("DMT CCN Concentration [#/cm^3]", fontsize=20) par.set_ylabel("Supersaturation [%]", fontsize=20) p1, = host.plot(Time, dccnConc, label="dccnConc") p2, = host.plot(Time, dccnConAmb, label="dccnConAmb") p3, = host.plot(Time, dccnConSTP, label="dccnConSTP") p4, = par.plot(Time, dccnSS, label="dccnSS") p5, = par.plot(Time, dccnSS_Amb, label="dccnSS_Amb") host.axis["left"].label.set_color(p1.get_color()) par.axis["right"].label.set_color(p5.get_color()) host.axis["left"].label.set_label(p1.get_label()) host.legend() plt.show() These are my current system properties: Linux 2.6.27.19-170.2.35.fc10.i686.PAE (Fedora 11) Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) IPython 0.10.bzr.r1174 (with --pylab) and a very recent Matplotlib svn version. Thanks. -- Gökhan
Hi, I just wanted to share a simple code that I wrote: http://certik.github.com/visit_writer/ which uses Visit's VTK writer (written in C, wrapped in Python). I wrote a pcolor() function, that works just like the one in matplotlib, only it produces a vtk file (resp. data that you then pass to the vtk writer). See the pictures and demos on the webpage above. With this, it's very easy to write VTK files, no need to fiddle with the ASCII format --- btw, the module can produces a binary VTK file too, so it really saved me lots of troubles. Ondrej