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



Showing results of 165

<< < 1 .. 4 5 6 7 > >> (Page 6 of 7)
From: manouchk <man...@gm...> - 2006年05月09日 15:19:01
Hi,
I've seen nothing about installing pytz, dateutil that are usefull for 
matplotlib-users. In mandriva I think that this 2 packages are not yet in any 
package. What is the common way to include them? (any one can point me for 
example to a fedora rpm spec file that does the work??)
I have a directory named /usr/lib/python2.4/site-packages/pytz/zoneinfo that 
is included in python-matplotlib package but no module pytz so that 
date_demo*.py examples don't work.
From: Eric F. <ef...@ha...> - 2006年05月08日 18:28:08
John Hunter wrote:
>>>>>>"Eric" == Eric Firing <ef...@ha...> writes:
> 
> 
> Eric> The rc file is already pretty big--we might instead consider
> Eric> making axisbelow(True) the hardwired default. It seems
> 
> I already committed this change, but your comments on bloating rc
> files are well taken.
> 
> Eric> logical to me. It would be good to hear from others--are
> Eric> there people who like the present default and/or prefer
> Eric> adding this option to the rc collection?
> 
> Eric> Looking at the code a little more, I wonder whether the best
> Eric> way to handle this might not be by taking advantage of
> Eric> zorder more consistently. I think we could spread out the
> Eric> default zorders, assign a suitable zorder to the axis
> 
> They don't need to be spread out per say, since these are floats we
> can subdivide them ad nauseaum. Helper functions would make this more
> intuitive, like
> 
> myobj.set_zorder(zhelper.between(gridline, myline))
Agreed.
Unless someone else would like to do it, I think I can work on this 
fairly soon, before or after I finish the work I am doing now on a new 
colorbar.
> 
> Eric> I think this could make the code and interface simpler, more
> Eric> self-consistent, and more flexible. (My remarks are based
> Eric> on only a quick look, so I may be missing something
> Eric> important.)
> 
> But people will still want to set defaults...
Granted, and this flexibility is good.
Eric
From: John H. <jdh...@ac...> - 2006年05月08日 17:49:31
>>>>> "Eric" == Eric Firing <ef...@ha...> writes:
 Eric> The rc file is already pretty big--we might instead consider
 Eric> making axisbelow(True) the hardwired default. It seems
I already committed this change, but your comments on bloating rc
files are well taken.
 Eric> logical to me. It would be good to hear from others--are
 Eric> there people who like the present default and/or prefer
 Eric> adding this option to the rc collection?
 Eric> Looking at the code a little more, I wonder whether the best
 Eric> way to handle this might not be by taking advantage of
 Eric> zorder more consistently. I think we could spread out the
 Eric> default zorders, assign a suitable zorder to the axis
They don't need to be spread out per say, since these are floats we
can subdivide them ad nauseaum. Helper functions would make this more
intuitive, like
 myobj.set_zorder(zhelper.between(gridline, myline))
 Eric> I think this could make the code and interface simpler, more
 Eric> self-consistent, and more flexible. (My remarks are based
 Eric> on only a quick look, so I may be missing something
 Eric> important.)
