SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S
1
2
(6)
3
(5)
4
(5)
5
6
7
8
(2)
9
10
(1)
11
(4)
12
(1)
13
14
(2)
15
(1)
16
(3)
17
(5)
18
19
(7)
20
(1)
21
(1)
22
23
(2)
24
(4)
25
(5)
26
(3)
27
28
(3)
29
(3)
30
(5)





Showing 7 results of 7

From: Goyo <goy...@gm...> - 2013年09月19日 21:38:12
2013年9月19日 Mark Bakker <ma...@gm...>:
> Hello List,
>
> When I use datestr2num('2010-05') it nicely converts that to a number
> representing the date.
> When I convert that number back with num2date, it turns out it sets the day
> to the 19th of the month. The dime is 0:00:00.
> Any reason it is set to the 19th instead of the first?
> Maybe because today it the 19th, or is that just a coincidence?
datestr2num calls dateutil.parser.parse, which by default uses the
current date at 00:00:00 for missing fields. The dateutil function
also can use a "default" argument to change this bahavoir but it is
not available in datestr2num.
http://labix.org/python-dateutil#head-a23e8ae0a661d77b89dfb3476f85b26f0b30349c
Goyo
From: Mark B. <ma...@gm...> - 2013年09月19日 19:57:20
Hello List,
When I use datestr2num('2010-05') it nicely converts that to a number
representing the date.
When I convert that number back with num2date, it turns out it sets the day
to the 19th of the month. The dime is 0:00:00.
Any reason it is set to the 19th instead of the first?
Maybe because today it the 19th, or is that just a coincidence?
Thanks,
Mark
From: Sterling S. <sm...@fu...> - 2013年09月19日 19:02:32
On Sep 19, 2013, at 10:14AM, Skip Montanaro wrote:
> 
>> Separately, if your blue data are so quantized, you might use the blue data to choose a color for an axvspan (or axhspan, I forget which is which) to indicate how certain regions of time have different values of blue data. Then you would only need one set of axes, and your x,y labels would indicate what you want.
> 
> This also works, though I (and anyone looking at the graph) would have
> to remember the mapping between color and numeric value. If I was a
> synethete this might work, but I doubt most people would automatically
> recall the mapping. :-)
No assumption of super-human recollection or inference abilities . I would add a figure or axes legend with proxy artists for the appropriate color mappings, or even just a bunch of text boxes with the text label colored appropriately. You may be interested in my answer to a stackoverflow question [1].
-Sterling
[1] http://stackoverflow.com/questions/17086847/box-around-text-in-matplotlib/17092777#17092777
From: Skip M. <sk...@po...> - 2013年09月19日 17:15:02
> I assume that you are using a twinx call to get the second y axis. I think that this question has come up before, and I think the solution was to switch which data are put on the second set of axes. (Of course to keep the same visual layout you would have to play with the y axis spine locations.)
Good point. I just changed the command line options so the plot whose
Y values are of interest are plotted on the right Y axis.
> Separately, if your blue data are so quantized, you might use the blue data to choose a color for an axvspan (or axhspan, I forget which is which) to indicate how certain regions of time have different values of blue data. Then you would only need one set of axes, and your x,y labels would indicate what you want.
This also works, though I (and anyone looking at the graph) would have
to remember the mapping between color and numeric value. If I was a
synethete this might work, but I doubt most people would automatically
recall the mapping. :-)
Thx,
Skip
From: Sterling S. <sm...@fu...> - 2013年09月19日 16:59:05
Skip,
I assume that you are using a twinx call to get the second y axis. I think that this question has come up before, and I think the solution was to switch which data are put on the second set of axes. (Of course to keep the same visual layout you would have to play with the y axis spine locations.) 
Separately, if your blue data are so quantized, you might use the blue data to choose a color for an axvspan (or axhspan, I forget which is which) to indicate how certain regions of time have different values of blue data. Then you would only need one set of axes, and your x,y labels would indicate what you want.
-Sterling
On Sep 19, 2013, at 7:46AM, Skip Montanaro wrote:
> I have a plot which uses both the left and right y axes. See
> attached. Note that the feedback in the lower right-hand corner
> displays the value on the right y axis (the blue plot). That's not a
> very interesting value though. How can I control which value is
> displayed as I move the cursor around the graph? Is it something
> control interactively with a modifier key? I tried a few, but saw no
> change. I'm currently using matplotlib v 1.1.0 (alas, something which
> is also out of my control).
> 
> Thanks,
> 
> Skip
> <axes.png>------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just 49ドル.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Skip M. <sk...@po...> - 2013年09月19日 14:47:00
Attachments: axes.png
I have a plot which uses both the left and right y axes. See
attached. Note that the feedback in the lower right-hand corner
displays the value on the right y axis (the blue plot). That's not a
very interesting value though. How can I control which value is
displayed as I move the cursor around the graph? Is it something
control interactively with a modifier key? I tried a few, but saw no
change. I'm currently using matplotlib v 1.1.0 (alas, something which
is also out of my control).
Thanks,
Skip
From: Bruno P. <bru...@gm...> - 2013年09月19日 10:00:59
Hi all,
I am trying to plot the time evolution of a probability distribution, but I
don't know how to use it. I have a different histogram for each time step.
I tried plt.ion() but I'm not sure how to use it. I'm sure it must be a
simple solution, but I haven't really found out how to do it! If I use
plt.show() as written below, I have to close the window every time for it
to reopen. Here is my code, can you help me?
import matplotlib.pyplot as plt
import numpy
import math
def p(N, Na, fa, fb):
 return float(Na)*fa/(Na*fa + (N-Na)*fb)
def binomial(n,k):
 if k > n-k:
 k = n-k
 accum = 1
 for i in range(1,k+1):
 accum *= (n - (k - i))
 accum /= i
 return accum
def pk(N, k, p):
 return binomial(N, k)*math.pow(p,k)*math.pow((1-p),(N-k))
def expected(N, dist):
 soma = 0
 for k in range(N + 1):
 soma += k*dist[k]
 return soma
def drawhist(menMeans):
 N = len(menMeans)
 ind = numpy.arange(N)
 width = 1.0
 plt.clf()
 plt.ylabel('Probability')
 plt.xlabel('k')
 plt.xlim(0.0,N)
 plt.ylim(0.0,1.0)
 plt.bar(ind, menMeans, width)
 plt.draw()
 plt.show()
N = 100
Na = 50
fa = 10
fb = 5
pks = [0]*(N+1)
pks[Na] = 1
pkst = [0]*(N+1)
expect = [Na]
drawhist(pks)
p = [p(N, n, fa, fb) for n in range(N + 1)]
for t in range(5):
 for Na in range(N + 1):
 for k in range(N + 1):
 pkst[k] += pks[Na]*pk(N, k, p[Na])
 drawhist(pkst)
 pks = pkst
 pkst = [0]*(N+1)
 expect.append(expected(N, pks))

Showing 7 results of 7

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /