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


Showing results of 395

<< < 1 2 3 4 .. 16 > >> (Page 2 of 16)
From: signal s. <see...@gm...> - 2008年07月31日 15:02:54
Hi,
I have couple of applications in which I have to generate multiple plots
interactively using the wx backend and wanted to know the best
approach to take for this. I did search the list for previous
discussions on this subject, but the approach to take is still
unfortunately not 100% clear to me.
The first use case is that I want to be able to "show" plots as soon
as they are ready. The script sits in a loop pulling out data from
different sources, does some transformations and then plots it. Now I
understand the recommended way to call show() when all the plots are
ready. But since there are many many plots and it take some time to
generate one, I would like to show the plot window as soon as it is
ready and furthermore I want all the plot windows to be alive so that
I can go back and forth through them. I tried using pylab.ion(), but
then after the script exits, all the windows disappear along with it.
The other use case is more like ipython. I have a program to connect
to a database and the user interacts with it using queries. I would
like to add visualization support to it The user should be able to plot
the data as needed and keep all the plot windows alive.
How can I do this using mpl and wx backend? Do you recommend using
threading or forking plots as separate processes?
Thanks,
Suchindra
From: Michael D. <md...@st...> - 2008年07月31日 14:57:55
In general, SVG rendering support is quite variable between engines. I 
do most of my testing on Inkscape and Firefox, since they feel the most 
correct and complete.
Can you send your SVG files (or the scripts that generate them) to this 
list so I can look at why they may be failing? Screenshots or PNGs from 
ImageMagick and/or eog may also be useful, in case I can't reproduce the 
problems with the versions I have here.
Cheers,
Mike
Mathieu Leplatre wrote:
> Hi all,
>
> With both matplotlib versions (0.91 and 0.98), my SVGs are rendered
> correctly in Inkscape (and almost well in Firefox), but they are not
> rendered correctly when viewed with ImageMagick or Eye-of-Gnome.
>
> I did screenshots here, showing this "curve cropping" issue :
> http://mathieu-leplatre.info/media/matplotlib-svg/
>
> I am running CentOS 5.2 with matplotlib compiled manually in both cases.
> Cairo 1.2.4, librsvg 2.16, inkscape 0.46
>
> Could it be related to matplotlib ? Or to operating system libraries ?
>
> Thank you all for your support.
> Mathieu.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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
From: Michael D. <md...@st...> - 2008年07月31日 14:21:35
Like John, I can't think of anything off hand to prevent this in the 
future. However, if you're working with a script that causes this to 
happen again, please send us the script. It may indicate an infinite 
loop or unbounded memory usage, and we'd like to track it down and fix it.
Also, as nice as interactive use is for experimentation, I usually build 
my important plots (where I'm concerned about losing data etc.) in a 
script file (.py), and then run that. That way if things do get stuck, 
I can kill python and start over pretty easily.
Cheers,
Mike
Anand Patil wrote:
> Hi all,
>
> I'm using matplotlib with the TKAgg on a remote machine running 
> Ubuntu. Normally when I call 'plot' I see the plot in an X11 window, 
> but I called 'plot' yesterday and Python went unresponsive... it 
> doesn't listen to ctrl-C or anything, and it's been more than 24 hours.
>
> I would REALLY like to preserve the data Python has in memory. Is 
> there any way to kill the plot command and wake Python back up?
>
> Thanks,
> Anand Patil
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
From: Manuel M. <mm...@as...> - 2008年07月31日 13:46:44
Antonino Cucchiara wrote:
> Hi,
> I have some graphs with lower and upper limits. I found a couple of 
> ideas online, but nothing like "plotting symbols" like arrows.
> I am using the mathtex upperarrow symbol but it is quite unconfortable 
> positioning the tex character in the righ X-Y position.
> Do you know if there is an easier way to plot arrows as "markers"?
> 
> Thanks,
> Nino
> 
Have a look at examples/pylab_examples/errorbar_limits.py. This shows 
how to plot upper/lower limits errorbars ... (if this is what you need)
From: Antonino C. <cuc...@as...> - 2008年07月31日 13:41:31
Hi,
I have some graphs with lower and upper limits. I found a couple of 
ideas online, but nothing like "plotting symbols" like arrows.
I am using the mathtex upperarrow symbol but it is quite unconfortable 
positioning the tex character in the righ X-Y position.
Do you know if there is an easier way to plot arrows as "markers"?
Thanks,
Nino
-- 
Antonino Cucchiara
PhD candidate
Department of Astronomy&Astrophysics
Penn State University
website: www.astro.psu.edu/~cucchiara/
From: Alan G I. <ai...@am...> - 2008年07月31日 13:33:07
On 2008年7月31日, stuartornum apparently wrote:
> Is there a way to build a "plot string", and then plot the 
> string once the for loop has finished. 
What gain are you looking for over your lists,
which seems an efficient approach?
You realize plot accepts 2d objects, right?
http://matplotlib.sourceforge.net/matplotlib.pyplot.html#-plot
So you can just make a list of lists for the dependent variables.
Cheers,
Alan Isaac
From: John H. <jd...@gm...> - 2008年07月31日 13:23:32
On Thu, Jul 31, 2008 at 8:18 AM, Ben Axelrod <bax...@co...> wrote:
> Yes. I did this by deriving my toolbar class from the default NavigationToolbar2WxAgg. Then deleting the buttons I did not want. I had to delete by position, because I did not know their IDs. (Does anyone know how to get the IDs of these standard buttons?) Sample code below:
Alternatively, you can follow the lead of
examples/user_interfaces/embedding_in_wx4.py which uses a custom
toolbar. You can cut the NavigationToolbar2 code from backend_wx.py
and remove the bits you don't want.
JDH
From: Ben A. <bax...@co...> - 2008年07月31日 13:18:16
Yes. I did this by deriving my toolbar class from the default NavigationToolbar2WxAgg. Then deleting the buttons I did not want. I had to delete by position, because I did not know their IDs. (Does anyone know how to get the IDs of these standard buttons?) Sample code below:
class VMToolbar(NavigationToolbar2WxAgg):
 def __init__(self, plotCanvas):
 NavigationToolbar2WxAgg.__init__(self, plotCanvas)
 # delete unwanted tools
 self.DeleteToolByPos(1) # Back Arrow
 self.DeleteToolByPos(1) # Forward Arrow (note this was position 2)
 self.DeleteToolByPos(3) # Divider (this was position 5)
 self.DeleteToolByPos(3) # Configure subplots (this was position 6)
 ...
 #end __init__
#end class
-----Original Message-----
From: mat...@li... [mailto:mat...@li...] On Behalf Of eliben
Sent: Thursday, July 31, 2008 1:28 AM
To: mat...@li...
Subject: [Matplotlib-users] Navigation toolbar w/o subplot configuration button
Hello,
I'm using mpl in a wxPython application to display plots dynamically. I want
to let the users interact with the plots (zoom, move), but I don't need the
"subplot configuration" button on the Navigation Toolbar. Can I instantiate
the toolbar without this button ?
TIA
Eli
--
View this message in context: http://www.nabble.com/Navigation-toolbar-w-o-subplot-configuration-button-tp18747977p18747977.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: <fe...@25...> - 2008年07月31日 13:16:26
Attachments: statistics.png
Hello,
I would like to show a colorbar for my plot (see attachment) but I can't
figure out how it works.
In the examples on the website I only found the call to pylab.colorbar(),
which doesn't work with my subplots. My code is as follows (with the bar
graph-part snipped, for brevity). I also tried the ColorBar class and
assigning "cmap=cm.jet" but it didn't work. Could anybody give me a hint
please? I searched the tutorial, cookbook, api reference and google, but I
can't really find anything.
Thanks,
Felix
fig = p.figure()
fig.text(0.5, 0.94, main_title, fontsize="x-large", ha="center")
(...bar graph part snipped...)
ax = fig.add_subplot(222)
ax.set_title('Euclidean Distance')
matrix = n.zeros([numof_dicts, numof_dicts])
for i1, d1 in enumerate(dictionaries):
 for i2, d2 in enumerate(dictionaries):
 for k in d1.keys():
 if d2.has_key(k):
 prob1 = (d1[k] / vectorlengths[i1])
 prob2 = (d2[k] / vectorlengths[i2])
 matrix[i1, i2] += prob1 * prob2
ax.imshow(matrix, interpolation="nearest", cmap=p.cm.jet)
if documentnames != None:
 ax.set_yticklabels(documentnames, va="center", fontsize='x-small')
 ax.set_yticks(range(numof_dicts))
#p.colorbar()
ax = fig.add_subplot(224)
ax.set_title('Kullback Leibler Distance')
ax.imshow(matrix, interpolation="nearest")
if documentnames != None:
 ax.set_yticklabels(documentnames, va="center", fontsize='x-small')
 ax.set_yticks(range(numof_dicts))
 ax.set_xticklabels(documentnames, rotation=320, va="top", ha="left",
fontsize='xx-small')
 ax.set_xticks(range(numof_dicts))
fig.subplots_adjust(left=0.10, right=0.90, top=0.90, bottom=0.24,
hspace=0.3,wspace=0.9)
fig.set_size_inches(13, 10.5)
fig.savefig(sys.argv[1] + "_statistics.png")
#p.show()
From: Michael D. <md...@st...> - 2008年07月31日 13:03:20
(Sorry for the delay -- just back from vacation)
It looks like the default Vera Sans font that matplotlib uses doesn't 
actually have the lunate epsilon character. If you have it installed, 
you could have matplotlib use the DejaVu Sans font instead (which is 
essentially Vera Sans with a larger set of characters).
In your matplotlibrc, set font.sans to DejaVu Sans
Cheers,
Mike
Eli Brosh wrote:
> Thanks,
> This unicode thing works like magic.
> The only thing I am still unable to do is to insert the symbol 
> \epsilon (as distinct from \varepsilon).
> For some reason, the varepsilon ε is printed fine, but a blank square 
> is printed instead of the lunate epsilon ε.
> That is u' ε ' works, while u' ε' does not.
>
> Any idea why this is happening ?
>
> Eli
>
>
> 2008年7月22日 Michael Droettboom <md...@st... <mailto:md...@st...>>:
>
> Yes, you would put it at the top of your .py file.
>
> In order to use Unicode in Python source code, you have to tell
> the Python interpreter what encoding the file is in. That's done
> with a little "magic" comment at the top of the file. The popular
> Unixy editors (emacs, vim etc.) also understand this comment and
> will save the file correctly. Possibly other editors do as well.
>
> For more gory details that you probably need, see this:
>
> http://www.amk.ca/python/howto/unicode
>
> particularly the section "Unicode Literals in Python Source Code".
>
>
> Cheers,
> Mike
>
> Eli Brosh wrote:
>
> Thanks,
> This seems to be a solution.
> I have an editor that supports unicode.
> But, can you please explain better how do I make the coding
> directive at the top of my source files ?
> Where do I write the command:
> # -*- coding: utf-8 -*-
>
> Is it inside the python script ?
>
>
> Sorry for the ignorance.
> Eli
>
> On Tue, Jul 22, 2008 at 10:14 AM, Michael Droettboom
> <md...@st... <mailto:md...@st...>
> <mailto:md...@st... <mailto:md...@st...>>> wrote:
>
> As an alternative, you could just use Unicode to insert the
> Greek
> characters:
>
> r"α-Fe (Someone 2003)"
>
> The default font used by matplotlib, Vera Sans, includes a full
> set of Greek characters. This, of course, requires an
> editor that
> supports Unicode and a coding directive at the top of your
> source
> files, eg.:
>
> # -*- coding: utf-8 -*-
>
>
> Cheers,
> Mike
>
> Eli Brosh wrote:
>
> Here is the use case I have in mind:
> Plotting properties of various phases of iron, I need a
> legend
> with greek letters and normal text:
> \alpha-Fe, Someone (2003)
>
> Now, I need the names e.g. someone to be upright.
> Also, the relbar between \alpha and Fe is shorter with
> normal
> text fonts than with italics.
>
> I can solve the problem by using r'\rm{\alpha-Fe, Someone
> (2003)}' but it would be easier if I could just change the
> defaults.
>
> Eli
>
>
> On Mon, Jul 21, 2008 at 6:21 PM, Michael Droettboom
> <md...@st... <mailto:md...@st...>
> <mailto:md...@st... <mailto:md...@st...>>
> <mailto:md...@st... <mailto:md...@st...>
> <mailto:md...@st... <mailto:md...@st...>>>> wrote:
>
> Unfortunately there isn't. This is *theoretically*
> possible
> with
> the STIX fonts, but that hasn't been implemented.
> However, with
> the Computer Modern fonts, many of the glyphs simply
> aren't
> present (upright Greek, for example) to make this
> happen.
>
> That said, I'm not sure this is necessarily a good idea.
> Math has
> a set of commonly accepted conventions about when to
> use italic
> vs. upright that may only confuse the reader when
> not followed.
> Can you provide a use case?
>
> Cheers,
> Mike
>
> Eli Brosh wrote:
>
> Hello
> I there a way to change the default mathtext
> font from
> cal to rm ?
> I would like to use the rm (serif) font without
> stating
> rm{...} or mathrm{...}.
> Is it possible to do using the matplotlibrc ?
> can you give me an example of how this is done ?
>
> Thanks
> Eli
> 
> ------------------------------------------------------------------------
>
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin
> Your Move
> Developer's challenge
> Build the coolest Linux based applications with
> Moblin
> SDK &
> win great prizes
> Grand prize is a trip for two to an Open Source
> event
> anywhere
> in the world
> 
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
> 
> <http://moblin-contest.org/redirect.php?banner_id=100&url=/
> <http://moblin-contest.org/redirect.php?banner_id=100&url=/>>
> 
> <http://moblin-contest.org/redirect.php?banner_id=100&url=/
> <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
> 
> <http://moblin-contest.org/redirect.php?banner_id=100&url=/
> <http://moblin-contest.org/redirect.php?banner_id=100&url=/>>>
> 
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> <mailto:Mat...@li...
> <mailto:Mat...@li...>>
> <mailto:Mat...@li...
> <mailto:Mat...@li...>
> <mailto:Mat...@li...
> <mailto: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
>
>
>
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: stuartornum <st...@mu...> - 2008年07月31日 10:34:21
Hi again,
This is slightly similar to my previous post, however using lists, not
dictionaires.
So, I have a for loop that produces two list, as follows:
Hours = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12',
'13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
and
Values = ['5.8', '5.76', '5.81', '5.72', '5.69', '5.88', '5.77', '5.64',
'6.78', '5.82', '6.74', '5.45', '5.61', '5.77', '10.02', '5.88', '5.77',
'5.64', '6.78', '5.82', '6.74', '5.45', '5.61']
So as you can see for each hour a value is given, now plotting this is
simple, its just plot(Hours, Values).
However, this is generated from a for loop and there could be anything from
1 to 1000 of the "Hours" and "Values" lists (The "Hours" list is always the
same), and I would like to plot all on the same axis.
Is there a way to build a "plot string", and then plot the string once the
for loop has finished. i.e
PlotString = ""
for item in AList:
 Hours = item[0]
 Values = item[1]
 PlotString += Hours, Values
plot(PlotString)
Now I know the above does not work, but it is purely to describe where I am
trying to go.
Thank you for all your help.
-- 
View this message in context: http://www.nabble.com/Plot-Multiple-List-by-concatenating-to-a-string--tp18751780p18751780.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: stuartornum <st...@mu...> - 2008年07月31日 09:04:18
Thank you John,
Just what I was looking for.
John Hunter-4 wrote:
> 
> On Wed, Jul 30, 2008 at 9:17 AM, stuartornum <st...@mu...> wrote:
>>
>> Hi,
>>
>> Wondering if anyone has done something similar and could point me in the
>> right direction.
>>
>> I have a dictionary like this:
>>
>> Dict{'00:00:00':'23', '00:01:00':'29', '00:02:00':'13', '00:03:00':'78',
>> '00:04:00':'45', >....> '23:59:00':54}
>>
>> So as you can see there is 24 hours worth of minutes, with a value
>> attached
>> to each minute.
>>
>> Firstly, just to note the Dictionary "Dict" is not actually in order as
>> above, it is all jumbled up.
>>
>> However is it possible to plot a dictionary using MatPlotLib, and using
>> the
>> time along the x-axis and values up the y?
> 
> You will have to extract the x and y values, and convert them from
> strings to values matplotlib can understand (for example dates and
> floating point numbers). Eg
> 
> 
> In [30]: d = {'00:00:00':'23', '00:01:00':'29', '00:02:00':'13',
> '00:03:00':'78',
> '00:04:00':'45', '23:59:00':54}
> 
> In [32]: from dateutil.parser import parse
> 
> In [33]: items = [(parse(date), float(val)) for date, val in d.items()]
> 
> In [34]: items.sort()
> 
> In [35]: items
> Out[35]:
> [(datetime.datetime(2008, 7, 30, 0, 0), 23.0),
> (datetime.datetime(2008, 7, 30, 0, 1), 29.0),
> (datetime.datetime(2008, 7, 30, 0, 2), 13.0),
> (datetime.datetime(2008, 7, 30, 0, 3), 78.0),
> (datetime.datetime(2008, 7, 30, 0, 4), 45.0),
> (datetime.datetime(2008, 7, 30, 23, 59), 54.0)]
> 
> In [36]: dates, values = zip(*items)
> 
> In [37]: plot(dates, values)
> Out[37]: [<matplotlib.lines.Line2D object at 0xb45a5ec>]
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/Plot-a-Dictionary%2C-time-and-value-tp18734294p18750474.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Johann Cohen-T. <co...@sl...> - 2008年07月31日 06:11:44
hmm, reading the initial email, this is not what I understood the idea 
would be. So let me the following : I have a dictionnary with the 7 days 
of week as keys (strings) and a value attached to it. I would like to 
plot the days of the week in x and the corresponding values in y. It 
amounts to a histogram of 7 bins, and to correctly labeling the ticks 
with the keys instead of the integer 0...6. So it becomes kind of a bar 
chart. See p.40 of ftp://root.cern.ch/root/doc/3Histograms.pdf for an 
illustration.
I would imagine that requesting to plot a dictionary would naturally 
mean this kind of result, but I may overlook possible ambiguities.
Anyway, that is what I understood the initial question was.
Johann
 
John Hunter wrote:
> On Wed, Jul 30, 2008 at 9:17 AM, stuartornum <st...@mu...> wrote:
> 
>> Hi,
>>
>> Wondering if anyone has done something similar and could point me in the
>> right direction.
>>
>> I have a dictionary like this:
>>
>> Dict{'00:00:00':'23', '00:01:00':'29', '00:02:00':'13', '00:03:00':'78',
>> '00:04:00':'45', >....> '23:59:00':54}
>>
>> So as you can see there is 24 hours worth of minutes, with a value attached
>> to each minute.
>>
>> Firstly, just to note the Dictionary "Dict" is not actually in order as
>> above, it is all jumbled up.
>>
>> However is it possible to plot a dictionary using MatPlotLib, and using the
>> time along the x-axis and values up the y?
>> 
>
> You will have to extract the x and y values, and convert them from
> strings to values matplotlib can understand (for example dates and
> floating point numbers). Eg
>
>
> In [30]: d = {'00:00:00':'23', '00:01:00':'29', '00:02:00':'13',
> '00:03:00':'78',
> '00:04:00':'45', '23:59:00':54}
>
> In [32]: from dateutil.parser import parse
>
> In [33]: items = [(parse(date), float(val)) for date, val in d.items()]
>
> In [34]: items.sort()
>
> In [35]: items
> Out[35]:
> [(datetime.datetime(2008, 7, 30, 0, 0), 23.0),
> (datetime.datetime(2008, 7, 30, 0, 1), 29.0),
> (datetime.datetime(2008, 7, 30, 0, 2), 13.0),
> (datetime.datetime(2008, 7, 30, 0, 3), 78.0),
> (datetime.datetime(2008, 7, 30, 0, 4), 45.0),
> (datetime.datetime(2008, 7, 30, 23, 59), 54.0)]
>
> In [36]: dates, values = zip(*items)
>
> In [37]: plot(dates, values)
> Out[37]: [<matplotlib.lines.Line2D object at 0xb45a5ec>]
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: eliben <el...@gm...> - 2008年07月31日 05:27:32
Hello,
I'm using mpl in a wxPython application to display plots dynamically. I want
to let the users interact with the plots (zoom, move), but I don't need the
"subplot configuration" button on the Navigation Toolbar. Can I instantiate
the toolbar without this button ?
TIA
Eli
-- 
View this message in context: http://www.nabble.com/Navigation-toolbar-w-o-subplot-configuration-button-tp18747977p18747977.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: \Jonathan H. http://JonathansCorner.com\ <jon...@po...> - 2008年07月30日 20:46:06
If there are one or more narrow wedges on a pie graph, narrow enough that
the percentage values overlap and are hard to read, there seems to be a
knife-thin missing wedge from the pie, including a break in the
circumference.
Is this configurable, even if it means that the border completely covers the
colored interior of ultra-thin wedges?
-- 
-- Jonathan Hayward, chr...@gm...
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
++ Would you like to curl up with one of my hardcover books?
++ You can now get my books from http://CJSHayward.com
From: \Jonathan H. http://JonathansCorner.com\ <jon...@po...> - 2008年07月30日 19:41:06
How can I customize a pie graph autopct format string to display the value
for one of the regions to a specified precision? If I have category A
presenting 5ドル.25, category B representing 1ドル.30, and category C representing
2ドル.00, how do I get the numeric value (not the label) displayed for category
A to be "5ドル.25" instead of "NN.N%"?
-- 
-- Jonathan Hayward, chr...@gm...
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
++ Would you like to curl up with one of my hardcover books?
++ You can now get my books from http://CJSHayward.com
From: John H. <jd...@gm...> - 2008年07月30日 14:41:10
On Wed, Jul 30, 2008 at 9:17 AM, stuartornum <st...@mu...> wrote:
>
> Hi,
>
> Wondering if anyone has done something similar and could point me in the
> right direction.
>
> I have a dictionary like this:
>
> Dict{'00:00:00':'23', '00:01:00':'29', '00:02:00':'13', '00:03:00':'78',
> '00:04:00':'45', >....> '23:59:00':54}
>
> So as you can see there is 24 hours worth of minutes, with a value attached
> to each minute.
>
> Firstly, just to note the Dictionary "Dict" is not actually in order as
> above, it is all jumbled up.
>
> However is it possible to plot a dictionary using MatPlotLib, and using the
> time along the x-axis and values up the y?
You will have to extract the x and y values, and convert them from
strings to values matplotlib can understand (for example dates and
floating point numbers). Eg
In [30]: d = {'00:00:00':'23', '00:01:00':'29', '00:02:00':'13',
'00:03:00':'78',
'00:04:00':'45', '23:59:00':54}
In [32]: from dateutil.parser import parse
In [33]: items = [(parse(date), float(val)) for date, val in d.items()]
In [34]: items.sort()
In [35]: items
Out[35]:
[(datetime.datetime(2008, 7, 30, 0, 0), 23.0),
 (datetime.datetime(2008, 7, 30, 0, 1), 29.0),
 (datetime.datetime(2008, 7, 30, 0, 2), 13.0),
 (datetime.datetime(2008, 7, 30, 0, 3), 78.0),
 (datetime.datetime(2008, 7, 30, 0, 4), 45.0),
 (datetime.datetime(2008, 7, 30, 23, 59), 54.0)]