But people will still want to set defaults...
JDH
From: Eric F. <ef...@ha...> - 2006年05月08日 17:42:46
Robert Hetland wrote:
> 
> On May 7, 2006, at 11:15 PM, Vineet Jain wrote:
> 
>>
>>> ax.set_axisbelow(True)
> 
> 
> Is there a way to set this in the rc file? axisbelow(True) would be my 
> default preference.
> 
> -Rob.
The rc file is already pretty big--we might instead consider making 
axisbelow(True) the hardwired default. It seems logical to me. It 
would be good to hear from others--are there people who like the present 
default and/or prefer adding this option to the rc collection?
Looking at the code a little more, I wonder whether the best way to 
handle this might not be by taking advantage of zorder more 
consistently. I think we could spread out the default zorders, assign a 
suitable zorder to the axis artists, add those artists to the artists 
list in the axes.draw method, and then let the zorder take care of the 
rest automatically. This way we could ensure a logical default order: 
image, all patch-like things, axis grids, all line-like things; and if 
anyone wanted to change the order, it could be done easily via setting 
selected zorder values. If necessary, convenience functions could be 
used for setting zorder without the user having to know which numerical 
values were assigned for which types of object.
I think this could make the code and interface simpler, more 
self-consistent, and more flexible. (My remarks are based on only a 
quick look, so I may be missing something important.)
Eric
From: Robert H. <he...@ta...> - 2006年05月08日 14:01:02
On May 7, 2006, at 11:15 PM, Vineet Jain wrote:
>
>> ax.set_axisbelow(True)
Is there a way to set this in the rc file? axisbelow(True) would be 
my default preference.
-Rob.
-----
Rob Hetland, Assistant Professor
Dept of Oceanography, Texas A&M University
p: 979-458-0096, f: 979-845-6331
e: he...@ta..., w: http://pong.tamu.edu
From: <seb...@sp...> - 2006年05月08日 04:53:50
I'm trying to be a good kid and not just install the Matplotlib
package in the Sid (unstable) tree on my Sarge (stable) laptop.
I got some error messages when trying to build a 'backport' to
Debian Sarge (stable) from the source package.
Anyone done this? Please advise.
Chris
--
_______________________________________
Christian Seberino, Ph.D.
SPAWAR Systems Center San Diego
Code 2872
49258 Mills Street, Room 158
San Diego, CA 92152-5385
U.S.A.
Phone: (619) 553-9973
Fax : (619) 553-0804
Email: seb...@sp...
_______________________________________
From: Vineet J. <vin...@ya...> - 2006年05月08日 04:15:33
> ax.set_axisbelow(True)
Thanks a lot. That fixed the problem.
VJ
From: Eric F. <ef...@ha...> - 2006年05月05日 17:43:02
George,
Thanks for the report. I will try to get those problems cleared up this 
weekend.
Eric
George Nurser wrote:
> I've noticed a few problems with pcolormesh, running r 2341
> interactively from ipython -pylab, TkAgg, with from numpy import *
> 
> 1. colorbar() won't draw.
> 
> a=rand(10,10)
> pcolormesh(a)
> colorbar()
> throws error:
> ---------------------------------------------------------------------------
> exceptions.AttributeError Traceback (most
> recent call last)
> 
> /users/mod/agn/<ipython console>
> 
> /data/jrd/mod1/agn/ext/Linux/lib64/python/matplotlib/pylab.py in
> colorbar(mappable, cax, orientation, tickfmt, cspacing, clabels,
> drawedges, edgewidth, edgecolor)
> 390 drawedges=drawedges,
> 391 edgewidth=edgewidth,
> --> 392 edgecolor=edgecolor)
> 393 draw_if_interactive()
> 394 return ret
> 
> /data/jrd/mod1/agn/ext/Linux/lib64/python/matplotlib/figure.py in
> colorbar(self, mappable, cax, orientation, tickfmt, cspacing, clabels,
> drawedges, edgewidth, edgecolor)
> 712 ax = self.gca()
> 713
> --> 714 cmap = mappable.cmap
> 715
> 716 if cax is None:
> 
> AttributeError: 'NoneType' object has no attribute 'cmap'
> 
> 
> bug can be sidestepped by
> pp=pcolormesh(a)
> colorbar(mappable=pp)
> 
> though this is a bit obscure.
> 
> 
> 
> 
> 
> 2. More seriously, two problems with masked arrays.
> e.g.
> b = ma.maskarray(a<0.5,a)
> pp=pcolormesh(b,norm=normalize(clip=False))
> 
> i. masked squares come out grey (nstead of white with pcolor).
> ii. any further resize screws up plot -- old plot hasn't been deleted 
> properly
> 
> 
> e.g.
> colorbar(mappable=pp)
> 
> gives overlay of two plots.
> 
> 
> No way round (i), though it's not a disaster; for (ii) need to get
> size right first time!
> 
> --George.
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi,
I was just trying to see if that will be possible to use matplotlib like 
base to replace ds9. And someone asked me if it was possible to use 
matplotlib to overplot some field (it was to check if the field has been 
observed with different instrument) and I found this intrinsic 
limitation. I'm not complaining about it but Eric's question was to know 
if it was possible to do a wraping between pyfits and matplolib. In my 
experience, it's possible but not useful. I agree that 3kx3k image are 
not very common but 2kx2k are and in a normal system it not possible to 
think (at least now) to use matplotlib for image analysis.
I'm thinking that matplolib is great library believe me. I'm using it 
every day but I was just telling that matplotlib can't be use to replace 
ds9 and to be the base of an analysis tool (for two day dimensional image).
I remember a mail from you or someone from stsci about a python ds9. 
That will be something great clearly. ds9 is good but on linux it's 
became old especially du to the tk interface (no antilaliasing and 
probably bad default font from me). There are some other crtics I have 
about ds9 (user interface etc) but the tool is here and I'm very please 
by it but that don't means that I don't have some comments to do on it.
Regards,
N.
Perry Greenfield wrote:
>
> On May 4, 2006, at 11:28 AM, Humufr wrote:
>
>> Hi,
>>
>> I would like something like this too. I tried to play a little bit to 
>> implement it but unfortunatly I find an intrinsic limitation in 
>> matplotlib. It's using agg and agg can't have image bigger than 3kx3k 
>> pixels or something like this and even before this limit matplotlib 
>> take age to plot an image on screen.
>>
> It certainly is true matplotlib has problems with really big images. 
> But then I would ask first what you were expecting in the way of 
> capabilities. I don't think one should expect a package to handle the 
> automatic rescaling and resampling of very large images without 
> substantial performance penalties. Were you looking for some simpler 
> image display capability? Simple pixel dump the the screen (figimage 
> comes closer to that but still does some processing). There aren't a 
> lot of 3kx3k image displays out there yet so either you need to pan or 
> subsample in some manner. If you can point out a reasonable capability 
> that could handle large images, I think there would be a possibility 
> of trying to do it at some stage. Is there a program that exists we 
> should look to as a good example of what should be one? (Existence 
> proofs are always a great way of convincing developers that it is 
> possible, or at least what combination of features are worth 
> implementing.)
>
> Perry Greenfield
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache 
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: George N. <gn...@go...> - 2006年05月05日 16:41:35
I've noticed a few problems with pcolormesh, running r 2341
interactively from ipython -pylab, TkAgg, with from numpy import *
1. colorbar() won't draw.
a=3Drand(10,10)
pcolormesh(a)
colorbar()
throws error:
---------------------------------------------------------------------------
exceptions.AttributeError Traceback (most
recent call last)
/users/mod/agn/<ipython console>
/data/jrd/mod1/agn/ext/Linux/lib64/python/matplotlib/pylab.py in
colorbar(mappable, cax, orientation, tickfmt, cspacing, clabels,
drawedges, edgewidth, edgecolor)
 390 drawedges=3Ddrawedges,
 391 edgewidth=3Dedgewidth,
--> 392 edgecolor=3Dedgecolor)
 393 draw_if_interactive()
 394 return ret
/data/jrd/mod1/agn/ext/Linux/lib64/python/matplotlib/figure.py in
colorbar(self, mappable, cax, orientation, tickfmt, cspacing, clabels,
drawedges, edgewidth, edgecolor)
 712 ax =3D self.gca()
 713
--> 714 cmap =3D mappable.cmap
 715
 716 if cax is None:
AttributeError: 'NoneType' object has no attribute 'cmap'
bug can be sidestepped by
pp=3Dpcolormesh(a)
colorbar(mappable=3Dpp)
though this is a bit obscure.
2. More seriously, two problems with masked arrays.
e.g.
b =3D ma.maskarray(a<0.5,a)
pp=3Dpcolormesh(b,norm=3Dnormalize(clip=3DFalse))
i. masked squares come out grey (nstead of white with pcolor).
ii. any further resize screws up plot -- old plot hasn't been deleted prope=
rly
e.g.
colorbar(mappable=3Dpp)
gives overlay of two plots.
No way round (i), though it's not a disaster; for (ii) need to get
size right first time!
--George.
On May 4, 2006, at 11:28 AM, Humufr wrote:
> Hi,
>
> I would like something like this too. I tried to play a little bit to 
> implement it but unfortunatly I find an intrinsic limitation in 
> matplotlib. It's using agg and agg can't have image bigger than 3kx3k 
> pixels or something like this and even before this limit matplotlib 
> take age to plot an image on screen.
>
It certainly is true matplotlib has problems with really big images. 
But then I would ask first what you were expecting in the way of 
capabilities. I don't think one should expect a package to handle the 
automatic rescaling and resampling of very large images without 
substantial performance penalties. Were you looking for some simpler 
image display capability? Simple pixel dump the the screen (figimage 
comes closer to that but still does some processing). There aren't a 
lot of 3kx3k image displays out there yet so either you need to pan or 
subsample in some manner. If you can point out a reasonable capability 
that could handle large images, I think there would be a possibility of 
trying to do it at some stage. Is there a program that exists we should 
look to as a good example of what should be one? (Existence proofs are 
always a great way of convincing developers that it is possible, or at 
least what combination of features are worth implementing.)
Perry Greenfield
From: Eric E. <ems...@ob...> - 2006年05月05日 14:03:44
Hi,
I am trying to change the size of the tickmarks lines (the small lines 
which mark the ticks..) and cannot find a way to do this (looked at the 
examples, wiki, forum posts, etc). (and I would like to do this for a 
semilog plot)
thanks
Eric
From: Eric E. <ems...@ob...> - 2006年05月05日 10:23:33
Hi,
I would like to draw a figure with shared X axis in semilogx, where the 
upper panel would show a scatter plot of these points (x, y), and the 
bottom would show an histogram of the values of x, with bins having 
steps of 0.1 IN LOG10. I would like to have the tickmarks like in a 
semilogx plot (so with something like gca().set_xscale('log')).
==> I am desperately trying that but didn't find a working solution yet.
Below is an illustration of what I am plotting, but without any 
suggestion for getting the right tickmarks/xaxis etc..
any input welcome here! Thanks in advance for your help
Eric
==================================================================
My dataset would be for example:
x = rand(100)
y = rand(100)
# sel1 and sel2 being some selection of x
# here is just a working - but stupid - example
sel1 = (x < 0.5)
sel2 = (x > 0.5)
selx1 = compress(sel1, x)
selx2 = compress(sel2, x)
bins = arange(-2,0.1,0.1)
width=0.05
n1, n1bins, patches1 = hist(log10(selx1), bins)
n2, n2bins, patches2 = hist(log10(selx2), bins)
clf()
a = axes([0.15,0.4,.8,.55])
scatter(x, y)
setp(a, xticklabels=[])
b = axes([0.15,0.05,.8,.35])
p1 = bar(n1bins, n1, width, color='chartreuse')
p2 = bar(n2bins, n2, width, color='khaki')
# xlim(10**(-3.),10**(0.))
# of course this xlim does not work at all... and
# I would like to have the tickmarks and labels right
From: Eric F. <ef...@ha...> - 2006年05月04日 17:11:35
VJ,
Have you tried
ax.set_axisbelow(True)
where ax is your axes instance?
Eric
Vineet Jain wrote:
> I have charts which are using the add_collection function to draw 
> financial bar charts. I also have the grid line enabled. When the chart 
> is drawn (example can be seen at):
> 
> http://s3.amazonaws.com/oysb/wmt_n.png
> 
> any line drawn through add_collection which overlaps with the grid line 
> does not get displayed. Is there a way to send the grid line to the 
> background?
> 
> VJ 
From: Vineet J. <vin...@ya...> - 2006年05月04日 16:03:13
I have charts which are using the add_collection function to draw 
financial bar charts. I also have the grid line enabled. When the chart 
is drawn (example can be seen at):
http://s3.amazonaws.com/oysb/wmt_n.png
any line drawn through add_collection which overlaps with the grid line 
does not get displayed. Is there a way to send the grid line to the 
background?
VJ 
Hi,
I would like something like this too. I tried to play a little bit to 
implement it but unfortunatly I find an intrinsic limitation in 
matplotlib. It's using agg and agg can't have image bigger than 3kx3k 
pixels or something like this and even before this limit matplotlib take 
age to plot an image on screen.
Regars,
N.
Eric Emsellem wrote:
> Hi,
> (pls let me know if this post should be better redirected to scipy or 
> numpy. It does relate to astropy of course...)
>
> I am trying since some time to develop a simple module to wrap up some 
> functionalities of pyfits and matplotlib.
> The goal is to be able to manipulate FITS files (spectra, images, 3D 
> cubes, including maybe Euro3D format for those who know what it is) 
> and display them (plot slices, display images, etc) in a very simple 
> way. It could be inspired from (although not a cloning of) simple 
> functionalities found in Midas. So you can do things like
>
> Image1.fits = Image2.fits / (Image3.fits + 3.4)
>
> Table.fits.col1 = Table.fits.col2 * Table.fits.col4 / 2.
>
> , or easily create a new Fits image, or table, display them by doing 
> something like:
>
> load("Image1.fits", scale=3, cuts=(0.,100.), center=(-1.,6.))
>
> or alternatively:
>
> ima = fitstab("Image1.fits")
> load(ima, scale=3, cuts=(0.,100.), center=-1.,6.)
>
> (where Image1.fits is displayed with a scaling factor of 3, with cuts 
> as indicated, and the center of the figure corresponding to 
> coordinates -1,6)
>
> or
>
> plot("Image1.fits", 0)
>
> (plot a cut at vertical coordinate 0)
>
> You could say then: use Midas. But Midas is clearly very limited (does 
> not have the python built-in potential of course) and its 
> display/plotting functions are really scarce. The fact that there is 
> now a pyMidas available does not fill the gap since I would like to be 
> able to run my favourite ide (ipython for the moment), and really 
> profit from all python modularity/functions.
>
> So the choice for an I/O with fits seems easy: "pyfits" which is a 
> really fantastic module for dealing with FITS files.
> And the choice for displaying is also not so difficult: "matplotlib" 
> which is also an amazing module and provides paper quality figures.
>
> My questions are then:
>
> 0/ is this a dum idea? Maybe I am missing something here, so just let 
> me know...
>
> 1/ is there already something existing which does what I mention above?
> (so a wrapper around pyfits+matplotlib). Maybe at StSci...?
>
> 2/ If I were to try to develop such a tool, it will result in a rather 
> badly coded module: I will try my best but frankly I should be 
> considered as a newby in python and I can sincerely say that I don't 
> fully understand all the forum matplotlib/numpy/scipy discussions, by 
> far... So the question is: would anybody be interested/willing to, 
> once in a while, help me with this development?
>
> Some could answer that using directly pyfits+matplotlib does the job. 
> True. But if you wish to directly deal with fits and display them with 
> some option (zooming, cuts, centering, etc) you still need to go 
> through a number of steps which are not necessarily easy to remember 
> (syntax, etc). Some wrapping could help quite a lot here.
>
> Thanks for any input here.
>
> cheers
>
> Eric
> P.S.: for the sake of completeness I could send anybody on request the 
> very ugly looking - and unfinished modules I wrote last year in this 
> context, when I seriously engaged in python in replacement of 
> Midas/Iraf/Idl...
>
>
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache 
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: John H. <jdh...@ac...> - 2006年05月04日 14:48:52
>>>>> "Eric" == Eric Firing <ef...@ha...> writes:
 Eric> Bob, Try doing
 Eric> b = axis() ax1.plot([0.0],[0.0],'wo') axis(b)
 Eric> That saves the axis range set by imshow and restores it
 Eric> after the call to plot.
