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




Showing results of 312

<< < 1 .. 9 10 11 12 13 > >> (Page 11 of 13)
From: Scott S. <sco...@gm...> - 2010年11月05日 12:05:31
On 5 November 2010 13:33, Daniele Nicolodi <da...@gr...> wrote:
> I would like to plot an x, y, z table so that each region of the plot
> area defined by the coordinates (x, y) corresponds a color given by the
> value of z. I suppose this is a kind of basic functionality, but I'm
> unable to find the right function into matplotlib API.
You probably want imshow, pcolor, pcolormash or matshow
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.imshow
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.pcolor
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.pcolormesh
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.matshow
There's a basic example of using imshow here:
http://matplotlib.sourceforge.net/examples/pylab_examples/image_demo.html
Cheers,
Scott
From: John <was...@gm...> - 2010年11月05日 11:34:16
Clever folks,
Is there an algorithm, or known method to extract a subset of one grid
to match another. I have two grids, one nested, the other global. In
general they are regular lat/lon grids. Also, in general they are 0.5
degree lat/lon. However, I would like to make this as general as
possible.
What I am trying to accomplish is the following:
A) to have a function where I pass the two grids and meta data about
the grids (lon0, lat0, dx, numx, dy, numy, etc). Then, a subsection of
the global grid is returned that matches the nested grid.
B) in a more general case, I may have to define a regrid function so
that the subset of the global grid could match the nested grid.
Suggestions?
From: Daniele N. <da...@gr...> - 2010年11月05日 11:34:04
Hello, I have a really dummy question.
I would like to plot an x, y, z table so that each region of the plot
area defined by the coordinates (x, y) corresponds a color given by the
value of z. I suppose this is a kind of basic functionality, but I'm
unable to find the right function into matplotlib API.
Thank you. Cheers,
-- 
Daniele
From: Basedow S. L. <sun...@ui...> - 2010年11月05日 11:22:50
Hi!
I try to plot some interpolated data on a map and get an error saying
there are too many indices. When I use contour in matplotlib without
basemap I don't get the error. Also the map without a contour plot on it
works. Maybe some of you know what I do wrong?
Here is my code:
-------------
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import griddata
from mpl_toolkits.basemap import Basemap
 
yi = np.linspace(min(Lat),max(Lat),100)
xi = np.linspace(min(Lon),max(Lon),50)
lon,lat,var = np.array(Lon), np.array(Lat), np.array(Var)
zi = griddata(lon,lat,var,xi,yi)
map = Basemap(projection='cyl', llcrnrlat=67, urcrnrlat=73,\
 llcrnrlon=4, urcrnrlon=20, resolution='h')
 
map.drawcoastlines()
map.drawmeridians(np.arange(0,360,1))
map.drawparallels(np.arange(-90,90,1))
xlon, ylat = map(xi,yi)
cs = map.contour(xlon,ylat,zi)
plt.show()
---------------
and this is the error message:
cs = map.contour(xlon,ylat,zi)
File
"/usr/local/lib/python2.6/dist-packages/mpl_toolkits/basemap/__init__.py",
line 2820, in contour
 xx = x[x.shape[0]/2,:]
IndexError: too many indices
Any help appreciated!
Sünnje
From: Christopher B. <Chr...@no...> - 2010年11月04日 21:42:36
On 11/4/10 2:29 PM, John Hunter wrote:
> I added a new section of the docs users/recipes.rst. This is meant to
> be a cookbook style place to place short tutorials, annotated
> examples, idioms and snippets.
>
> http://matplotlib.sourceforge.net/users/recipes.html
Nice!
Once you get past twenty or so of these, it would be nice to have them 
categorized -- is that possible with the current system?
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: John H. <jd...@gm...> - 2010年11月04日 21:29:58
I added a new section of the docs users/recipes.rst. This is meant to
be a cookbook style place to place short tutorials, annotated
examples, idioms and snippets.
 http://matplotlib.sourceforge.net/users/recipes.html
