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
(14) |
2
(11) |
3
(5) |
4
(17) |
5
(11) |
6
(37) |
7
(35) |
8
(9) |
9
(1) |
10
(9) |
11
(7) |
12
(22) |
13
(34) |
14
(24) |
15
(27) |
16
(13) |
17
(19) |
18
(43) |
19
(36) |
20
(12) |
21
(9) |
22
(21) |
23
(3) |
24
(5) |
25
(30) |
26
(14) |
27
(23) |
28
(19) |
29
(19) |
30
(10) |
31
(6) |
|
|
|
|
|
|
Hi Gang, As you may know, Sourceforge hosts a Community Choice Awards thing (http://sourceforge.net/community/cca09/). If you really like matplotlib I would encourage you to nominate it for an award (I chose the "Best Project for Academia" category). The nomination page is here (http://sourceforge.net/community/cca09/nominate/) Best -Kaushik
Nop John, I was just wondering whether my assignment syntactically correct in Python or a missing feature in matplotlib. Gökhan On Wed, May 13, 2009 at 2:23 PM, John Hunter <jd...@gm...> wrote: > On Wed, May 13, 2009 at 2:15 PM, Gökhan SEVER <gok...@gm...> > wrote: > > Hmm, Thank you for the guidance John :) > > > > def myformat(x): > > return '%1.2f'%x > > > > axes().fmt_xdata = myformat works like you said. > > > > How can I join x and y in one function? The following line gives me a > syntax > > error. > > > > def myformat(x, y): > > return '%1.2f'%x, '%1.2f'%y > > > > axes().(fmt_xdata, fmt_ydata) = myformat > > > > Since the function will return a tuple with two values could they be > > assigned directly in the give fashion? > > > > There is no support for this currently, sorry > > JDH >
I am using figtext() to add text to a figure. I have noticed that with muti-line text, the linespacing will look uneven due to letters which extend below. For example: figtext(0,0,"ppp\naaa\nggg\nsss") Will look something like this (exaggerated) ppp aaa ggg Sss With a larger space under letters like p and g I tried some different fonts but that did not seem to make any difference Is there a way to correct this so it looks even?
Sebastian Busch wrote: > Matthias Michler wrote: >> ... >> for i in xrange(len(matrix3[:, 0])): # all rows >> for j in xrange(len(matrix3[0, :])):# all columns >> ... > > if your matrices a and b are rectangular (and i think the "diagonal" > makes only sense in this case), you can also say: > > array([list(a[i,:i])+list(b[i,i:]) for i in range(a.shape[0])]) It seems that I did not understand what you tried to reach. Sorry for pointing into the wrong direction. Another possibility would be to use masked arrays: ------------------------8<------------------------------------- from pylab import * x = arange(100) y = arange(100) x,y = meshgrid(x,y) Z = x**2+y**2 mask = ones(Z.shape) # contour, imshow, pcolor do not show values at positions # where the mask is True lower_left_masked = triu(mask)==0 # lower left part in matrix masked Z = ma.masked_array(Z,mask=lower_left_masked) contourf(Z,origin='lower') error = rand(x.shape[0],x.shape[1]) upper_right_masked = tril(mask)==0 Z = (x+error)**2+(y+error)**2 Z = ma.masked_array(Z,mask=upper_right_masked) contourf(Z,cmap=cm.binary) axis('tight') show()
Hi, I would like to show color maps of various shapes such as hexagons or squares. I've been able to do this with the scatter function but I'm having trouble with the size argument. I always have to adjust the size of my window until the shapes line up just how I want them to. I realize size is specified in points^2, and that my figures default to 80 DPI and that the default figure size is 8" x 6", which should translate to 640x480. What I can't figure out is how to convert any of these to the data axis. I want to have one square centered at (0.5,0.5) with a side-length of 1 that exactly touches a square at (1.5,0.5), but to do this, I have to guess and check until I zero in on a size=2000. The square root of that is 44.72 points. Where the heck does this come from? How can I choose my marker size automatically based on the figure size and DPI so that my data looks right? It's a problem when I want to make lots of colormaps in subfigures, then I have to guess and check until the size is right. It's especially difficult with hexagon maps! Anyway, I've struggled with this long enough. I read these pages but they didn't help enough. http://www.scipy.org/Cookbook/Matplotlib/AdjustingImageSize http://www.scipy.org/Cookbook/Matplotlib/Transformations Any ideas or suggestions? Thanks in advance! -Nick
On Wed, May 13, 2009 at 2:15 PM, Gökhan SEVER <gok...@gm...> wrote: > Hmm, Thank you for the guidance John :) > > def myformat(x): > return '%1.2f'%x > > axes().fmt_xdata = myformat works like you said. > > How can I join x and y in one function? The following line gives me a syntax > error. > > def myformat(x, y): > return '%1.2f'%x, '%1.2f'%y > > axes().(fmt_xdata, fmt_ydata) = myformat > > Since the function will return a tuple with two values could they be > assigned directly in the give fashion? > There is no support for this currently, sorry JDH
Hmm, Thank you for the guidance John :) def myformat(x): return '%1.2f'%x axes().fmt_xdata = myformat works like you said. How can I join x and y in one function? The following line gives me a syntax error. def myformat(x, y): return '%1.2f'%x, '%1.2f'%y axes().(fmt_xdata, fmt_ydata) = myformat Since the function will return a tuple with two values could they be assigned directly in the give fashion? Gökhan On Wed, May 13, 2009 at 1:50 PM, John Hunter <jd...@gm...> wrote: > On Wed, May 13, 2009 at 1:39 PM, Gökhan SEVER <gok...@gm...> > wrote: > > Hello, > > > > Is there a way to change the resolution of x and y readings (while > hovering > > the mouse inside the canvas area) from the status bar of a plot window? > > > > Currently x show 2 or 3 digits after 0, while y only increments at 0.1 or > 1 > > depends on the number. > > > > Can we set these based on our needs? > > > There are attributes ax.fmt_xdata and ax.fmt_ydata. These are None by > default, in which case the axis tick formatter is used. Write the > function you want to format the data, and set the attr to override the > default > > def myformat(x): > return '%1.4f'%x > > ax.fmt_xdata = myformat > > JDH >
On Wed, May 13, 2009 at 1:39 PM, Gökhan SEVER <gok...@gm...> wrote: > Hello, > > Is there a way to change the resolution of x and y readings (while hovering > the mouse inside the canvas area) from the status bar of a plot window? > > Currently x show 2 or 3 digits after 0, while y only increments at 0.1 or 1 > depends on the number. > > Can we set these based on our needs? There are attributes ax.fmt_xdata and ax.fmt_ydata. These are None by default, in which case the axis tick formatter is used. Write the function you want to format the data, and set the attr to override the default def myformat(x): return '%1.4f'%x ax.fmt_xdata = myformat JDH
Hmm, I have no idea what is wrong and I'm afraid that there is not much I can do. ps backend undergoes several steps (tex - dvi - ps - [distiller]) to produce the final output, and it is hard to track down the problem without actually reproducing one. Just in case, can you change your distiller option and see if it makes any difference? rc("ps", usedistiller="ghostscript") # this would be the default or rc("ps", usedistiller="xpdf") -JJ On Wed, May 13, 2009 at 3:22 AM, Matthias Michler <Mat...@gm...> wrote: > Hi Jae-Joon, > > I updated to svn-revision 7099 and the problem (hidden part of b) still > exists. Do you have any idea what I'm doing wrong? > > Thanks in advance for any hints. > > best regards Matthias > > > On Tuesday 12 May 2009 20:46:06 Jae-Joon Lee wrote: >> On Tue, May 12, 2009 at 5:04 AM, Matthias Michler >> >> <Mat...@gm...> wrote: >> > Hello list, >> > >> > I'm not sure that following problem also occurs for Sebastian, but if I >> > use PS-backend in the below script I get the attached output, where the >> > upper part of the b is somehow hidden (matplotlib-version 0.98.6svn). >> > Is this a problem of matplotlib or did I miss something in the >> > tex-handling? >> >> Unfortunately, I don't see such problem, although the problem seems to >> be due to a wrong bounding box. >> >> Are you using the most recent svn? There has been some recent changes >> in ps backend. Before the changes (r7068, r7074), the ps backend tried >> to adjust the bounding box of the output ps file. However, as far as I >> can see, this often gave a wrong bounding box (and I guess your >> problem might be related with this issue). The above mentioned changes >> somehow bypass that bbox adjustment. The resulting bounding box should >> have the size of the figure if saved in eps, or size of the paper >> ("letter" or "a4", I guess) if saved in ps. >> >> regards, >> >> -JJ >> >> > best regards Matthias >> > >> >> ---------------------------------------- >> > >> > from matplotlib import use, rc >> > use('PS') >> > from pylab import figure, savefig >> > >> > rc('text', usetex=True) >> > rc('text.latex', preamble="\usepackage{color}") >> > >> > f = figure() >> > f.text(0.5, 0.5, r"{\color[rgb]{0,1,0} a } b {\color{blue} $\nu, \mu, >> > \tau$}") >> > >> > savefig('test_tex_color.ps') >> > >> >> ---------------------------------------- >> > >> > On Monday 11 May 2009 20:36:58 Jae-Joon Lee wrote: >> >> > The resulting graph is not colored -- but in the directory >> >> > ~/.matplotlib/tex.cache/ the text is green, both in the dvi and the >> >> > png file! >> >> > >> >> > It therefore seems to me that this is not completely hopeless but I >> >> > cannot figure out how to proceed. >> >> >> >> As far as I know, in matplotlib, all the tex png output is treated as >> >> grey internally (the only exception I know of is ps backend, e.g., >> >> your example will show you a correct color if you save it as ps). I >> >> guess this may have been a design decision. >> >> As far as I can see, MPL currently does not support texts with varying >> >> font properties (size, color, font). >> >> One possible workaround for this could be using the latex typesetting >> >> as you tried. However, supporting this within the current text >> >> framework of matplotlib would be difficult and may not be a good idea. >> >> >> >> >> >> However, I guess there are a few workarounds you may consider to use >> >> (but unfortunately I think none of them are easy to work with). So, if >> >> you describe where you intend to use multi-color text, I'll try to >> >> give some example appropriate for your situation. Multi-color text in >> >> figure title or simple annotation would be relatively simple. >> >> Multi-color text in legend label seems to be more difficult, but >> >> should be doable. >> >> >> >> -JJ > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Thank you for the response once again. That's why I am suspecting actually the raw data. At the problem points there might be not included values or missing values where not exist on the normal plots. I will find the original data and feed boxplot with it to see how it effects the final result. Gökhan On Wed, May 13, 2009 at 12:58 PM, Josh Hemann <jh...@vn...> wrote: > > Thanks for sending the data and code. After playing around some I still > don't > have a confident guess as to the problem (or solution), but here is what I > would look at more... > > I issued plot(d[i][8:]) for i 0,1,...11 and looked at the shape of the > lines. For the two problem boxes, the plots of the associated data have > steep jumps between the 5th and 25th percentiles, when compared with the > data associated with the "good" boxes. So, what you have calculated as the > 5th and 25th percentiles are not necessarily calculated by boxplot as such > because boxplot does not know that you are handing it percentiles of your > underlying data: boxplot actually computes the percentiles assuming that > the > input _is_ the raw data. I would guess that if you gave boxplot the raw > data > you would not see this issue of missing whiskers. > -- > View this message in context: > http://www.nabble.com/One-more-question-regarding-to-boxplotting-tp23508395p23526653.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK > i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hello, Is there a way to change the resolution of x and y readings (while hovering the mouse inside the canvas area) from the status bar of a plot window? Currently x show 2 or 3 digits after 0, while y only increments at 0.1 or 1 depends on the number. Can we set these based on our needs? Thank you. Gökhan
Thanks for sending the data and code. After playing around some I still don't have a confident guess as to the problem (or solution), but here is what I would look at more... I issued plot(d[i][8:]) for i 0,1,...11 and looked at the shape of the lines. For the two problem boxes, the plots of the associated data have steep jumps between the 5th and 25th percentiles, when compared with the data associated with the "good" boxes. So, what you have calculated as the 5th and 25th percentiles are not necessarily calculated by boxplot as such because boxplot does not know that you are handing it percentiles of your underlying data: boxplot actually computes the percentiles assuming that the input _is_ the raw data. I would guess that if you gave boxplot the raw data you would not see this issue of missing whiskers. -- View this message in context: http://www.nabble.com/One-more-question-regarding-to-boxplotting-tp23508395p23526653.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi John, On Tue, May 12, 2009 at 22:55, John Hunter <jd...@gm...> wrote: > If you change the data directly, and want mpl to autoscale, you need > to call ax.relim() before calling ax.autoscale_view(). mpl stores the > min/max of the data you add to it when you add the lines, rectangles, > etc to the figure. When you update the data directly, there is no > internal mechanism to notify the limits to update (we could add this > but haven't). So you must explicitly call relim, which tells mpl to > reinspect the data recalculate the limits. It might be a better > design to have each artist store its limits, updating them when data > is updated, and then having the container artists, eg the Axes, do a > union of the child bboxes. But this is not the design we have > currently. Ahhh, relim() - that's what I was missing! :) Well, now that I've tried with relim(), I don't know it the result is better or not :S I'm attaching the screenshots here for comments (if there's any): 1 is with xlim/ylim set to max of datapoints, 2 is with relim and ax.autoscale_view() Cheers, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi
Matthias Michler wrote: > ... > for i in xrange(len(matrix3[:, 0])): # all rows > for j in xrange(len(matrix3[0, :])):# all columns > ... if your matrices a and b are rectangular (and i think the "diagonal" makes only sense in this case), you can also say: array([list(a[i,:i])+list(b[i,i:]) for i in range(a.shape[0])]) best, sebastian. p.s.: i think it would be a nice feature to put "mat...@li..." as reply-to in the mails distributed via the list -- i keep hitting the 'reply'-button and wonder why my mails do not show up in the list...
Bala subramanian schrieb: > hai Armin, > > I looked through the examples. I could not find any example of overlapping > two differnet countours on the same plot. I think the first example filled contours does exactly that. You want to show two contours over each other in the same plot. You just have to substitute the Z in cset_1 with matrix_1 and in cset_2 with matrix_2. Of course it will be helpful to use different colormaps. E.g. a grey one for the underlying contour and a colored for the top one. x = arange(5) y = arange(5) x,y = meshgrid(x,y) Z = x**2+y**2 #contourf(Z,cmap=cm.binary) # filled contours gray contour(Z) # not filled contours colored error = rand(x.shape[0],x.shape[1]) # to generate a new Z Z = (x+error)**2+(y+error)**2 contour(Z) # colored not filled contours Armin
David Snowdon wrote: > Hi all, > > This will probably end up being my very silly mistake, but at the > moment, Matplotlib crashes my program with an X error whenever my window > isn't expanded far enough. > > For those interested, it is a front-end for the strategy and analysis > software for the Sunswift solar car (http://www.sunswift.com). I attach > a screenshot (when it is expanded to the full screen, and therefore > works) in case it helps. > > > daves@daves:~/projects/sunswift/carsoft/scanalysis$ python -c "import > matplotlib; print matplotlib.__version__" > 0.91.2 > I read the code you sent. You shouldn't import pylab (neither pyplot?), although you don't seem to be using it. Maybe the paint_event is firing when it shouldn't? Aside from that, my only advice would be to update matplotlib to the latest version. JLS
Thanks a lot! Problem solved! Stefanie ----- Original Message ----- From: "Matthias Michler" <Mat...@gm...> To: <mat...@li...> Sent: Wednesday, May 13, 2009 2:16 PM Subject: Re: [Matplotlib-users] Subplots > Hello Stefanie, > > I think the problem is that you try to initialise a subplot with > subplot(112) > which is not possible, because the first to numbers in 112 define the > subplot > structure / geometry (here 1 by 1) and the last number give the index of > the > subplot. > In general you could use N x M (N rows and M columns) for subplots by > subplot(N,M,index) > where 'index' would be a number between 1 and N * M. > > best regards Matthias > > On Wednesday 13 May 2009 14:02:57 Stefanie Lück wrote: >> Hello! >> >> I'm trying to draw several plots on after the other in a wxScrolledPanel >> but I got the error message: >> >> Traceback (most recent call last): >> File "D:\Eigene Datein\Python\current\RNAiscan\Test\sample.py", line >> 96, >> in <m odule> >> frame = MyFrame() >> File "D:\Eigene Datein\Python\current\RNAiscan\Test\sample.py", line >> 56, >> in __ init__ >> self.plot_data(self.fig) >> File "D:\Eigene Datein\Python\current\RNAiscan\Test\sample.py", line >> 90, >> in pl ot_data >> a = figure.add_subplot(id) >> File "C:\python25\lib\site-packages\matplotlib\figure.py", line 689, in >> add_su bplot >> a = subplot_class_factory(projection_class)(self, *args, **kwargs) >> File "C:\python25\lib\site-packages\matplotlib\axes.py", line 7207, in >> __init_ _ >> raise ValueError( 'Subplot number exceeds total subplots') >> ValueError: Subplot number exceeds total subplots >> >> Here's my code: >> >> # -*- coding: latin1 -*- >> import sys >> >> import wx >> import wx.lib.scrolledpanel as SP >> from wx.lib.mixins.listctrl import CheckListCtrlMixin >> >> from matplotlib.backends.backend_wx import FigureCanvasWx >> from matplotlib.figure import Figure >> import matplotlib.numerix as numpy >> >> from pylab import array, arange, sin, cos, exp, pi, randn, normpdf, >> meshgrid, \ convolve >> >> d = {1: (' Contig5535', '230 '), 2: (' Contig5534', '3240 '), 3: (' >> test', >> '574')} >> >> class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin): >> def __init__(self, parent): >> wx.ListCtrl.__init__(self, parent, -1, >> style=wx.LC_REPORT|wx.LC_VRULES|wx.LC_HRULES|wx.LC_SORT_ASCENDING) >> CheckListCtrlMixin.__init__(self) >> self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) >> >> def OnItemActivated(self, evt): >> self.ToggleItem(evt.m_itemIndex) >> >> def OnCheckItem(self, index, flag): >> data = self.GetItemData(index) >> title = d[data][1] >> if flag: >> what = "checked" >> else: >> what = "unchecked" >> >> class MyFrame(wx.Frame): >> >> def __init__(self): >> wx.Frame.__init__(self, None, -1, "My Frame", size=(300, 300)) >> self.panel = SP.ScrolledPanel(self, -1) >> >> self.list = CheckListCtrl(self.panel) >> self.list.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)) >> >> vbox = wx.BoxSizer(wx.VERTICAL) >> >> self.fig = Figure() >> self.canvas = FigureCanvasWx(self.panel, -1, self.fig) >> self.plot_data(self.fig) >> vbox.Add(self.list,0, wx.EXPAND) >> vbox.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW) >> >> self.panel.SetSizer(vbox) >> self.panel.SetAutoLayout(1) >> self.panel.SetupScrolling() >> >> self.list.InsertColumn(0, "ID") >> self.list.InsertColumn(1, "Nr. of Hits") >> for key, data in d.iteritems(): >> index = self.list.InsertStringItem(sys.maxint, data[0]) >> self.list.SetStringItem(index, 1, data[1]) >> #self.list.SetStringItem(index, 2, data[2]) >> self.list.SetItemData(index, key) >> self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE) >> self.list.SetColumnWidth(1, 100) >> self.Show() >> >> def plot_data(self, figure): >> liste2 = ['Contig5535_range.txtcounts.txt', >> 'Contig5534_range.txtcounts.txt'] id = 111 >> >> for q in liste2: >> f = open(q, 'r') >> data = f.readlines() >> liste3 = [] >> liste4 = [] >> for line in data: >> line = line.strip() >> x = line.split(" ") >> liste3.append(int(x[0])) >> liste4.append(int(x[1])) >> >> a = figure.add_subplot(id) >> a.plot(liste3,liste4) >> id = id + 1 >> >> if __name__ == '__main__': >> app = wx.PySimpleApp() >> frame = MyFrame() >> frame.Show(True) >> app.MainLoop() >> >> Has someone an idea how to solve this? >> Thank in advance >> Stefanie > > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK > i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Bala subramanian schrieb: > Dear Matthias, > > Thank you for the information. Could you please provide me a small example > of such overlapping. Look at http://matplotlib.sourceforge.net/examples/pylab_examples/contour_image.html or any other contour example from this page: http://matplotlib.sourceforge.net/examples/index.html Armin
Hello! I'm trying to draw several plots on after the other in a wxScrolledPanel but I got the error message: Traceback (most recent call last): File "D:\Eigene Datein\Python\current\RNAiscan\Test\sample.py", line 96, in <m odule> frame = MyFrame() File "D:\Eigene Datein\Python\current\RNAiscan\Test\sample.py", line 56, in __ init__ self.plot_data(self.fig) File "D:\Eigene Datein\Python\current\RNAiscan\Test\sample.py", line 90, in pl ot_data a = figure.add_subplot(id) File "C:\python25\lib\site-packages\matplotlib\figure.py", line 689, in add_su bplot a = subplot_class_factory(projection_class)(self, *args, **kwargs) File "C:\python25\lib\site-packages\matplotlib\axes.py", line 7207, in __init_ _ raise ValueError( 'Subplot number exceeds total subplots') ValueError: Subplot number exceeds total subplots Here's my code: # -*- coding: latin1 -*- import sys import wx import wx.lib.scrolledpanel as SP from wx.lib.mixins.listctrl import CheckListCtrlMixin from matplotlib.backends.backend_wx import FigureCanvasWx from matplotlib.figure import Figure import matplotlib.numerix as numpy from pylab import array, arange, sin, cos, exp, pi, randn, normpdf, meshgrid, \ convolve d = {1: (' Contig5535', '230 '), 2: (' Contig5534', '3240 '), 3: (' test', '574')} class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin): def __init__(self, parent): wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT|wx.LC_VRULES|wx.LC_HRULES|wx.LC_SORT_ASCENDING) CheckListCtrlMixin.__init__(self) self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) def OnItemActivated(self, evt): self.ToggleItem(evt.m_itemIndex) def OnCheckItem(self, index, flag): data = self.GetItemData(index) title = d[data][1] if flag: what = "checked" else: what = "unchecked" class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "My Frame", size=(300, 300)) self.panel = SP.ScrolledPanel(self, -1) self.list = CheckListCtrl(self.panel) self.list.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL)) vbox = wx.BoxSizer(wx.VERTICAL) self.fig = Figure() self.canvas = FigureCanvasWx(self.panel, -1, self.fig) self.plot_data(self.fig) vbox.Add(self.list,0, wx.EXPAND) vbox.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW) self.panel.SetSizer(vbox) self.panel.SetAutoLayout(1) self.panel.SetupScrolling() self.list.InsertColumn(0, "ID") self.list.InsertColumn(1, "Nr. of Hits") for key, data in d.iteritems(): index = self.list.InsertStringItem(sys.maxint, data[0]) self.list.SetStringItem(index, 1, data[1]) #self.list.SetStringItem(index, 2, data[2]) self.list.SetItemData(index, key) self.list.SetColumnWidth(0, wx.LIST_AUTOSIZE) self.list.SetColumnWidth(1, 100) self.Show() def plot_data(self, figure): liste2 = ['Contig5535_range.txtcounts.txt', 'Contig5534_range.txtcounts.txt'] id = 111 for q in liste2: f = open(q, 'r') data = f.readlines() liste3 = [] liste4 = [] for line in data: line = line.strip() x = line.split(" ") liste3.append(int(x[0])) liste4.append(int(x[1])) a = figure.add_subplot(id) a.plot(liste3,liste4) id = id + 1 if __name__ == '__main__': app = wx.PySimpleApp() frame = MyFrame() frame.Show(True) app.MainLoop() Has someone an idea how to solve this? Thank in advance Stefanie
Dear Matthias, Thank you for the information. Could you please provide me a small example of such overlapping. Thanks, Bala On Wed, May 13, 2009 at 1:50 PM, Matthias Michler <Mat...@gm...>wrote: > Hi Bala, > > On Wednesday 13 May 2009 13:16:17 Bala subramanian wrote: > > Friends, > > > > I have two matrices of same size. I used contourf to create the countour > > plots for the two matrices separately. > > > > i) I am interested in making one countour plot marking the areas which > are > > different in both the countours or > What you could do quite easily is making one additional countour plot of > the > difference of the two matrices, e.g. absolute(matrix1 - matrix2). > > > ii) Overlapping one countour over the other, so that i can compare the > > upper and lower diagonals that can represent count1 and count2. > I don't know if there is a possibility of overlaying two contours and > somehow > switching there alpha-value dynamically, which could be useful, but an > overlay contourf of matrix1 and contour (not filled) for matrix 2 could be > done. > > best regards > Matthias > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK > i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Friends, I have two matrices of same size. I used contourf to create the countour plots for the two matrices separately. i) I am interested in making one countour plot marking the areas which are different in both the countours or ii) Overlapping one countour over the other, so that i can compare the upper and lower diagonals that can represent count1 and count2. Kindly suggest me some ideas. Thanks, Bala
Christian K. wrote: > Eric Firing schrieb: >> Christian K. wrote: >>> Hi everyone, >>> >>> is it possible to map a certain range within the value-range of a image plot to >>> a constant value? Currently I am overlaying a filled contour plot with just two >>> contour levels on top of an image plot. This works, but I would like to display >>> the plateau in the colorbar as well, so that the color changes continously over >>> the whole value range but in the specified range where it should remain white. >>> I guess I would need a special colormapper to achieve that. >> Yes. See >> http://matplotlib.sourceforge.net/examples/pylab_examples/custom_cmap.html >> for an explanation of how to make one. >> >> Actually, you can achieve what you want with either a special cmap, or >> with a special norm. I don't think we have any examples of the latter. > > Tahsnk, Eric. I know understand how to create a discontinous colormap. > However I cannot think of an elegant way how to map the data value range > to the [0,1] color map range so that always the _value_ range between > e.g. 0.41 and 0.43 will be displayed white regardless of the lower and > upper bounds of the data value range. It sounds like you really need to make a custom subclass of Normalize; see the source for Normalize in mpl's colors.py to get an idea of what is required. Eric > > Regards, Christian
Eric Firing schrieb: > Christian K. wrote: >> Hi everyone, >> >> is it possible to map a certain range within the value-range of a image plot to >> a constant value? Currently I am overlaying a filled contour plot with just two >> contour levels on top of an image plot. This works, but I would like to display >> the plateau in the colorbar as well, so that the color changes continously over >> the whole value range but in the specified range where it should remain white. >> I guess I would need a special colormapper to achieve that. > > Yes. See > http://matplotlib.sourceforge.net/examples/pylab_examples/custom_cmap.html > for an explanation of how to make one. > > Actually, you can achieve what you want with either a special cmap, or > with a special norm. I don't think we have any examples of the latter. Tahsnk, Eric. I know understand how to create a discontinous colormap. However I cannot think of an elegant way how to map the data value range to the [0,1] color map range so that always the _value_ range between e.g. 0.41 and 0.43 will be displayed white regardless of the lower and upper bounds of the data value range. Regards, Christian
Hi all, This will probably end up being my very silly mistake, but at the moment, Matplotlib crashes my program with an X error whenever my window isn't expanded far enough. For those interested, it is a front-end for the strategy and analysis software for the Sunswift solar car (http://www.sunswift.com). I attach a screenshot (when it is expanded to the full screen, and therefore works) in case it helps.
Gökhan SEVER-2 wrote: > > For some reason on boxplot 3 and 5 on the figure I get fliers instead of > whiskers on the lower parts. > When I look closely at your graphic it looks to me like the lower whiskers are in fact being plotted, but just (essentially) overlayed on lower quartile part of the interquartile box. What do you see if you only plot d[2][8:] with no other boxes? Perhaps showing only one of the problem boxes will allow the Y axis resolution to be such that you can see this effect easier... -- View this message in context: http://www.nabble.com/One-more-question-regarding-to-boxplotting-tp23508395p23514606.html Sent from the matplotlib - users mailing list archive at Nabble.com.