You can also turn on an off autoscaling
 ax.set_autoscale_on(False)
JDH
Hi,
(pls let me know if this post should be better redirected to scipy or 
numpy. It does relate to astropy of course...)
I am trying since some time to develop a simple module to wrap up some 
functionalities of pyfits and matplotlib.
The goal is to be able to manipulate FITS files (spectra, images, 3D 
cubes, including maybe Euro3D format for those who know what it is) and 
display them (plot slices, display images, etc) in a very simple way. It 
could be inspired from (although not a cloning of) simple 
functionalities found in Midas. So you can do things like
Image1.fits = Image2.fits / (Image3.fits + 3.4)
Table.fits.col1 = Table.fits.col2 * Table.fits.col4 / 2.
, or easily create a new Fits image, or table, display them by doing 
something like:
load("Image1.fits", scale=3, cuts=(0.,100.), center=(-1.,6.))
or alternatively:
ima = fitstab("Image1.fits")
load(ima, scale=3, cuts=(0.,100.), center=-1.,6.)
(where Image1.fits is displayed with a scaling factor of 3, with cuts as 
indicated, and the center of the figure corresponding to coordinates -1,6)
or
plot("Image1.fits", 0)
(plot a cut at vertical coordinate 0)
You could say then: use Midas. But Midas is clearly very limited (does 
not have the python built-in potential of course) and its 
display/plotting functions are really scarce. The fact that there is now 
a pyMidas available does not fill the gap since I would like to be able 
to run my favourite ide (ipython for the moment), and really profit from 
all python modularity/functions.
So the choice for an I/O with fits seems easy: "pyfits" which is a 
really fantastic module for dealing with FITS files.
And the choice for displaying is also not so difficult: "matplotlib" 
which is also an amazing module and provides paper quality figures.
My questions are then:
0/ is this a dum idea? Maybe I am missing something here, so just let me 
know...
1/ is there already something existing which does what I mention above?
(so a wrapper around pyfits+matplotlib). Maybe at StSci...?
2/ If I were to try to develop such a tool, it will result in a rather 
badly coded module: I will try my best but frankly I should be 
considered as a newby in python and I can sincerely say that I don't 
fully understand all the forum matplotlib/numpy/scipy discussions, by 
far... So the question is: would anybody be interested/willing to, once 
in a while, help me with this development?
Some could answer that using directly pyfits+matplotlib does the job. 
True. But if you wish to directly deal with fits and display them with 
some option (zooming, cuts, centering, etc) you still need to go through 
a number of steps which are not necessarily easy to remember (syntax, 
etc). Some wrapping could help quite a lot here.
Thanks for any input here.
cheers
Eric
P.S.: for the sake of completeness I could send anybody on request the 
very ugly looking - and unfinished modules I wrote last year in this 
context, when I seriously engaged in python in replacement of 
Midas/Iraf/Idl...
From: Charlie M. <cw...@gm...> - 2006年05月04日 02:09:30
 I posted a universal build of matplotlib 0.87.2 on sourceforge in