In [36]: dates, values = zip(*items)
In [37]: plot(dates, values)
Out[37]: [<matplotlib.lines.Line2D object at 0xb45a5ec>]
From: stuartornum <st...@mu...> - 2008年07月30日 14:17:03
Hi,
Wondering if anyone has done something similar and could point me in the
right direction.
I have a dictionary like this:
Dict{'00:00:00':'23', '00:01:00':'29', '00:02:00':'13', '00:03:00':'78',
'00:04:00':'45', >....> '23:59:00':54}
So as you can see there is 24 hours worth of minutes, with a value attached
to each minute.
Firstly, just to note the Dictionary "Dict" is not actually in order as
above, it is all jumbled up.
However is it possible to plot a dictionary using MatPlotLib, and using the
time along the x-axis and values up the y?
Thank you in advanced
-- 
View this message in context: http://www.nabble.com/Plot-a-Dictionary%2C-time-and-value-tp18734294p18734294.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Laurent D. <lau...@gm...> - 2008年07月30日 12:08:23
Ho you got the point...
self.clutter_low.GetPosition() didn't returned an int...
self.clutter_low.GetValue return an int an it works now.
I missed this because I thought that 
self.norm = plt.Normalize(vmin=self.low_clutter_val,
vmax=self.high_clutter_val)
would have crashed before in this case, but seems it does not do any
computation on Normalize call.
Anyhow, thank you a lot, sorry to have send this error, I could have read my
code deeper first.
Regards,
Lauent
> -----Message d'origine-----
> De : John Hunter [mailto:jd...@gm...]
> Envoyé : mercredi 30 juillet 2008 02:04
> À : Laurent Dufrechou
> Cc : mat...@li...
> Objet : Re: [Matplotlib-users] imshow update norm make my app crash.
> 
> On Tue, Jul 29, 2008 at 6:52 PM, Laurent Dufrechou
> <lau...@gm...> wrote:
> 
> > I've applied the idea you've said later about colormap.
> >
> > Now I would like on an event to refresh my view so I've written this
> code:
> 
> 
> I would like to see what
> 
> self.low_clutter_val = self.clutter_low.GetPosition()
> 
> self.high_clutter_val = self.clutter_high.GetPosition()
> 
> low and high clutter val are (can you print them, as well as their
> type, eg
> 
> print low', type(self.low_clutter_val), self.low_clutter_val
> 
> and likewise for the high val. From the error, it looks lik they are
> not scalars.
> 
> JDH
From: Manuel M. <mm...@as...> - 2008年07月30日 08:03:41
sa6113 wrote:
> I am using matplotlib to draw and show my plot, now I want to know how may I
> add manual axes scale to it.
> I need to manually show the axes scale (from min to max value that I have)
> the below is some part of my code.
> .
> .
> .
> from matplotlib.figure import Figure
> 
> self.fig = Figure( figsize =5, 4 ))
> yLine = self.ax.plot( xData, yData, 'ro-', linewidth = 2 )
> fitLine = self.ax.plot( xData, fitData,'bo-', linewidth = 1 )
> self.ax.set_xlabel('X')
> self.ax.set_ylabel('Y )
Maybe this is what you need:
self.ax.set_xlim(xmin, xmax)
?
From: sa6113 <s.p...@gm...> - 2008年07月30日 07:53:05
I am using matplotlib to draw and show my plot, now I want to know how may I
add manual axes scale to it.
I need to manually show the axes scale (from min to max value that I have)
the below is some part of my code.
.
.
.
from matplotlib.figure import Figure
self.fig = Figure( figsize =5, 4 ))
yLine = self.ax.plot( xData, yData, 'ro-', linewidth = 2 )
fitLine = self.ax.plot( xData, fitData,'bo-', linewidth = 1 )
self.ax.set_xlabel('X')
self.ax.set_ylabel('Y )
-- 
View this message in context: http://www.nabble.com/how-add-axes-scale-to-my-plot--tp18727840p18727840.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2008年07月30日 02:16:18
On Tue, Jul 29, 2008 at 1:12 PM, John Hunter <jd...@gm...> wrote:
> We are in the final stages of preparing a new matplotlib release, and
> a lot of work has gone into it. If you would like to test the release
> and see if it is working for you, that would be a big help
>
> http://matplotlib.sourceforge.net/tmp/matplotlib-0.98.3rc2.tar.gz
>
> Unfortunately, we do not have binary builds available at this time.
Charlie was kind enough to build a windows installer for the release
candidate for testing, which is available here
 http://matplotlib.sourceforge.net/tmp/matplotlib-0.98.3rc2.win32-py2.5.exe
We aren't going to wait around for too long, so if you are able to
test, please do so sooner rather than later. In the absence of
serious problems, we'll be pushing out a release in the next day or
two.
JDH
From: John H. <jd...@gm...> - 2008年07月30日 00:04:37
On Tue, Jul 29, 2008 at 6:52 PM, Laurent Dufrechou
<lau...@gm...> wrote:
> I've applied the idea you've said later about colormap.
>
> Now I would like on an event to refresh my view so I've written this code:
I would like to see what
 self.low_clutter_val = self.clutter_low.GetPosition()
 self.high_clutter_val = self.clutter_high.GetPosition()
low and high clutter val are (can you print them, as well as their type, eg
 print low', type(self.low_clutter_val), self.low_clutter_val
and likewise for the high val. From the error, it looks lik they are
not scalars.
JDH
From: Chee S. L. <che...@gm...> - 2008年07月29日 23:53:00
Hi,
I am trying to save figures where all the artists have animated =
True. The result I get (I have tried svg and png formats) is a set of
axes with labels, ticks, and grid, but no data points! I am using the
WxAgg backend.
Is this something to be expected, and if so, can anyone suggest a workaround?
Thanks,
Chee Sing Lee
Oregon State University
Dept. Nuclear Engineering and Radiation Health Physics
From: Chee S. L. <che...@gm...> - 2008年07月29日 23:52:59
Hi,
I am trying to save figures where all the artists have animated =
True. The result I get (I have tried svg and png formats) is a set of
axes with labels, ticks, and grid, but no data points! I am using the
WxAgg backend.
Is this something to be expected, and if so, can anyone suggest a workaround?
Thanks,
Chee Sing Lee
Oregon State University
Dept. Nuclear Engineering and Radiation Health Physics
8 messages has been excluded from this view by a project administrator.

Showing results of 395

<< < 1 2 3 4 .. 16 > >> (Page 2 of 16)
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 によって変換されたページ (->オリジナル) /