I've added a few things already and would love to see contributions
from users and developers, which you can submit as a svn diff
 http://matplotlib.sourceforge.net/faq/howto_faq.html#contribute-to-matplotlib-documentation
JDH
From: Elizabeth Y. D. <ely...@gm...> - 2010年11月04日 19:41:27
Thanks !
matplotlib (import pylab) works in the sage notebook (
http://www.sagemath.org/ )on my machine. The sage installation compiles
everything from source!!
We are actually thinking of abandoning SUSE (after 5 years) and switch to
ubuntu !
Thanks again!
Elizabeth
On Thu, Nov 4, 2010 at 10:13 AM, John Hunter <jd...@gm...> wrote:
> On Thu, Nov 4, 2010 at 12:06 PM, Elizabeth Yip Dembart
> <ely...@gm...> wrote:
> > Thanks !!
> >
> > Here is the output from the python section you suggested:
> >
> > /sampledoc> python
> > Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)
> > [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import numpy as np
> >>>> print np.__file__
> > /usr/lib64/python2.6/site-packages/numpy/__init__.pyc
> >>>> print np.__version__
> > 1.2.1
> >>>> import matplotlib as mpl
> >>>> print mpl.__file__
> > /usr/lib64/python2.6/site-packages/matplotlib/__init__.pyc
> >>>> print mpl.__version__
> > 1.0.0
> >>>>
>
> Well, they are both coming from the same place so it looks like the
> SUSE build of each. But the numpy version is quite old. Looks like
> it may be an OPENSUSE bug
>
>
> http://forums.opensuse.org/english/development/programming-scripting/416182-python-matplolib.html
>
> You could consider building matplotlib from source.
>
> http://matplotlib.sourceforge.net/users/installing.html
> http://matplotlib.sourceforge.net/faq/installing_faq.html#source-install
>
> http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
>
> or upgrading your linux distribution (ubuntu 10.10 is nice)
>
> JDH
>
From: Justin M. <jn...@gm...> - 2010年11月04日 17:59:09
On Wed, Nov 3, 2010 at 1:18 AM, David Frey <dp...@sh...> wrote:
> ...
> My data in the y-axis (address space usage) is fairly uniform (0-2000 MB
> values), but my data in the x-axis (the time at which the the trace statements
> were executed) is highly clustered. For example, I have approximately 150
> data points over a 5 minute run, but some of the data points are only 10ms
> apart.
>
> I would like to annotate each point on the graph with the line number in the
> log file so that the user can look up what was happening at that point. I have
> succeeded, but the graph isn't readable because there is so much overlap in
> the points.
You might want to create multiple subplots, with some of the
subplots/axes zoomed in on the main axes. See this example:
 http://matplotlib.sourceforge.net/examples/pylab_examples/axes_zoom_effect.html
It looks like the image isn't on the website. You can run the example
on your local machine by saving it from the [source code] link at the
top of the page.
That seems to work well if you know in advance how many zoom areas you
want, or are working with it interactively.
If you want to auto-generate the whole figure, you might want to try
something like this:
 - figure out how many zoom regions you need (e.g., by figuring out
how many clusters you have)
 - use figure.add_subplot() or axes_grid1
(http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html)
to place all of your separate axes
 - plot the main figure and all of the zoom regions
BTW, if the "axes_zoom_effect" image could be added to the gallery,
it's the example I was thinking about in the "Vlines across multiple
subplots" thread:
 http://permalink.gmane.org/gmane.comp.python.matplotlib.general/24999
Hope that helps,
 Justin
From: John H. <jd...@gm...> - 2010年11月04日 17:13:32
On Thu, Nov 4, 2010 at 12:06 PM, Elizabeth Yip Dembart
<ely...@gm...> wrote:
> Thanks !!
>
> Here is the output from the python section you suggested:
>
> /sampledoc> python
> Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)
> [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import numpy as np
>>>> print np.__file__
> /usr/lib64/python2.6/site-packages/numpy/__init__.pyc
>>>> print np.__version__
> 1.2.1
>>>> import matplotlib as mpl
>>>> print mpl.__file__
> /usr/lib64/python2.6/site-packages/matplotlib/__init__.pyc
>>>> print mpl.__version__
> 1.0.0
>>>>
Well, they are both coming from the same place so it looks like the
SUSE build of each. But the numpy version is quite old. Looks like
it may be an OPENSUSE bug
http://forums.opensuse.org/english/development/programming-scripting/416182-python-matplolib.html
You could consider building matplotlib from source.
 http://matplotlib.sourceforge.net/users/installing.html
 http://matplotlib.sourceforge.net/faq/installing_faq.html#source-install
 http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
or upgrading your linux distribution (ubuntu 10.10 is nice)
JDH
From: Elizabeth Y. D. <ely...@gm...> - 2010年11月04日 17:06:41
Thanks !!
Here is the output from the python section you suggested:
/sampledoc> python
Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> print np.__file__
/usr/lib64/python2.6/site-packages/numpy/__init__.pyc
>>> print np.__version__
1.2.1
>>> import matplotlib as mpl
>>> print mpl.__file__
/usr/lib64/python2.6/site-packages/matplotlib/__init__.pyc
>>> print mpl.__version__
1.0.0
>>>
Elizabeth
On Thu, Nov 4, 2010 at 9:53 AM, John Hunter <jd...@gm...> wrote:
> On Thu, Nov 4, 2010 at 11:43 AM, Elizabeth Yip Dembart
> <ely...@gm...> wrote:
> > Thank you for the prompt response.
> > I cannot run matplotlib directly. It crashes as I tried to import
> > matplotlib.pyplot:
> >
> > sphinx/sampledoc> python
> > Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)
> > [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import matplotlib.pyplot as plt
> > Segmentation fault (core dumped)
> >
> > What do you mean by the Agg backend?
>
> This is our core rendering engine -- see
> http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
>
> The problem you are experiencing has nothing to do with sphinx or the
> sphinx extensions, but is in your matplotlib installation. It may be
> a SUSE bug, or you may be getting conflicting installs from the stuff
> you are getting from SUSE and the stuff you are easy installing.
> First thing to do is start nailing down what you are getting and where
> you are getting it from. Paste these commands into your python shell
> and report the output
>
> import numpy as np
> print np.__file__
> print np.__version__
>
> import matplotlib as mpl
> print mpl.__file__
> print mpl.__version__
>
> A likely culprit is that you have an mpl compiled against one version
> of numpy and you are dynamically linking against another that is not
> ABI compliant.
>
> JDH
>
From: Philip S. <ph...@se...> - 2010年11月04日 17:03:54
Hi all,
I've run into an aspect of matplotlib's setup that seems awkward. I'm seeing this on Ubuntu, but I imagine it would happen on any *nix platform.
If python is running under sudo the first time matplotlib is imported, then matplotlib creates its config dir (~/.matplotlib) with root as the owner. Subsequent attempts to import matplotlib while running python as a non-privileged user result in this:
-----------------------------------------------------------------
RuntimeError: '/home/philip' is not a writable dir; you must set /home/philip/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored 
-----------------------------------------------------------------
A simple way to re-create this -- 
1. Delete or rename ~/.matplotlib
2. sudo python -c "import matplotlib"
3. python -c "import matplotlib"
This not-improbable real-world scenario would create ~/.matplotlib owned by root --
1) Download app FooBar that has matplotlib as a dependency
2) Install matplotlib
3) Run FooBar's setup.py as sudo. It imports matplotlib, perhaps just to ensure that matplotlib is installed and working.
We ran into a similar situation with our app ('sudo python setup.py install' created desktop icons owned by root) and we resolved it by invoking chown after using a getenv() call to sniff out who we really wanted to own the file. 
It looks like the diff below (untested!) applied to lib/matplotlib/__init__.py would prevent this from happening. Does it seems reasonable to add it?
474a475,485
> if not sys.platform.lower().startswith("win"):
> # Ensure that we didn't just create a root-owned directory in the 
> # user's HOME directory. That happens if this is being run under 
> # sudo. If the SUDO_USER env. var (which contains the user that 
> # invoked sudo) then we're running under sudo. If it doesn't 
> # exist, we're not running under sudo.
> current_user = os.getenv("SUDO_USER")
> if current_user:
> subprocess.call(["chown", "-R", current_user, p])
Thanks
Philip
From: John H. <jd...@gm...> - 2010年11月04日 16:53:35
On Thu, Nov 4, 2010 at 11:43 AM, Elizabeth Yip Dembart
<ely...@gm...> wrote:
> Thank you for the prompt response.
> I cannot run matplotlib directly. It crashes as I tried to import
> matplotlib.pyplot:
>
> sphinx/sampledoc> python
> Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)
> [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import matplotlib.pyplot as plt
> Segmentation fault (core dumped)
>
> What do you mean by the Agg backend?
This is our core rendering engine -- see
http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
The problem you are experiencing has nothing to do with sphinx or the
sphinx extensions, but is in your matplotlib installation. It may be
a SUSE bug, or you may be getting conflicting installs from the stuff
you are getting from SUSE and the stuff you are easy installing.
First thing to do is start nailing down what you are getting and where
you are getting it from. Paste these commands into your python shell
and report the output
import numpy as np
print np.__file__
print np.__version__
import matplotlib as mpl
print mpl.__file__
print mpl.__version__
A likely culprit is that you have an mpl compiled against one version
of numpy and you are dynamically linking against another that is not
ABI compliant.
JDH
From: Nikolaus R. <Nik...@ra...> - 2010年11月04日 16:22:54
"Stan West" <sta...@pu...> writes:
>> From: Nikolaus Rath [mailto:Nik...@pu...] 
>> Sent: Tuesday, November 02, 2010 21:38
>> 
>> In [16]: matplotlib.__version__
>> Out[16]: '1.0.0'
>> 
>> I attached the result of fig.savefig(). Let's see if it makes 
>> it through
>> the list.
>
> The bug in question was fixed at revision 8652, after 1.0.0 was released. The
> distinction between the x and y axes in your case is because the y axis is
> inverted.
>
> You can work around the bug by avoiding the Axes.set_xticks() and set_yticks()
>
[...]
> I hope that helps.
It does, thanks!
 -Nikolaus
-- 
 »Time flies like an arrow, fruit flies like a Banana.«
 PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
From: Stan W. <sta...@nr...> - 2010年11月04日 14:57:16
> From: Nikolaus Rath [mailto:Nik...@ra...] 
> Sent: Tuesday, November 02, 2010 21:38
> 
> In [16]: matplotlib.__version__
> Out[16]: '1.0.0'
> 
> I attached the result of fig.savefig(). Let's see if it makes 
> it through
> the list.
The bug in question was fixed at revision 8652, after 1.0.0 was released. The
distinction between the x and y axes in your case is because the y axis is
inverted.
You can work around the bug by avoiding the Axes.set_xticks() and set_yticks()
methods and instead setting the tick locator and formatter [1] for each axis.
(That's what set_xticks and set_yticks do, in addition to other conveniences
wherein the bug lies.) This would look something like:
 import matplotlib.ticker as mticker
 
 # (Plot here.)
 tick_locs = 2 * np.arange(len(modes)) + 0.5
 tick_labels = ['%d/%d' % (x[1], x[0]) for x in modes]
 for axis in (ax.xaxis, ax.yaxis):
 axis.set_major_locator(mticker.FixedLocator(tick_locs))
 axis.set_major_formatter(mticker.FixedFormatter(tick_labels))
Separately, because you're ticking on the element boundaries instead of
centers, you might consider passing a custom extent to matshow, as in
 N = 5
 res = np.diag(np.arange(2 * N))
 modes = [ (x+1, 0) for x in range(N) ]
 cs = ax.matshow(res, extent=[-0.5, N - 0.5, N - 0.5, -0.5])
Then you can simply tick on the integers, using
 tick_locs = np.arange(N)
I hope that helps.
[1] http://matplotlib.sourceforge.net/api/ticker_api.html
From: Michael D. <md...@st...> - 2010年11月04日 12:53:18
 On 11/04/2010 01:46 AM, Elizabeth Yip Dembart wrote:
> Hi
>
> I was going through the sampledoc tutorial in 
> http://matplotlib.sourceforge.net/sampledoc/.
>
> When I came to "Sphinx extensions for embedded plots ... ", 
> sphinx-build crashes when "matplotlib.sphinx.mathmpl" ... were added 
> to the extensions section of conf.py.
>
> I noticed a similar problem was reported on this mailing list March 
> 23, 2010.
>
> I am running OPENSUSE 11.1 on a x86-64 computer, and my python is 
> version 2.6. I reinstalled the latest matplotlib, 
> "python-matplotlib -1.0.0-5.1.x86_64.rpm" from the opensuse 
> repository: 
> http://download.opensuse.org/repositories/science/openSUSE_11.1/x86_64. 
> I also installed the latest sphinx with "easy-install -U Sphinx".
>
> When I run 'make html', here is what happened:
> sphinx/sampledoc> make html
> sphinx-build -b html -d _build/doctrees . _build/html
> Making output directory...
> Running Sphinx v1.0.4
> make: *** [html] Segmentation fault (core dumped)
>
> I attached my conf.py and I uploaded the coredump (core.bz2) at:
> http://sites.google.com/site/mislwagroup/coredumps-1
Are you able to generate matplotlib plots directly -- in particular 
using the Agg backend?
Unfortunately, this coredump file isn't useful unless we have the exact 
same binaries as you.
Can you instead run this inside of gdb and get a traceback?
To get this, you will do something like (from the doc directory):
 > gdb python
(gdb) run /usr/bin/sphinx-build -b html -d _build/doctrees . _build/html
... it runs for a while and then crashes ...
(gdb) bt
Mike
From: Anita G. <ani...@gm...> - 2010年11月04日 07:43:09
Hi,
Thanks for your answer! I really appreciate it. Are there any examples of ProjectFigure classes out there from which I could learn how to implement such a functionality?
Best wishes,
Anita
-------- Original-Nachricht --------
> Datum: Wed, 3 Nov 2010 17:04:54 -0700
> Von: Chloe Lewis <ch...@be...>
> An: Anita Graser <ani...@gm...>
> Betreff: Re: [Matplotlib-users] save figure object
> Hi;
> 
> I don't think so, though I'm no expert. A common thing to do, with 
> other good side-effects, is to set up your data in a systematic way 
> and write ProjectFigure classes that easily deal with your data; then 
> pickle the data and make a figure with ProjectFigure when you un- 
> pickle it. That 'live' figure can be tweaked before you save an image, 
> or perhaps you can improve the whole ProjectFigure class. (Other 
> niceties: decide how you want to do print, onscreen, overhead images, 
> and switch fonts and weights and sizes in the custom Figure class; etc.)
> 
> Not the same as Matlab, though.
> 
> &C
> 
> 
> On Nov 3, 2010, at 3 Nov, 7:31 AM, Anita Graser wrote:
> 
> > Hi,
> >
> > I'm looking for a way to save Matplotlib figure objects the way 
> > Matlab can do it. I found the same request from 2008:
> >
> >
> http://sourceforge.net/mailarchive/forum.php?thread_name=48D02DF2.2020401%40lanl.gov&forum_name=matplotlib-users
> >
> > The answer basically was "There is currently no easy way".
> >
> > Has the status changed since 2008?
> >
> > Best wishes,
> > Anita
> > -- 
> > GMX DSL Doppel-Flat ab 19,99 &euro;/mtl.! Jetzt auch mit
> > gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
> >
> >
> ------------------------------------------------------------------------------
> > Achieve Improved Network Security with IP and DNS Reputation.
> > Defend against bad network traffic, including botnets, malware,
> > phishing sites, and compromised hosts - saving your company time,
> > money, and embarrassment. Learn More!
> > http://p.sf.net/sfu/hpdev2dev-nov
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> Chloe Lewis
> Ecosystem Sciences, Policy and Management, UC Berkeley
> 137 Mulford Hall
> Berkeley, CA 94720-3114
> http://nature.berkeley.edu/~chlewis
> 
> 
> 
> 
> 
> 
> 
> 
-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser
From: Elizabeth Y. D. <ely...@gm...> - 2010年11月04日 05:46:52
Attachments: conf.py
Hi
I was going through the sampledoc tutorial in
http://matplotlib.sourceforge.net/sampledoc/.
When I came to "Sphinx extensions for embedded plots ... ", sphinx-build
crashes when "matplotlib.sphinx.mathmpl" ... were added to the extensions
section of conf.py.
I noticed a similar problem was reported on this mailing list March 23,
2010.
I am running OPENSUSE 11.1 on a x86-64 computer, and my python is version
2.6. I reinstalled the latest matplotlib, "python-matplotlib
-1.0.0-5.1.x86_64.rpm" from the opensuse repository:
http://download.opensuse.org/repositories/science/openSUSE_11.1/x86_64. I
also installed the latest sphinx with "easy-install -U Sphinx".
When I run 'make html', here is what happened:
sphinx/sampledoc> make html
sphinx-build -b html -d _build/doctrees . _build/html
Making output directory...
Running Sphinx v1.0.4
make: *** [html] Segmentation fault (core dumped)
I attached my conf.py and I uploaded the coredump (core.bz2) at:
http://sites.google.com/site/mislwagroup/coredumps-1
Thank you for your help!
Elizabeth
From: John <was...@gm...> - 2010年11月03日 21:41:18
log Y axis?
On Wed, Nov 3, 2010 at 6:18 AM, David Frey <dp...@sh...> wrote:
> I am trying to use matplotlib (for the first time) to graph the address space
> usage of an application against time. The data is written to a log file by
> trace statements throughout the source code of the application. The trace
> statements contain the current address space usage as well as a timer value
> with millisecond granularity.
>
> My data in the y-axis (address space usage) is fairly uniform (0-2000 MB
> values), but my data in the x-axis (the time at which the the trace statements
> were executed) is highly clustered. For example, I have approximately 150
> data points over a 5 minute run, but some of the data points are only 10ms
> apart.
>
> I would like to annotate each point on the graph with the line number in the
> log file so that the user can look up what was happening at that point. I have
> succeeded, but the graph isn't readable because there is so much overlap in
> the points.
>
> Is there a standard way that people display data like this? I don't really
> like the idea of equally spacing all of the points along the x-axis because
> you lose the understanding of the timing. One idea I had was to have some
> sort of vertical break in the graph at areas where there was a long gap
> without a data point, but I have no idea whether it's possible to implement
> something like that in matplotlib.
>
> The output format hasn't been strictly specified, so if you have any ideas of
> how I can produce a useful graph, I would be happy to hear them.
>
> Thanks,
> Dave
>
> ------------------------------------------------------------------------------
> Achieve Improved Network Security with IP and DNS Reputation.
> Defend against bad network traffic, including botnets, malware,
> phishing sites, and compromised hosts - saving your company time,
> money, and embarrassment.  Learn More!
> http://p.sf.net/sfu/hpdev2dev-nov
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Configuration
``````````````````````````
Plone 2.5.3-final,
CMF-1.6.4,
Zope (Zope 2.9.7-final, python 2.4.4, linux2),
Python 2.6
PIL 1.1.6
Mailman 2.1.9
Postfix 2.4.5
Procmail v3.22 2001年09月10日
Basemap: 1.0
Matplotlib: 1.0.0
From: Eric F. <ef...@ha...> - 2010年11月03日 19:33:54
On 11/03/2010 09:01 AM, jgamble wrote:
>
> Hi all,
>
> I'm trying to visualize some data using countourf in pyplot, and I am having
> a bit of trouble. For some reason, the y axis does not scale properly, and
> an ugly white bar appears where there are no pixels to plot (see
> screenshot). Ideally, I would like the axes to scale so that there is no
> white space. The script I am using is:
>
> q=1.60219e-19
> kGrid = linspace(0.01,25e7,100)
> epsGrid = linspace(1e-10*q,0.13e-3*q,100)
> X,Y = meshgrid(kGrid,epsGrid)
> Z = abs(integrand(X,Y))
> CS = plt.contourf(X,Y/q/1000,Z,100,cmap=cm.PRGn)
Try following this with
plt.axis('tight')
Eric
>
> Here, "integrand" is just some function that generates z values. I imagine
> that it is something with aspect ratios or scaling, but I haven't been able
> to figure it out from reading posts, so I would greatly appreciate some
> guidance!
>
> Many thanks,
> John
>
> http://old.nabble.com/file/p30120592/Screen%2Bshot%2B2010-11-03%2Bat%2B2.56.03%2BAM.png
From: jgamble <joh...@gm...> - 2010年11月03日 19:01:52
Hi all,
I'm trying to visualize some data using countourf in pyplot, and I am having
a bit of trouble. For some reason, the y axis does not scale properly, and
an ugly white bar appears where there are no pixels to plot (see
screenshot). Ideally, I would like the axes to scale so that there is no
white space. The script I am using is:
q=1.60219e-19
kGrid = linspace(0.01,25e7,100)
epsGrid = linspace(1e-10*q,0.13e-3*q,100)
X,Y = meshgrid(kGrid,epsGrid)
Z = abs(integrand(X,Y))
CS = plt.contourf(X,Y/q/1000,Z,100,cmap=cm.PRGn)
Here, "integrand" is just some function that generates z values. I imagine
that it is something with aspect ratios or scaling, but I haven't been able
to figure it out from reading posts, so I would greatly appreciate some
guidance!
Many thanks,
John
http://old.nabble.com/file/p30120592/Screen%2Bshot%2B2010-11-03%2Bat%2B2.56.03%2BAM.png 
-- 
View this message in context: http://old.nabble.com/Unsightly-white-space-in-contour-plots-tp30120592p30120592.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Johan G. <joh...@gm...> - 2010年11月03日 18:54:49
2010年11月03日 19:26, Marcin Krol skrev:
> matplotlib:
> field.setCheckState(Qt.Checked if value else Qt.Unchecked)
> ^
> SyntaxError: invalid syntax
>
The code above is a conditional expression, and those are mentioned [0] 
on the "what's new in python 2.5"-page, so I would guess that line is 
invalid in python 2.4, that you use.
I would replace it by
if value:
 field.setCheckState(Qt.Checked)
else:
 field.setCheckedState(Qt.Unchecked)
and see if that particular error goes away.
There could of course be many similar issues, but I see that the system 
requirements lists python 2.4 or newer as required [1], so perhaps those 
constructs are often avoided.
In any case, if my guesses are correct, I would consider using the 
conditional expression in matplotlib as a bug, given that python 2.4 is 
mentioned in the requirements.
Regards
Johan
[0]: http://docs.python.org/whatsnew/2.5.html
[1]: http://matplotlib.sourceforge.net/users/installing.html
From: Marcin K. <mr...@gm...> - 2010年11月03日 18:27:03
Hello,
I've installed 1.0.0 on Python 2.4 (Debian Etch) and am getting just this:
Python 2.4.4 (#2, Jan 24 2010, 11:19:18)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import matplotlib.pyplot as plt
Illegal instruction
I've had some build problems with numpy 1.1 and matplotlib:
numpy:
Installed 
/usr/lib/python2.4/site-packages/numpy-1.5.1rc1-py2.4-linux-i686.egg
Processing dependencies for numpy
Finished processing dependencies for numpy
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
 File "atexit.py", line 24, in _run_exitfuncs
 func(*targs, **kargs)
 File 
"/tmp/easy_install-HPBq58/numpy-1.5.1rc1/numpy/distutils/misc_util.py", 
line 251, in clean_up_temporary_directory
ImportError: No module named numpy.distutils
Error in sys.exitfunc:
Traceback (most recent call last):
 File "/usr/lib/python2.4/atexit.py", line 24, in _run_exitfuncs
 func(*targs, **kargs)
 File 
"/tmp/easy_install-HPBq58/numpy-1.5.1rc1/numpy/distutils/misc_util.py", 
line 251, in clean_up_temporary_directory
ImportError: No module named numpy.distutils
orchidea 10.0.0.1 /usr/local/bin % easy_install numpy.distutils
Searching for numpy.distutils
matplotlib:
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
Ada/C/ObjC but not for C++
 File 
"build/bdist.linux-i686/egg/matplotlib/backends/qt4_editor/formlayout.py", 
line 275
 field.setCheckState(Qt.Checked if value else Qt.Unchecked)
 ^
SyntaxError: invalid syntax
But could this be the cause?
-- 
Regards,
mk
--
Premature optimization is the root of all fun.
From: Benjamin R. <ben...@ou...> - 2010年11月03日 14:32:42
On Wed, Nov 3, 2010 at 2:19 AM, Michiel de Hoon <mjl...@ya...> wrote:
> --- On *Tue, 11/2/10, Benjamin Root <ben...@ou...>* wrote:
>
> I have personally seen significant progress in this area, but there are a
> few backends that aren't quite right (MacOSX backend, I believe?).
>
> As far as I know, show() is working correctly in the MacOSX backend. If you
> encountered a case where the backend doesn't do the right thing, can you
> show a concrete example?
>
> Best,
> --Michiel.
>
>
>
Ah, so I must have been confused for something else. I don't use matplotlib
on a mac, so I don't know for sure. I just could have sworn there was a
conversation recently about issues in the macosx backend. I wonder which
backend it was that was still troublesome?
Ben Root
From: Anita G. <ani...@gm...> - 2010年11月03日 14:31:48
Hi,
I'm looking for a way to save Matplotlib figure objects the way Matlab can do it. I found the same request from 2008:
http://sourceforge.net/mailarchive/forum.php?thread_name=48D02DF2.2020401%40lanl.gov&forum_name=matplotlib-users
The answer basically was "There is currently no easy way".
Has the status changed since 2008?
Best wishes,
Anita
-- 
GMX DSL Doppel-Flat ab 19,99 &euro;/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
From: Bartosz T. <b.t...@bi...> - 2010年11月03日 11:26:22
> 
> ax = plt.subplot(1,1,1)
> ticks = ax.xaxis.get_majorticklines()
> mytick = ticks[3]
> mytick.set_marker(2)
> plt.draw()
> 
Cool! That's what I have been looking for. Thanks so much for your help.
Regards,
Bartek
8 messages has been excluded from this view by a project administrator.

Showing results of 312

<< < 1 .. 9 10 11 12 13 > >> (Page 11 of 13)
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 によって変換されたページ (->オリジナル) /