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
(8) |
2
(4) |
3
(21) |
4
(23) |
5
(3) |
|
6
|
7
(8) |
8
(2) |
9
|
10
(6) |
11
(4) |
12
(6) |
|
13
(1) |
14
(9) |
15
(10) |
16
(11) |
17
(3) |
18
(10) |
19
(9) |
|
20
(2) |
21
(10) |
22
(16) |
23
(8) |
24
(6) |
25
(6) |
26
(3) |
|
27
(5) |
28
(1) |
29
(14) |
30
(5) |
31
(14) |
|
|
|
From: <gre...@gm...> - 2006-08-03 18:26:03
|
Hi Fine Matplotlib folks,
I'm getting this error message and I can figure it out:
Traceback (most recent call last):
...
File "C:\automated tasks\GMVIEW-DEV\chart_gen.debug.py", line 26, in ?
p1 =3D figure.gca().barh(ind, ddata['value'], width, color=3D'r')
File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2499, in ba=
rh
bottom =3D y - height/2.
ValueError: frames are not aligned
Here is the relevant code:
<code>
from __future__ import division
import os,sys
import datetime
import tempfile
import matplotlib
matplotlib.use('Agg') # force the antigrain backend
from matplotlib.dates import YearLocator, MonthLocator,
WeekdayLocator, DateFormatter, date2num
from matplotlib import rc
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.figure import Figure
from matplotlib.cbook import iterable
import matplotlib.numerix as nx
ddata=3D{'label': ['REP1', 'REP2', 'REP3', 'REP4', 'REP5'], 'type':
'bar_sideways', 'value': ['23.00', '1381.56', '4606.69', '259.00',
'50.00'], 'money_format': '1', 'title': 'Sales from 2006-08-01 to
2006-08-02'}
height,width=3D3,4
figure =3D Figure(figsize=3D(width,height))
ax =3D figure.add_axes([0.2, 0.3, 0.7, 0.6])
from Numeric import arange #makes arrays
N=3Dlen(ddata['value'])
ind =3D arange(N) # the x locations for the groups
width=3D(figure.get_size_inches()[0]/len(ddata['value']))
width_gap=3D(.3*width)
width=3Dwidth-width_gap # the width of the bars
#OFFENDING LINE
p1 =3D figure.gca().barh(ind, ddata['value'], width, color=3D'r')
figure.gca().set_ylabel('$Amount')
if title:
figure.gca().set_title('title', bbox=3D{'facecolor':'0.8', 'pad':5})
locs =3D figure.gca().set_xticks(ind+width_gap)
labels =3D figure.gca().set_xticklabels(ddata['label'])
figure.gca().set_xlim(-width,len(ind))
#try to autoscale here
y_height=3Dmax(ddata['value'])+.2*max(ddata['value'])
y_increment=3Dround(y_height/5,-1)
figure.gca().set_yticks(arange(0,y_height,y_increment))
canvas =3D FigureCanvasAgg(figure)
</code>
any help is greatly appriciated!
--=20
Gregory Pi=F1ero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)
|
|
From: Charlie M. <cw...@gm...> - 2006-08-03 18:20:55
|
On 8/3/06, John Hunter <jdh...@ac...> wrote: > >>>>> "Kenny" == Kenny Ortmann <ya...@em...> writes: > > Kenny> When pylab tries to call numerix\__init__.py it is trying > Kenny> to figure out whether to call numpy, numeric, or numarray. > Kenny> Since it defaults to numeric I've tried to change the > Kenny> default to numpy, and that returned no luck. > > Find your matplotlib rc file -- it is probably in the folder > > C:\Documents and Settings\yourname\.matplotlib > > and edit it to change the "numerix setting" to "numpy". Eg, > > numerix : numpy # numpy, Numeric or numarray Before you have to write back.... the latest matplotlib release only works with numpy-0.9.8. |
|
From: John H. <jdh...@ac...> - 2006-08-03 18:11:43
|
>>>>> "Kenny" == Kenny Ortmann <ya...@em...> writes:
Kenny> When pylab tries to call numerix\__init__.py it is trying
Kenny> to figure out whether to call numpy, numeric, or numarray.
Kenny> Since it defaults to numeric I've tried to change the
Kenny> default to numpy, and that returned no luck.
Find your matplotlib rc file -- it is probably in the folder
C:\Documents and Settings\yourname\.matplotlib
and edit it to change the "numerix setting" to "numpy". Eg,
numerix : numpy # numpy, Numeric or numarray
JDH
|
|
From: Kenny O. <ya...@em...> - 2006-08-03 18:08:25
|
I am very new to matplotlib. Trying to start the <a href="http://matplotlib.sourceforge.net/tutorial.html">tutorial, </a> the very first script, the first line of the script, throws me this error. I have installed scipy version 0.5.0 for windows, and numpy version 1.0b1 i followed the instructions and made sure to install numy version 1.0b1 first. I have also tried to uninstall scipy and drop back to the latest 0.4.9 version and had no luck. Does anyone know what I can do to fix this error? When pylab tries to call numerix\__init__.py it is trying to figure out whether to call numpy, numeric, or numarray. Since it defaults to numeric I've tried to change the default to numpy, and that returned no luck. >>> from pylab import * Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\PYTHON23\Lib\site-packages\pylab.py", line 1, in ? from matplotlib.pylab import * File "C:\PYTHON23\Lib\site-packages\matplotlib\pylab.py", line 196, in ? import cm File "C:\PYTHON23\Lib\site-packages\matplotlib\cm.py", line 5, in ? import colors File "C:\PYTHON23\Lib\site-packages\matplotlib\colors.py", line 33, in ? from numerix import array, arange, take, put, Float, Int, where, \ File "c:\python23\lib\site-packages\matplotlib\numerix\__init__.py", line 60, in ? from Numeric import * ImportError: No module named Numeric >>> |
|
From: John H. <jdh...@ac...> - 2006-08-03 17:40:33
|
>>>>> "marek" == marek <md...@gm...> writes:
marek> I need to make plots in which the axes and text labels
marek> display in either English, Spanish, or Portuguese.
Does the unicode demo work for you?
http://matplotlib.sourceforge.net/examples/unicode_demo.py
JDH
|
|
From: John H. <jdh...@ac...> - 2006-08-03 17:38:16
|
>>>>> "Daniel" == Daniel Poelzleithner <po...@po...> writes:
Daniel> Hi, I'm developing a websuite for open meshed networks
Daniel> written in django. I must admit, matplotlib and such was
Daniel> kinda hard stuff to step into. Most examples and
Daniel> documentation is only based on the pylab api, which isn't
Daniel> well suited for my purpos, because Django runs best with
Daniel> mod-python.
There are a few resources
http://matplotlib.sourceforge.net/faq.html#OO
and
http://matplotlib.sourceforge.net/leftwich_tut.txt
and Ken McIvorhas converted many of the pylab examples to OO style (link?)
See also
http://matplotlib.sourceforge.net/examples/pythonic_matplotlib.py
and
http://matplotlib.sourceforge.net/examples/webapp_demo.py
Daniel> Anyways. I'm wrote a function which generates tiles for
Daniel> google maps and those should be overlayers with
Daniel> transparent background.
Daniel> My code currently looks like this:
Daniel> from matplotlib.toolkits.basemap import Basemap from
Daniel> matplotlib.backends.backend_agg import FigureCanvasAgg as
Daniel> FigureCanvas from matplotlib.figure import Figure
Daniel> [...]
Daniel> def mktopo(ll_lng, ll_lat, ur_lng, ur_lat, aspect,
Daniel> filename, state): """Generates atopo tile for given
Daniel> latitude/longitude pairs""" dpi = 64 fig = Figure() canvas
Daniel> = FigureCanvas(fig) # what does this do ???
Daniel> #fig.set_facecolor((1.0,1.0,0,0.0))
To make the figure background transparent, do:
fig.figurePatch.set_alpha(0.0)
You can set the alpha channel of any matplotlib artist (Text, Line2D,
Rectangle, etc.). The two of most interest to you will be
fig.figurePatch (a rectangle)
and
ax.axesPatch (ditto)
JDH
|
|
From: marek <md...@gm...> - 2006-08-03 17:31:33
|
I need to make plots in which the axes and text labels display in either English, Spanish, or Portuguese. I have code that successfully adds the labels in English but when using Spanish or Portuguese characters the labels show up mangled. I then switched to trying to get the simple_plot.py example to work. Adding a: # -*- coding: utf-8 -*- to the top of the file and replacing the English text. Again with no success. Has anyone had success in using matplotlib with unicode and specifically the utf-8 encoding? I am using the system in non-interactive mode with the Agg backend if that could make a difference. Any help is very appreciated! --Marek |
|
From: Steve S. <el...@gm...> - 2006-08-03 16:35:34
|
Alexander Michael wrote:
> On 8/3/06, *Steve Schmerler* <el...@gm... <mailto:el...@gm...>>
> wrote:
>
> Hi all
>
> How can I change the default behavior of the tick labeling from say
>
> 1 2 3 4 x1e-5
>
> to
>
> 1e-5 2e-5 3e-5 4e-5 ?
>
> My thesis supervisor wants it that way :(
>
> cheers,
> steve
>
>
> There is problably a better way, but onne way is to set the label
> formatter yourself:
>
> import pylab
> import matplotlib
>
> pylab.plot([1.0E-5,2.5E-5,3.0E-5], [1.0, 3.0, 2.0])
>
> ax = pylab.gca()
> ax.xaxis.set_major_formatter(
> matplotlib.ticker.FormatStrForm
> atter('%g'))
>
> pylab.show()
>
> You can craft an arbitrarily constructed string by using
> matplotlib.ticker.FuncFormatter
> instead of matplotlib.ticker.FormatStrFormatter.
>
> Hope this helps,
> Alex
>
Yes, after a look at the docs I found that FuncFormatter is what I
wanted. With the help of a little function (which I wrote some time ago)
that converts a float number into a raw string I can use FuncFormatter
straightforward (see attached file).
cheers,
steve
--
Random number generation is the art of producing pure gibberish as
quickly as possible.
|
|
From: Steve S. <el...@gm...> - 2006-08-03 16:35:08
|
Darren Dale wrote:
> On Thursday 03 August 2006 11:59, Alexander Michael wrote:
>> On 8/3/06, Steve Schmerler <el...@gm...> wrote:
>>> Hi all
>>>
>>> How can I change the default behavior of the tick labeling from say
>>>
>>> 1 2 3 4 x1e-5
>>>
>>> to
>>>
>>> 1e-5 2e-5 3e-5 4e-5 ?
>>>
>>> My thesis supervisor wants it that way :(
>>>
>>> cheers,
>>> steve
>> There is problably a better way, but onne way is to set the label
>> formatter yourself:
>>
>> import pylab
>> import matplotlib
>>
>> pylab.plot([1.0E-5,2.5E-5,3.0E-5], [1.0, 3.0, 2.0])
>>
>> ax = pylab.gca()
>> ax.xaxis.set_major_formatter(
>> matplotlib.ticker.FormatStrFormatter('%g'))
>
> Use OldScalarFormatter instead.
>
OK, I'll try that one too ...
Thanks.
--
Random number generation is the art of producing pure gibberish as
quickly as possible.
|
|
From: Darren D. <dd...@co...> - 2006-08-03 16:16:05
|
On Thursday 03 August 2006 11:59, Alexander Michael wrote:
> On 8/3/06, Steve Schmerler <el...@gm...> wrote:
> > Hi all
> >
> > How can I change the default behavior of the tick labeling from say
> >
> > 1 2 3 4 x1e-5
> >
> > to
> >
> > 1e-5 2e-5 3e-5 4e-5 ?
> >
> > My thesis supervisor wants it that way :(
> >
> > cheers,
> > steve
>
> There is problably a better way, but onne way is to set the label
> formatter yourself:
>
> import pylab
> import matplotlib
>
> pylab.plot([1.0E-5,2.5E-5,3.0E-5], [1.0, 3.0, 2.0])
>
> ax = pylab.gca()
> ax.xaxis.set_major_formatter(
> matplotlib.ticker.FormatStrFormatter('%g'))
Use OldScalarFormatter instead.
|
|
From: Alexander M. <lxa...@gm...> - 2006-08-03 15:59:20
|
On 8/3/06, Steve Schmerler <el...@gm...> wrote:
>
> Hi all
>
> How can I change the default behavior of the tick labeling from say
>
> 1 2 3 4 x1e-5
>
> to
>
> 1e-5 2e-5 3e-5 4e-5 ?
>
> My thesis supervisor wants it that way :(
>
> cheers,
> steve
>
There is problably a better way, but onne way is to set the label formatter
yourself:
import pylab
import matplotlib
pylab.plot([1.0E-5,2.5E-5,3.0E-5], [1.0, 3.0, 2.0])
ax = pylab.gca()
ax.xaxis.set_major_formatter(
matplotlib.ticker.FormatStrFormatter('%g'))
pylab.show()
You can craft an arbitrarily constructed string by using
matplotlib.ticker.FuncFormatter
instead of matplotlib.ticker.FormatStrFormatter.
Hope this helps,
Alex
|
|
From: Steve S. <el...@gm...> - 2006-08-03 15:43:51
|
Hi all How can I change the default behavior of the tick labeling from say 1 2 3 4 x1e-5 to 1e-5 2e-5 3e-5 4e-5 ? My thesis supervisor wants it that way :( cheers, steve -- Random number generation is the art of producing pure gibberish as quickly as possible. |
|
From: Philip A. <pa...@eo...> - 2006-08-03 03:46:13
|
Daniel Poelzleithner writes: > I'm developing a websuite for open meshed networks written in django. I > must admit, matplotlib and such was kinda hard stuff to step into. Most > examples and documentation is only based on the pylab api, which isn't > well suited for my purpos, because Django runs best with > mod-python. Note Part II of this nice tutorial by Andrew Dalke: http://www.dalkescientific.com/writings/diary/archive/2005/04/23/matplotlib_without_gui.html Regards, Phil Austin |
|
From: Daniel P. <po...@po...> - 2006-08-03 00:46:52
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I'm developing a websuite for open meshed networks written in django. I
must admit, matplotlib and such was kinda hard stuff to step into. Most
examples and documentation is only based on the pylab api, which isn't
well suited for my purpos, because Django runs best with mod-python.
Anyways. I'm wrote a function which generates tiles for google maps and
those should be overlayers with transparent background.
My code currently looks like this:
from matplotlib.toolkits.basemap import Basemap
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
[...]
def mktopo(ll_lng, ll_lat, ur_lng, ur_lat, aspect, filename, state):
"""Generates atopo tile for given latitude/longitude pairs"""
dpi = 64
fig = Figure()
canvas = FigureCanvas(fig)
# what does this do ???
#fig.set_facecolor((1.0,1.0,0,0.0))
m =
Basemap(llcrnrlon=ll_lng,llcrnrlat=ll_lat,urcrnrlon=ur_lng,urcrnrlat=ur_lat,
resolution='c',area_thresh=1000.,projection='merc',lat_ts=-8.0)
m.ax = fig.add_axes([0, 0, 1, 1], axisbg=(1.0,1.0,0.0,0.0),
frameon=False )
# 72 dpi
# we need 256x256 pixel images
fig.set_figsize_inches(256/dpi, 256/dpi)
nodes = Node.objects.exclude(gps_position_lat=False)
lats=[]
lons=[]
for node in nodes:
lons.append(node.gps_position_lng)
lats.append(node.gps_position_lat)
#print node
#a = m(node.gps_position_lat,node.gps_position_lng)
#print a
x,y = m(lons,lats)
m.plot(x,y,'bo')
canvas.print_figure(filename, dpi=dpi)
kindly regards
Daniel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFE0Udmy/mkIQp7AD0RAtLGAJsGK23BKKCr7vAMIqjyuYdRlHdf7wCgnvCI
Oj32/fRh2SClDf7+dUaKQEM=
=6zWI
-----END PGP SIGNATURE-----
|
|
From: Alexander M. <lxa...@gm...> - 2006-08-02 20:11:18
|
> > "Alexander Michael" <[EMAIL PROTECTED]> writes: > > > I would like to create a plot axis with major tick labels centered > > *between* major tick markers instead below tick markers. > > Take a look at > > http://thread.gmane.org/gmane.comp.python.matplotlib.general/5271 > http://thread.gmane.org/gmane.comp.python.matplotlib.general/5296 > http://www.scipy.org/Cookbook/Matplotlib/Transformations > > -- > Jouni > > >From your references, I have been mostly able to figure out how to do it. Thank you. So far, I have: # create transformation with x in data coords and y in axes coordinates transLabels = matplotlib.transforms.blend_xy_sep_transform( ax.transData, ax.transAxes) # get major locator and usurp major formatter for custom positioning major_locator = ax.xaxis.get_major_locator() major_formatter = ax.xaxis.get_major_formatter() ax.xaxis.set_major_formatter(matplotlib.ticker.NullFormatter()) # create custom text labels centered between major tick marks major_locs = major_locator() for i in range(1,len(major_locs)): x_last,x = major_locs[i-1],major_locs[i] ax.text(0.5*(x+x_last), -0.04, major_formatter(x, i), transform=transLabels, horizontalalignment='center') When "zooming around" an interactive plot, however, my custom labels get pushed off into the margins. I'm guessing I need to put them in a clip box somehow. Any hints? Thanks! Alex |
|
From: Daniel W. <dan...@ni...> - 2006-08-02 18:35:31
|
Thanks for the detailed reply. I was just wondering whether I was missing something obvious and that doesn't seem to be the case. Cheers Daniel Wheeler On Aug 2, 2006, at 2:15 PM, John Hunter wrote: >>>>>> "Daniel" == Daniel Wheeler <dan...@ni...> writes: > > Daniel> It seems that resetting the axes limits every time data > Daniel> needs to be redisplayed is rather inefficient. A script > Daniel> is included with this mail that tests the efficiency of > Daniel> resizing the y axis. The script has two loops, in the > Daniel> first loop pylab.ylim() is continuously called with the > Daniel> changing size of the domain, in the second loop > Daniel> pylab.ylim() is not called inside the loop. The first loop > Daniel> takes roughly twice as long to perform. Is this an > Daniel> unavoidable cost for resizing the y axis or is there > Daniel> another way to resize the axis that is less costly than > Daniel> using ylim()? > > The cost from the tick layout and formatting -- this could be made > more efficient but that is where the cost is currently. For every > tick label, matplotlib does a layout assuming you may have passed a > rotated multiline string. Special casing the no newline, non-rotated > case is probably where the biggest win would come from. It is > a good project for someone to tackle, but the text layout code is kind > of hairy because it deals with so many cases: mathtext, usetex, > rotated strings, multiline strings, top/bottom left/right alignment, > and so on. > > A complete refactoring of ticks to treat them as a single > collection-like object rather than a bunch of independent objects > would also help a lot here. > > JDH Daniel Wheeler |
|
From: John H. <jdh...@ac...> - 2006-08-02 18:26:17
|
>>>>> "Daniel" == Daniel Wheeler <dan...@ni...> writes:
Daniel> It seems that resetting the axes limits every time data
Daniel> needs to be redisplayed is rather inefficient. A script
Daniel> is included with this mail that tests the efficiency of
Daniel> resizing the y axis. The script has two loops, in the
Daniel> first loop pylab.ylim() is continuously called with the
Daniel> changing size of the domain, in the second loop
Daniel> pylab.ylim() is not called inside the loop. The first loop
Daniel> takes roughly twice as long to perform. Is this an
Daniel> unavoidable cost for resizing the y axis or is there
Daniel> another way to resize the axis that is less costly than
Daniel> using ylim()?
The cost from the tick layout and formatting -- this could be made
more efficient but that is where the cost is currently. For every
tick label, matplotlib does a layout assuming you may have passed a
rotated multiline string. Special casing the no newline, non-rotated
case is probably where the biggest win would come from. It is
a good project for someone to tackle, but the text layout code is kind
of hairy because it deals with so many cases: mathtext, usetex,
rotated strings, multiline strings, top/bottom left/right alignment,
and so on.
A complete refactoring of ticks to treat them as a single
collection-like object rather than a bunch of independent objects
would also help a lot here.
JDH
|
|
From: Daniel W. <dan...@ni...> - 2006-08-02 18:07:30
|
It seems that resetting the axes limits every time data needs to be =20 redisplayed is rather inefficient. A script is included with this mail that tests the efficiency of =20 resizing the y axis. The script has two loops, in the first loop pylab.ylim() is =20 continuously called with the changing size of the domain, in the second loop pylab.ylim() is not called =20 inside the loop. The first loop takes roughly twice as long to perform. Is this an unavoidable cost for resizing the y axis or is there =20 another way to resize the axis that is less costly than using ylim()? =EF=BF=BC Cheers Daniel Wheeler |
|
From: Darren D. <dd...@co...> - 2006-08-01 14:33:17
|
On Tuesday 01 August 2006 08:52, John Hunter wrote: > >>>>> "Jouni" == Jouni K Seppanen <jk...@ik...> writes: > > Jouni> The draw_lines method in the PS backend divides the line > Jouni> into subsequences of at most 50 points, and calls the > Jouni> "stroke" operator for each subsequence, which in effect > Jouni> resets the dash offset. Thus if 50 consecutive points fit > Jouni> within a dash, the line appears solid. > > 50 seems awfully small to me. There are maximum length path > limitations of some postscript interpreters which is why we batch > these up. Darren, could we get away with a step of 1000 here rather > than 50? Here are GGV's render times for a line containing 1e6 points: division | time (s) 50 3 1000 9 100000 8 none 28 I bumped it up to 100,000 in svn 2644, which seems to have improved the dash problem. Darren |
|
From: David H. <dav...@gm...> - 2006-08-01 14:19:52
|
>
>
> There is a nice little trick where you can make two axes share the
> same xaxis. Then when you pan or zoom on one, the other is
> automagically changed to
>
> ax1 = subplot(211)
> ax2 = subplot(212, sharex=ax1)
But that's not retroactive, or is it ? i.e. if ax2 has a wider x range than
ax1, it won't show up.
f = figure(1)
s1 = subplot(211)
s1.plot([1,2,3], [1,2,3])
s2 = subplot(212, sharex = s1)
s2.plot([4,5,6], [1,2,3])
I came up with the following function to solve that problem. Is there a more
elegant solution?
def uniform_limits(axes, xrange = 'widest', yrange = 'widest'):
"""For all axes, sets xlim and ylim to the widest (shortest) range."""
x = []
y = []
for ax in axes:
x.append(ax.get_xlim())
y.append(ax.get_ylim())
x = vstack(asarray(x))
y = vstack(asarray(y))
if xrange == 'widest':
xlims = x.min(0)[0], x.max(0)[1]
elif xrange == 'shortest':
xlims = x.max(0)[0], x.min(0)[1]
if yrange == 'widest':
ylims = y.min(0)[0], y.max(0)[1]
elif yrange == 'shortest':
ylims = y.max(0)[0], y.min(0)[1]
setp(axes, 'xlim', xlims, 'ylim', ylims)
David
|
|
From: John H. <jdh...@ac...> - 2006-08-01 13:02:55
|
>>>>> "Jouni" == Jouni K Seppanen <jk...@ik...> writes:
Jouni> The draw_lines method in the PS backend divides the line
Jouni> into subsequences of at most 50 points, and calls the
Jouni> "stroke" operator for each subsequence, which in effect
Jouni> resets the dash offset. Thus if 50 consecutive points fit
Jouni> within a dash, the line appears solid.
50 seems awfully small to me. There are maximum length path
limitations of some postscript interpreters which is why we batch
these up. Darren, could we get away with a step of 1000 here rather
than 50?
JDH
|
|
From: John H. <jdh...@ac...> - 2006-08-01 13:00:51
|
>>>>> "David" == David Huard <dav...@gm...> writes:
David> Hi John, Thanks for taking the time to answer a badly
David> formulated question. With your indications, I have been
David> able to get an example working.
Great.
David> s1.set_xlim(s2.get_xlim())
There is a nice little trick where you can make two axes share the
same xaxis. Then when you pan or zoom on one, the other is
automagically changed to
ax1 = subplot(211)
ax2 = subplot(212, sharex=ax1)
Ditto for sharey. A very useful trick!
JDH
|
|
From: Jouni K S. <jk...@ik...> - 2006-08-01 08:04:20
|
Eric Emsellem <ems...@ob...> writes: > But when saving it in a postscript the dashed line looks solid on most > of the plot. > This happens if there are too many points in the line: The draw_lines method in the PS backend divides the line into subsequences of at most 50 points, and calls the "stroke" operator for each subsequence, which in effect resets the dash offset. Thus if 50 consecutive points fit within a dash, the line appears solid. I suppose the division into subsequences solves some memory or speed problem with PS interpreters, so it should be retained. Then the solution would be to compute the length X of each subsequence and do something like "currentdash pop X setdash" after the "stroke". -- Jouni |
|
From: Eric E. <ems...@ob...> - 2006-08-01 07:24:53
|
Hi,
I just produced a plot with a curve dashed line:
when saving it into a png file it works fine.
But when saving it in a postscript the dashed line looks solid on most
of the plot.
This happens if there are too many points in the line:
x = arange(0,1.,0.0001)
y = sqrt(x)
plot(x,y,'k--')
## Png file is ok
savefig("toto.png")
## Eps file is NOT ok
savefig("toto.eps")
Any cure to that behaviour?
Thanks!!!
Eric
|
|
From: Jouni K S. <jk...@ik...> - 2006-08-01 06:05:06
|
"Alexander Michael" <lxa...@gm...> writes: > I would like to create a plot axis with major tick labels centered > *between* major tick markers instead below tick markers. Take a look at http://thread.gmane.org/gmane.comp.python.matplotlib.general/5271 http://thread.gmane.org/gmane.comp.python.matplotlib.general/5296 http://www.scipy.org/Cookbook/Matplotlib/Transformations -- Jouni |