egg and mpkg format. It is compiled against the latest numarray,
numpy, and Numeric as well as Tk and the new wxPython-rc2 universal.=20
Libpng and freetype2 are statically linked in. Please post or link to
either/both at "http://pythonmac.org/packages/py24-fat/".
http://sourceforge.net/project/showfiles.php?group_id=3D80706&package_id=3D=
82474
Thanks,
 Charlie
From: Eric F. <ef...@ha...> - 2006年05月03日 16:53:34
Bob,
Try doing
b = axis()
ax1.plot([0.0],[0.0],'wo')
axis(b)
That saves the axis range set by imshow and restores it after the call 
to plot.
Eric
Robert Simpson wrote:
> Hi,
> 
> Using matplotlib 0.87.2, I've been trying to plot points on top of an 
> image. The image without points fills axes of the extent requested, but 
> using plot to add a point on top of the image changes the axes lengths 
> and gives unwanted white margins around the edges. Here's an example. 
> Any help would be greatly appreciated!
> 
> Bob Simpson
> 
> from pylab import *
> 
> # Sample image.
> image = rand(12,6)
> 
> # This choice for extent works fine... It produces no white margins.
> #extent = [-80, 60, -60, 40]
> 
> # This choice gives unwanted white margins,
> # except when no point is plotted.
> extent = [-80.,64., -74.,48.]
> 
> ax1 = axes()
> ax1.im = imshow(image, origin='lower', extent=extent)
> 
> # Plot point on image.
> hold(True)
> ax1.plot([0.0],[0.0],'wo')
> 
> show()
> 
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Robert S. <si...@us...> - 2006年05月03日 15:29:44
Hi,
Using matplotlib 0.87.2, I've been trying to plot points on top of an 
image. The image without points fills axes of the extent requested, 
but using plot to add a point on top of the image changes the axes 
lengths and gives unwanted white margins around the edges. Here's an 
example. Any help would be greatly appreciated!
Bob Simpson
from pylab import *
# Sample image.
image = rand(12,6)
# This choice for extent works fine... It produces no white margins.
#extent = [-80, 60, -60, 40]
# This choice gives unwanted white margins,
# except when no point is plotted.
extent = [-80.,64., -74.,48.]
ax1 = axes()
ax1.im = imshow(image, origin='lower', extent=extent)
# Plot point on image.
hold(True)
ax1.plot([0.0],[0.0],'wo')
show()
From: David H. <dav...@gm...> - 2006年05月03日 13:57:44
Wouldn't it be simpler to use the extent key to shift the image?
Let x and y be the pixel centers
imshow(M, extent =3D [x[0]-dx, x[-1]-dx, y[0]-dy, y[-1]-dy])
where dx and dy is half the distance between pixels.
David
2006年5月2日, Gary Ruben <gr...@bi...>:
>
> Just looking back through the thread, I guess the problem is that the
> coords returned by JH's example don't correspond to the centre of the
> pixel. I'm pretty sure you'll have to do the transformation yourself
> using values from the axes and figure classes.
>
> Gary R.
>
> Gary Ruben wrote:
> > I don't understand what you're asking here. Is there some unexpected
> > interpolation going on? A small example might be useful to clarify if
> > noone else steps forward with an answer.
> >
> > Gary R.
> >
> > Tommy Grav wrote:
> >> Hi,
> >>
> >> sorry for all the newbie questions. I have looked though the
> >> documentation but have not found anything on how to handle the fact
> >> that matplotlib takes the array indices as the lower left corner
> >> position for the value, while an image
> >> has its pixel values at the center of the pixel. Is there anything
> >> written on how to handle this?
> >>
> >> Cheers
> >>
> >> Tommy
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim=
o
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=
=3D121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Gary R. <gr...@bi...> - 2006年05月03日 00:04:48
Just looking back through the thread, I guess the problem is that the 
coords returned by JH's example don't correspond to the centre of the 
pixel. I'm pretty sure you'll have to do the transformation yourself 
using values from the axes and figure classes.
Gary R.
Gary Ruben wrote:
> I don't understand what you're asking here. Is there some unexpected 
> interpolation going on? A small example might be useful to clarify if 
> noone else steps forward with an answer.
> 
> Gary R.
> 
> Tommy Grav wrote:
>> Hi,
>>
>> sorry for all the newbie questions. I have looked though the 
>> documentation but have not found anything on how to handle the fact 
>> that matplotlib takes the array indices as the lower left corner 
>> position for the value, while an image
>> has its pixel values at the center of the pixel. Is there anything 
>> written on how to handle this?
>>
>> Cheers
>>
>> Tommy
From: John P. <joh...@st...> - 2006年05月02日 23:58:25
As I understand it, you are having an issue with the alignment of pixels
and axis tickmarks.
Perhaps the following will help you to set up a workaround (check the
'0.5' values?)
http://sourceforge.net/mailarchive/message.php?msg_id=15509515
Maybe that helps.
Cheers
JP
Tommy Grav wrote:
> Hi,
>
> sorry for all the newbie questions. I have looked though the
> documentation 
> but have not found anything on how to handle the fact that matplotlib
> takes 
> the array indices as the lower left corner position for the value,
> while an image
> has its pixel values at the center of the pixel. Is there anything
> written on how 
> to handle this?
>
> Cheers
>
> Tommy
>
>
>
> tg...@ma... <mailto:tg...@ma...>
>
> http://homepage.mac.com/tgrav/
>
>
> "Any intelligent fool can make things bigger, 
> more complex, and more violent. It takes a 
> touch of genius -- and a lot of courage -- 
> to move in the opposite direction"
> -- Albert Einstein
>
>
From: Gary R. <gr...@bi...> - 2006年05月02日 23:48:54
I don't understand what you're asking here. Is there some unexpected 
interpolation going on? A small example might be useful to clarify if 
noone else steps forward with an answer.
Gary R.
Tommy Grav wrote:
> Hi,
> 
> sorry for all the newbie questions. I have looked though the 
> documentation 
> but have not found anything on how to handle the fact that matplotlib takes 
> the array indices as the lower left corner position for the value, while 
> an image
> has its pixel values at the center of the pixel. Is there anything 
> written on how 
> to handle this?
> 
> Cheers
> 
> Tommy

Showing results of 165

<< < 1 .. 4 5 6 7 > >> (Page 6 of 7)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





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

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

More information about our ad policies

Ad destination/click URL:

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