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





Showing 15 results of 15

From: Solomon M N. <sol...@tw...> - 2010年05月19日 21:47:59
Hello, 
I came across problem of label rotation with autofmt_xdate() in subplothost
too. Is there a new version with the bug fixed or a workaround to doing the
label rotation in subplothost? 
Thanks,
Solomon
Jae-Joon Lee wrote:
> 
> The workarounds suggested in this thread does not work?
> To me, the ordinal thing is not actually a bug, but you need some
> extra caution to avoid this error happening.
> 
> The issue with the label roration is a different matter though.
> 
> Regards,
> 
> -JJ
> 
> 
> On Wed, Jan 13, 2010 at 8:16 AM, Rodribat <rod...@gm...> wrote:
>>
>>
>> Hi matplotlib users!
>>
>> Did someone solve the problem of use fig.autofmt_xdate() function with
>> SubplotHost object?
>> I googled for it and I found this question only here, without solution.
>> Is
>> there a bug? Anyone knows
>> someway to solve this?
>>
>> Thank you,
>>
>> []'s
>>
>> Rodrigo Batista
>>
>>
>> David GUERINEAU wrote:
>>>
>>> Hi matplotlib_users !
>>>
>>> I'm David from Berlin, and believe I'm experiencing some problem with
>>> the
>>> SubplotHost module:
>>>
>>> I'm generating graphs from hudge databases of cpu and ethernet
>>> statistics,
>>> and I wanted to mix several graphs concerning ethernet statistics in the
>>> same figure,
>>> with time as x axis, and bytes-in, bytes-out, packets-in, packets-out
>>> and
>>> number of
>>> collisions as three different y axes, with three different scale.
>>>
>>> I took the inspiration from
>>>
>>> for the x axes and from
>>>
>>> http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes2.html
>>> for the y axes
>>>
>>> The following code is a synthetic reproduction of the problem I'm
>>> experiencing (it is also attached):
>>>
>>> from matplotlib.dates import date2num
>>> from matplotlib import pyplot
>>> from matplotlib import pylab
>>> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
>>> from datetime import datetime
>>>
>>> dates = [ 733581.20833333337, 733581.20837962965, 733581.20842592593,
>>> 733581.20847222221, 733581.20851851848,
>>>    733581.20855324075, 733581.20858796302, 733581.2086342593,
>>> 733581.20866898145, 733581.20871527772]
>>> rxB = [054L, 130L, 144L, 54L, 36L, 9L, 35L, 43L, 85L, 43L]
>>> txB = [4L, 9L, 9L, 5L, 4L, 4L, 4L, 5L, 6L, 5L]
>>> rxP = [77, 228, 251, 112, 77, 42, 75, 97, 147, 91]
>>> txP = [61, 177, 188, 90, 61, 40, 64, 76, 113, 77]
>>> col = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>>
>>> ethPlot = pyplot
>>> fig = ethPlot.figure()
>>> host = SubplotHost(fig, 111)
>>>
>>> host.set_ylabel("kB/s")
>>> host.set_xlabel("Time")
>>>
>>> par1 = host.twinx()
>>> par2 = host.twinx()
>>>
>>> par1.set_ylabel("Packets/s")
>>>
>>> par2.axis["right"].set_visible(False)
>>>
>>> offset = 60, 0
>>> new_axisline = par2.get_grid_helper().new_fixed_axis
>>> par2.axis["right2"] = new_axisline(loc="right",
>>>           axes=par2,
>>>           offset=offset)
>>>
>>> par2.axis["right2"].label.set_visible(True)
>>> par2.axis["right2"].set_label("Collisions")
>>>
>>> par1.set_ylim(0, 6000)
>>> par2.set_ylim(0, 7000)
>>>
>>> host.axis([ dates[0], ( dates[0] + 0.041 ), -7000, 7000])
>>> par1.axis([ dates[0], ( dates[0] + 0.041 ), -10000, 10000])
>>> par2.axis([ dates[0], ( dates[0] + 0.041 ), -700, 700])
>>>
>>> fig.add_axes(host)
>>> ethPlot.subplots_adjust(right=0.75)
>>>
>>> drawRxByt, = host.plot_date(dates, rxB, 'g', tz=None, xdate=True,
>>> ydate=False, label="kB/s in")
>>> drawTxByt, = host.plot_date(dates, txB, 'b', tz=None, xdate=True,
>>> ydate=False, label="kB/s out")
>>> drawRxPaq, = par1.plot_date(dates, rxP, 'm', tz=None, xdate=True,
>>> ydate=False, label="packets/s in")
>>> drawTxPaq, = par1.plot_date(dates, txP, 'y', tz=None, xdate=True,
>>> ydate=False, label="packets/s out")
>>> drawColls, = par2.plot_date(dates, col, 'r', tz=None, xdate=True,
>>> ydate=False, label="collisions")
>>>
>>> fig.autofmt_xdate()
>>>
>>> host.set_xlabel("Time")
>>> host.set_ylabel("kB/s")
>>> par1.set_ylabel("Packets/s")
>>>
>>> host.legend()
>>>
>>> host.axis["left"].label.set_color(drawRxByt.get_color())
>>> host.axis["left"].label.set_color(drawTxByt.get_color())
>>> par1.axis["right"].label.set_color(drawRxPaq.get_color())
>>> par1.axis["right"].label.set_color(drawtxPaq.get_color())
>>> par2.axis["right2"].label.set_color(drawColls.get_color())
>>>
>>> ethPlot.draw()
>>> pylab.savefig( './test.png', dpi=(640/8))
>>>
>>>
>>>
>>>
>>> Maybe I do something wrong somewhere here, but other scripts that do the
>>> same for a single graphwork like a charm. So it's not a question of
>>> dataType
>>> or something. To compare with a working code, here is the first version
>>> of
>>> the fuction that does the job on single graphs without any problem :
>>>
>>> def drawEthGraph(filename, hdates, rxP, txP, rxB, txB, col):
>>>  ethPlot = pyplot
>>>  fig = ethPlot.figure()
>>>  ax = fig.add_subplot(111)
>>>  ax.plot_date(hdates, rxP, 'g', None, True, False)
>>>  ax.plot_date(hdates, txP, 'b', None, True, False)
>>>  ax.plot_date(hdates, rxB, 'g', None, True, False)
>>>  ax.plot_date(hdates, txB, 'b', None, True, False)
>>>  ax.plot_date(hdates, col, 'r', None, True, False)
>>>  ax.axis([ hdates[0], ( hdates[0] + 0.042 ), -7000, 7000])
>>>  ax.grid(True)
>>>  fig.autofmt_xdate()
>>>  pylab.savefig( filename, dpi=(640/8))
>>>
>>>
>>> I don't think I understand the whole process of generation, but I
>>> thought
>>> at
>>> least at the beginnig I was having a good feeling with this API.
>>> Now I wonder how to go around this. Maybe you'll have an idea :-o
>>>
>>> Best regards
>>>
>>> DvD
>>>
>>> from matplotlib.dates import date2num
>>> from matplotlib import pyplot
>>> from matplotlib import pylab
>>> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
>>> from datetime import datetime
>>>
>>> dates = [ 733581.20833333337, 733581.20837962965, 733581.20842592593,
>>> 733581.20847222221, 733581.20851851848,
>>>     733581.20855324075, 733581.20858796302, 733581.2086342593,
>>> 733581.20866898145, 733581.20871527772]
>>> rxB = [054L, 130L, 144L, 54L, 36L, 9L, 35L, 43L, 85L, 43L]
>>> txB = [4L, 9L, 9L, 5L, 4L, 4L, 4L, 5L, 6L, 5L]
>>> rxP = [77, 228, 251, 112, 77, 42, 75, 97, 147, 91]
>>> txP = [61, 177, 188, 90, 61, 40, 64, 76, 113, 77]
>>> col = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>>
>>> ethPlot = pyplot
>>> fig = ethPlot.figure()
>>> host = SubplotHost(fig, 111)
>>>
>>> host.set_ylabel("kB/s")
>>> host.set_xlabel("Time")
>>>
>>> par1 = host.twinx()
>>> par2 = host.twinx()
>>>
>>> par1.set_ylabel("Packets/s")
>>>
>>> par2.axis["right"].set_visible(False)
>>>
>>> offset = 60, 0
>>> new_axisline = par2.get_grid_helper().new_fixed_axis
>>> par2.axis["right2"] = new_axisline(loc="right",
>>>                  axes=par2,
>>>                  offset=offset)
>>>
>>> par2.axis["right2"].label.set_visible(True)
>>> par2.axis["right2"].set_label("Collisions")
>>>
>>> par1.set_ylim(0, 6000)
>>> par2.set_ylim(0, 7000)
>>>
>>> host.axis([ dates[0], ( dates[0] + 0.041 ), -7000, 7000])
>>> par1.axis([ dates[0], ( dates[0] + 0.041 ), -10000, 10000])
>>> par2.axis([ dates[0], ( dates[0] + 0.041 ), -700, 700])
>>>
>>> fig.add_axes(host)
>>> ethPlot.subplots_adjust(right=0.75)
>>>
>>> drawRxByt, = host.plot_date(dates, rxB, 'g', tz=None, xdate=True,
>>> ydate=False, label="kB/s in")
>>> drawTxByt, = host.plot_date(dates, txB, 'b', tz=None, xdate=True,
>>> ydate=False, label="kB/s out")
>>> drawRxPaq, = par1.plot_date(dates, rxP, 'm', tz=None, xdate=True,
>>> ydate=False, label="packets/s in")
>>> drawTxPaq, = par1.plot_date(dates, txP, 'y', tz=None, xdate=True,
>>> ydate=False, label="packets/s out")
>>> drawColls, = par2.plot_date(dates, col, 'r', tz=None, xdate=True,
>>> ydate=False, label="collisions")
>>>
>>> fig.autofmt_xdate()
>>>
>>> host.set_xlabel("Time")
>>> host.set_ylabel("kB/s")
>>> par1.set_ylabel("Packets/s")
>>>
>>> host.legend()
>>>
>>> host.axis["left"].label.set_color(drawRxByt.get_color())
>>> host.axis["left"].label.set_color(drawTxByt.get_color())
>>> par1.axis["right"].label.set_color(drawRxPaq.get_color())
>>> par1.axis["right"].label.set_color(drawtxPaq.get_color())
>>> par2.axis["right2"].label.set_color(drawColls.get_color())
>>>
>>> ethPlot.draw()
>>> pylab.savefig( './test.png', dpi=(640/8))
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/%22Ordinal-must-be-%3E%3D-1%22-with-SuplotHost-and-dates-tp24305444p27144728.html
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Verizon Developer Community
>> Take advantage of Verizon's best-in-class app development support
>> A streamlined, 14 day to market process makes app distribution fast and
>> easy
>> Join now and get one step closer to millions of Verizon customers
>> http://p.sf.net/sfu/verizon-dev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and
> easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/%22Ordinal-must-be-%3E%3D-1%22-with-SuplotHost-and-dates-tp24305444p28614682.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jeff W. <js...@fa...> - 2010年05月19日 21:33:44
On 5/19/10 3:24 PM, Mike Bauer wrote:
> Hello,
>
> I am hoping that there is a way to use matplotlib to process a sea 
> level pressure field and extract the closed contours therein so that I 
> have a collection of lists with the (lon,lat) pairs that define the 
> perimeter of each closed contour. At the very least I would like a 
> perimeter list of each contour closed or not.
>
> I'm guessing the answer might be something like this
> http://www.mail-archive.com/mat...@li.../msg07915.html
>
> Thank you for any ideas.
>
> Mike
Mike: Yep, that's a good place to start.
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Mike B. <mb...@gi...> - 2010年05月19日 21:28:35
Hello,
I am hoping that there is a way to use matplotlib to process a sea level
pressure field and extract the closed contours therein so that I have a
collection of lists with the (lon,lat) pairs that define the perimeter of
each closed contour. At the very least I would like a perimeter list of each
contour closed or not.
I'm guessing the answer might be something like this
http://www.mail-archive.com/mat...@li.../msg07915.html
Thank you for any ideas.
Mike
From: David G. <da...@we...> - 2010年05月19日 20:43:15
Well I was able to compile the "embedding_in_wx5.py" example
 ( I'm not sure why or how) but it works.
"embedding_in_wx2.py" still won't compile but I was able to compile my program 
and get it to run as expected.
I'll leave this as another unresolved mystery of programming...
My thanks to the Werner for being there and helping me work this out.
From: Eric F. <ef...@ha...> - 2010年05月19日 20:41:32
On 05/19/2010 10:28 AM, Benjamin Root wrote:
> Maybe I am misunderstanding your problem, but you can select 'semilog'
> for the x/yscale parameter.
You mean "symlog".
See 
http://matplotlib.sourceforge.net/examples/pylab_examples/symlog_demo.html
Although the example doesn't show it, the axis limits don't have to be 
symmetric. For example, on the top plot, you can use
gca().set_xlim([0, 100])
to show only the right-hand side.
Eric
>
> Ben Root
>
> On Wed, May 19, 2010 at 7:03 AM, Christer Malmberg
> <Chr...@st...
> <mailto:Chr...@st...>> wrote:
>
> Hi,
>
> my problem is that I need a graph with a discontinous y-axis. Let me
> explain the problem: in my field (microbiology) the data generated
> from for example growth assays have a huge range (10^0-10^9), which
> has to be plotted on a semilogy style plot (cell concentration vs.
> time). The problem is that 0 cells is a useful number to plot
> (indicates cell concentration lower than detection limit), but of
> course not possible to show in a log diagram. This is easily solved on
> old-style logarithmic graph paper; since the data will be either 0, or
> >1 it is customary just to draw a zero x-axis at 10^-1 on the paper
> and that's that. On the computer, this is extremely hard. Most people
> I know resort to various tricks in Excel, such as entering a small
> number (0.001 etc) and starting the y-axis range from 10^1 to hide the
> problem. This makes excel draw a line, instead of leaving out the dot
> and line entirely. The part of the curve below the x-axis is then
> manually cut off in a suitable image editor. Needless to say, this is
> extremely kludgy. Even professional graphing packages like Graphpad
> Prism resort to similar kludges (re-define 0 values to 0.1, change the
> y-axis tick label to "0" etc.) This problem of course exists in other
> fields, while investigating a solution I found a guy who worked with
> aerosol contamination in clean rooms, and he needed to plot values
> logarithmically, at the same time as showing detector noise around
> 1-10 particles. He solved it by the same trick I would like to do in
> Matplotlib, namely plotting a standard semilogy plot but with the
> 10^-1 to 10^0 decade being replaced by a 0-1 linear axis on the same
> side.
>
> The guy in this post has the same problem and a useful example:
> http://ubuntuforums.org/showthread.php?t=394851
>
> His partial solution is quite bad though, and I just got stuck while
> trying to improve it. I looked around the gallery for useful examples,
> and the closest I could find is the twinx/twiny function, but I didn't
> manage a plot that put one data curve across both axes.
>
> This code gives an image that maybe explains what I'm trying to do:
>
> =======================================
> t = array([0,1,2,4,6,9,12,24])
> y = array([1000000, 500000, 100000, 100, 5, 1, 0, 0])
> subplot(111, xscale="linear", yscale="log")
> errorbar(x, y, yerr=0.4*y)
> linbit = axes([0.125, 0.1, 0.775, 0.1],frameon=False)
> linbit.xaxis.set_visible(False)
> for tl in linbit.get_yticklabels():
> tl.set_color('r')
> show()
> =======================================
>
> (the y=0 points should be plotted and connected to the line in the
> log part)
>
> Is this possible to do in matplotlib? Could someone give me a pointer
> on how to go on?
>
> Sorry for the long mail,
>
> /C
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> ------------------------------------------------------------------------------
>
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Vlad D. <vdi...@Ge...> - 2010年05月19日 20:33:42
Colleagues,
I am trying to follow the http://matplotlib.sourceforge.net/users/pyplot_tutorial.html tutorial with little success. The very first import fails with either 64 or 32-bit python. Any hints I have missed?
$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/Library/Python/2.6/site-packages/matplotlib-0.99.1.1-py2.6-macosx-10.3-fat.egg/matplotlib/pyplot.py", line 6, in <module>
 from matplotlib.figure import Figure, figaspect
 File "/Library/Python/2.6/site-packages/matplotlib-0.99.1.1-py2.6-macosx-10.3-fat.egg/matplotlib/figure.py", line 16, in <module>
 import artist
 File "/Library/Python/2.6/site-packages/matplotlib-0.99.1.1-py2.6-macosx-10.3-fat.egg/matplotlib/artist.py", line 5, in <module>
 from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath
 File "/Library/Python/2.6/site-packages/matplotlib-0.99.1.1-py2.6-macosx-10.3-fat.egg/matplotlib/transforms.py", line 34, in <module>
 from matplotlib._path import affine_transform
ImportError: /Library/Python/2.6/site-packages/matplotlib-0.99.1.1-py2.6-macosx-10.3-fat.egg/matplotlib/_path.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
>>> exit()
$ defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
Bus error
$
Sincerely,
Vlad
This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
From: Benjamin R. <ben...@ou...> - 2010年05月19日 20:28:59
Maybe I am misunderstanding your problem, but you can select 'semilog' for
the x/yscale parameter.
Ben Root
On Wed, May 19, 2010 at 7:03 AM, Christer Malmberg <
Chr...@st...> wrote:
> Hi,
>
> my problem is that I need a graph with a discontinous y-axis. Let me
> explain the problem: in my field (microbiology) the data generated
> from for example growth assays have a huge range (10^0-10^9), which
> has to be plotted on a semilogy style plot (cell concentration vs.
> time). The problem is that 0 cells is a useful number to plot
> (indicates cell concentration lower than detection limit), but of
> course not possible to show in a log diagram. This is easily solved on
> old-style logarithmic graph paper; since the data will be either 0, or
> >1 it is customary just to draw a zero x-axis at 10^-1 on the paper
> and that's that. On the computer, this is extremely hard. Most people
> I know resort to various tricks in Excel, such as entering a small
> number (0.001 etc) and starting the y-axis range from 10^1 to hide the
> problem. This makes excel draw a line, instead of leaving out the dot
> and line entirely. The part of the curve below the x-axis is then
> manually cut off in a suitable image editor. Needless to say, this is
> extremely kludgy. Even professional graphing packages like Graphpad
> Prism resort to similar kludges (re-define 0 values to 0.1, change the
> y-axis tick label to "0" etc.) This problem of course exists in other
> fields, while investigating a solution I found a guy who worked with
> aerosol contamination in clean rooms, and he needed to plot values
> logarithmically, at the same time as showing detector noise around
> 1-10 particles. He solved it by the same trick I would like to do in
> Matplotlib, namely plotting a standard semilogy plot but with the
> 10^-1 to 10^0 decade being replaced by a 0-1 linear axis on the same
> side.
>
> The guy in this post has the same problem and a useful example:
> http://ubuntuforums.org/showthread.php?t=394851
>
> His partial solution is quite bad though, and I just got stuck while
> trying to improve it. I looked around the gallery for useful examples,
> and the closest I could find is the twinx/twiny function, but I didn't
> manage a plot that put one data curve across both axes.
>
> This code gives an image that maybe explains what I'm trying to do:
>
> =======================================
> t = array([0,1,2,4,6,9,12,24])
> y = array([1000000, 500000, 100000, 100, 5, 1, 0, 0])
> subplot(111, xscale="linear", yscale="log")
> errorbar(x, y, yerr=0.4*y)
> linbit = axes([0.125, 0.1, 0.775, 0.1],frameon=False)
> linbit.xaxis.set_visible(False)
> for tl in linbit.get_yticklabels():
> tl.set_color('r')
> show()
> =======================================
>
> (the y=0 points should be plotted and connected to the line in the log
> part)
>
> Is this possible to do in matplotlib? Could someone give me a pointer
> on how to go on?
>
> Sorry for the long mail,
>
> /C
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: David <Da...@we...> - 2010年05月19日 18:50:21
Werner F. Bruhin <werner.bruhin@...> writes:
> 
> 
> On 19/05/2010 19:55, David Grudoski wrote:
> 
> I'm trying to build an executable using
> PY2EXE; running Python 2.5.2 and wxPython 2.8.10.1 and MatplotLib 0.99.0
> I tried using the setup.py from the
> PY2EXE.org Matplotlib page and although everything compiles correctly
> and generates an executable.
> When I launch the executable I get the
> following error:
> ================================================
> "The application requires a version of
> wxPython greater than or equal to 2.8, but a matching version was not
> found."
> You currently have these version(s)
> installed.
> 
> ================================================
> 
> 
> I can compile an executable with PY2EXE and
> wxPython that works fine, but apparantly somethins in the setup for
> matplotlib is causing a problem.
> 
> Has anyone else seen this problem or know of
> a solution?
> 
> You need to patch matplotlib (backend_wx.py), see the bottom of this
> page:http://www.py2exe.org/index.cgi/MatPlotLib
> Werner
> 
> 
> ------------------------------------------------------------------------------
> 
> 
> 
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
Thanks for the reply Werner,
I decided to try and construct the executable from the site using the
"embedding_in_wx2.py" example. Again making sure the patch was in place on the
backend_wx.py I again ran the python setup.py py2exe and everything compiled.
Now when I run the exe it generate the following log file errors:
Traceback (most recent call last):
 File "embedding_in_wx2.py", line 21, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\backends\backend_wxagg.pyo", line 20, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\figure.pyo", line 19, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\axes.pyo", line 14, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\collections.pyo", line 21, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\backend_bases.pyo", line 32, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\widgets.pyo", line 12, in <module>
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\mlab.pyo", line 376, in <module>
TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'
From: Werner F. B. <wer...@fr...> - 2010年05月19日 18:03:51
On 19/05/2010 19:55, David Grudoski wrote:
> I'm trying to build an executable using PY2EXE; running Python 2.5.2 
> and wxPython 2.8.10.1 and MatplotLib 0.99.0
> I tried using the setup.py from the PY2EXE.org Matplotlib page and 
> although everything compiles correctly and generates an executable.
> When I launch the executable I get the following error:
> ================================================
> "The application requires a version of wxPython greater than or equal 
> to 2.8, but a matching version was not found."
> You currently have these version(s) installed.
> ================================================
>
> I can compile an executable with PY2EXE and wxPython that works fine, 
> but apparantly somethins in the setup for matplotlib is causing a problem.
>
> Has anyone else seen this problem or know of a solution?
You need to patch matplotlib (backend_wx.py), see the bottom of this page:
http://www.py2exe.org/index.cgi/MatPlotLib
Werner
From: David G. <Da...@we...> - 2010年05月19日 17:56:03
I'm trying to build an executable using PY2EXE; running Python 2.5.2 
and wxPython 2.8.10.1 and MatplotLib 0.99.0
I tried using the setup.py from the PY2EXE.org Matplotlib page and 
although everything compiles correctly and generates an executable.
When I launch the executable I get the following error:
================================================
"The application requires a version of wxPython greater than or equal 
to 2.8, but a matching version was not found."
You currently have these version(s) installed.
================================================
I can compile an executable with PY2EXE and wxPython that works fine, 
but apparantly somethins in the setup for matplotlib is causing a 
problem.
Has anyone else seen this problem or know of a solution?
Thanks
David
(setup.py is attached)

From: Omer K. <Ome...@ce...> - 2010年05月19日 15:56:45
Hi,
I am a wondering if it's possible to have few line distinguishing marks on
the data lines on a chart such as circle, start, square. When I use some
thing like this for the color of the graph (i.e. rs, k^), it uses the shape
for each data point and the lines becomes very thick. All I want is to put
4-5 shaper markers on each line with line (the data line will have few
hundred data points).
Many thanks,
Omer
From: Jae-Joon L. <lee...@gm...> - 2010年05月19日 15:23:11
The functionality of the gridspec is now merged into the matplotlib.
The updated documentation can be found in
http://matplotlib.sourceforge.net/trunk-docs/users/gridspec.html
Regards,
-JJ
On Tue, May 11, 2010 at 11:57 AM, Jae-Joon Lee <lee...@gm...> wrote:
> Hi,
>
> gridspec is a module that implements matplotlib’s Subplot slightly
> differently. Current matplotlib’s Subplot only allows a Subplot to
> occupy a single cell of the n x m grid. gridspec enables a Subplot to
> occupy multiple cells.
>
> http://leejjoon.github.com/mpl_toolkits-gridspec/
>
> The code is hosted in the github repo
>
> http://github.com/leejjoon/mpl_toolkits-gridspec
>
> and the source can be downloaded from
>
> http://github.com/leejjoon/mpl_toolkits-gridspec/downloads
>
> This is motivated from the discussion in the mailing list a while ago.
>
> http://sourceforge.net/mailarchive/message.php?msg_id=4A0DA94E.1040500%40american.edu
>
> I originally prepared this as a patch for matplotlib
> (http://article.gmane.org/gmane.comp.python.matplotlib.general/19097),
> but never committed. Instead, it is packaged as a mpl_tookit module.
>
> Regards,
>
> -JJ
>
From: hettling <het...@fe...> - 2010年05月19日 12:31:12
Thanks for the suggestions, 'annotate' is what I need, I think.
I get errors though, also when I run the example scripts 
from here: 
http://matplotlib.sourceforge.net/trunk-docs/users/annotations_guide.html#using-complex-coordinate-with-annotation .
I get the error 'NoneType' object is not iterable when I try plt.show()
or try to save to eps.
So I am not sure if I have the correct version of matplotlib installed.
I checked out the newest matplotlib from the svn repository, removed my
current installed version and installed the version in the 'trunk/'
directory. 'annotate' did not work.
Later, I installed matplotlib from the '/branches/v0_99_maint'
directory. 
In both cases there were no errors in the installation, but still
'annotate' did not work.
Could it be that I have the wrong library from the svn repository
installed? Does r8319 mean release #8319? 
Kind Regards
Hannes
On Tue, 2010年05月18日 at 13:34 -0400, Jae-Joon Lee wrote:
> This can be done relatively easily with the current svn version of
> matplotlib (r8319).
> Below is the modified version of your code.
> 
> See
> 
>
http://matplotlib.sourceforge.net/trunk-docs/users/annotations_guide.html#using-complex-coordinate-with-annotation
> 
> for how the annotation works.
> 
> While this is certainly possible with the released version, but it
> will require you to write a few tens of lines of code. Basically, you
> need create a custom Text class that update its position during the
> drawing time.
> 
> Regards,
> 
> -JJ
> 
> ###Code
> import scipy
> import matplotlib.pyplot as plt
> 
> fig = plt.figure()
> ax = fig.add_subplot(121)
> plt.plot(scipy.sin(scipy.arange(1,100, 0.001)))
> plt.xlabel('xlabel')
> yl = plt.ylabel("ylabel")
> 
> plt.annotate("A", (0,1.), xycoords=(yl, "axes fraction"),
> xytext=(0, 14), textcoords="offset points",
> fontsize=14)
> 
> ax = fig.add_subplot(122)
> plt.plot(scipy.cos(scipy.arange(1,100, 0.001)))
> plt.xlabel('xlabel')
> 
> my_ticklabel = ax.get_yticklabels()[-2]
> # Note that there is no guarantee that all ticklabels are drawn.
> plt.annotate("B", (0,1.), xycoords=(my_ticklabel, "axes fraction"),
> xytext=(0, 14), textcoords="offset points",
> fontsize=14)
> 
> ###End Code
> 
> 
> On Mon, May 17, 2010 at 11:08 AM, hettling <het...@fe...> wrote:
> > Dear all,
> >
> > I'm struggling with the following problem plotting my data:
> >
> > I have a figure with two panels next to each other, which I want to
> > label 'A' and 'B'. I want to left-justify my panel labels, but not
to
> > the box that contains the plot, but to the y-axis label. I played
around
> > with 'text()' and 'title()', but did not find a good solution except
for
> > giving the coordinates manually to 'text()'. This would be very
> > inconvenient though, because I have many different plots on
different
> > scales.
> > Here is what I tried:
> >
> > ###Code
> > import scipy
> > import matplotlib.pyplot as plt
> >
> > fig = plt.figure()
> > ax = fig.add_subplot(121)
> > plt.plot(scipy.sin(scipy.arange(1,100, 0.001)))
> > plt.xlabel('xlabel')
> > plt.ylabel("ylabel")
> > plt.text(0,1,"A", fontsize=14, transform=ax.transAxes)
> >
> > ax = fig.add_subplot(122)
> > plt.plot(scipy.cos(scipy.arange(1,100, 0.001)))
> > plt.text(0,1,"B", fontsize=14, transform=ax.transAxes)
> > plt.xlabel('xlabel')
> > ###End Code
> >
> > So the texts 'A' and 'B' should be a little bit higher and more to
the
> > left. The 'A' I want to align with the y-axis label of the left
plot,
> > the 'B' with the values of the y-axis of the right plot.
> >
> > I hope my question is clear, I will appreciate any help!
> >
> > Thanks in advance,
> >
> > Hannes
> >
> >
> >
------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
From: Christer M. <Chr...@st...> - 2010年05月19日 12:23:31
Hi,
my problem is that I need a graph with a discontinous y-axis. Let me 
explain the problem: in my field (microbiology) the data generated 
from for example growth assays have a huge range (10^0-10^9), which 
has to be plotted on a semilogy style plot (cell concentration vs. 
time). The problem is that 0 cells is a useful number to plot 
(indicates cell concentration lower than detection limit), but of 
course not possible to show in a log diagram. This is easily solved on 
old-style logarithmic graph paper; since the data will be either 0, or 
 >1 it is customary just to draw a zero x-axis at 10^-1 on the paper 
and that's that. On the computer, this is extremely hard. Most people 
I know resort to various tricks in Excel, such as entering a small 
number (0.001 etc) and starting the y-axis range from 10^1 to hide the 
problem. This makes excel draw a line, instead of leaving out the dot 
and line entirely. The part of the curve below the x-axis is then 
manually cut off in a suitable image editor. Needless to say, this is 
extremely kludgy. Even professional graphing packages like Graphpad 
Prism resort to similar kludges (re-define 0 values to 0.1, change the 
y-axis tick label to "0" etc.) This problem of course exists in other 
fields, while investigating a solution I found a guy who worked with 
aerosol contamination in clean rooms, and he needed to plot values 
logarithmically, at the same time as showing detector noise around 
1-10 particles. He solved it by the same trick I would like to do in 
Matplotlib, namely plotting a standard semilogy plot but with the 
10^-1 to 10^0 decade being replaced by a 0-1 linear axis on the same 
side.
The guy in this post has the same problem and a useful example:
http://ubuntuforums.org/showthread.php?t=394851
His partial solution is quite bad though, and I just got stuck while 
trying to improve it. I looked around the gallery for useful examples, 
and the closest I could find is the twinx/twiny function, but I didn't 
manage a plot that put one data curve across both axes.
This code gives an image that maybe explains what I'm trying to do:
=======================================
t = array([0,1,2,4,6,9,12,24])
y = array([1000000, 500000, 100000, 100, 5, 1, 0, 0])
subplot(111, xscale="linear", yscale="log")
errorbar(x, y, yerr=0.4*y)
linbit = axes([0.125, 0.1, 0.775, 0.1],frameon=False)
linbit.xaxis.set_visible(False)
for tl in linbit.get_yticklabels():
 tl.set_color('r')
show()
=======================================
(the y=0 points should be plotted and connected to the line in the log part)
Is this possible to do in matplotlib? Could someone give me a pointer 
on how to go on?
Sorry for the long mail,
/C
From: Werner F. B. <wer...@fr...> - 2010年05月19日 09:28:11
On 19/05/2010 01:17, New2Python wrote:
> Thanks, I changed the matplotlibrc file to use the WXAgg backend and then had
> to copy the file into the mpl.get_configdir() and in my local working dir
> for it to work.
>
> The file runs however a python error screen pops up and then closes without
> giving me the chance to read it, anybody know how to stop the window from
> closing so quickly
> 
You have probably set "wx.App(redirect=True)", change to "False" and 
then you should see the exception in your IDE.
Werner

Showing 15 results of 15

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





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

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

More information about our ad policies

Ad destination/click URL:

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