Re: [Matplotlib-users] setting thickness of axis frame

2009-02-05 Thread Christopher Brown
Hi Jae-Joon,

JL Everything works fine for me.
JL Can it be just that the canvas is not redrawn after you set the
JL linewidth? It will be helpful if you post a standalone script that
JL reproduces your problem. Regards,

Yes, this was the problem. I don't know why the same scripts were 
working before, but adding draw() now does the trick.

-- 
Christopher Brown, Ph.D.
Department of Speech and Hearing Science
Arizona State University

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Christopher Brown
Hi,

CM  I use:
CM 
CM  plt.gca().get_frame().set_linewidth(2)
CM 
CM
CM That is not working for me.  Is it working now for the OP?

Actually, I just went back and found a reply from Jae-Joon to a post of 
mine in November about this. He points out that get_frame() is 
deprecated, but that gca().frame.set_linewidth(2) should work. This is 
not working for me either now (it was at the time), and now that I 
notice, I am also unable to change the tick width the way I used to:

for tl in pp.gca().get_xticklines() + pp.gca().get_yticklines():
 tl.set_markeredgewidth(2)

...and I also can get invert_yaxis() (or xaxis) to work either.

I'm on windows, using 0.98.5, ang Qt4Agg backend. I get no warnings or 
errors. Does anyone have any ideas?

-- 
Christopher Brown, Ph.D.
Department of Speech and Hearing Science
Arizona State University

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Michael Hearne
Chris - Thanks for your reply.  Unfortunately, it didn't seem to have 
any effect on the frame I created.

I notice with matplotlib 0.98.5.1, I get a warning with get_frame(), 
telling me to use the patch object of the axes instead of get_frame().

So, when I use this with an axes created for a Basemap, I can't get the 
thickness of the frame around the axes to change.

I'm using Basemap 0.99.2.

The code demonstrating the issue is attached, and the relevant lines of 
code are near the bottom of the script.

Thanks,

Mike

Christopher Brown wrote:
 Hi Michael,

 MH The Axes object has a method for turning on the frame:
 MH set_frame_on().   How do I set the thickness of the frame that
 MH appears?

 I use:

 plt.gca().get_frame().set_linewidth(2)



--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Michael Hearne

Forgot the attachment...


Michael Hearne wrote:
Chris - Thanks for your reply.  Unfortunately, it didn't seem to have 
any effect on the frame I created.


I notice with matplotlib 0.98.5.1, I get a warning with get_frame(), 
telling me to use the patch object of the axes instead of get_frame().


So, when I use this with an axes created for a Basemap, I can't get 
the thickness of the frame around the axes to change.


I'm using Basemap 0.99.2.

The code demonstrating the issue is attached, and the relevant lines 
of code are near the bottom of the script.


Thanks,

Mike

Christopher Brown wrote:

Hi Michael,

MH The Axes object has a method for turning on the frame:
MH set_frame_on().   How do I set the thickness of the frame that
MH appears?

I use:

plt.gca().get_frame().set_linewidth(2)






#!/usr/bin/python
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from pylab import *

fig = plt.figure()
ax1 = fig.add_axes([0,0,1.0,1.0])
bounds = (134,144,36,40)

clon = bounds[0] + (bounds[1]-bounds[0])/2.
clat = bounds[2] + (bounds[3]-bounds[2])/2.

# setup Lambert Conformal basemap.
m = Basemap(llcrnrlon=bounds[0],llcrnrlat=bounds[2],
urcrnrlon=bounds[1],urcrnrlat=bounds[3],
resolution='h',projection='merc',lat_ts=clat)

# draw coastlines.
m.drawcoastlines()
# draw a boundary around the map, fill the background.
# this background will end up being the ocean color, since
# the continents will be drawn on top.
m.drawmapboundary(fill_color='aqua') 
# fill continents, set lake color same as ocean color. 
m.fillcontinents(color='coral',lake_color='aqua')

left = 0.05
bottom = 0.05
width = 0.25
height = 0.25
llbounds = (left,bottom,width,height)

ax = fig.add_axes(llbounds)
map = Basemap(resolution='c',
  projection='ortho',
  lon_0=clon,lat_0=clat,ax=ax)

#print 'map created.'
map.drawcountries(linewidth=0.1,color=[0.2,0.2,0.2])
map.drawcoastlines(linewidth=0.05,color=[0.2,0.2,0.2])
map.drawlsmask((230,230,230,255),(119,155,207,255))
meridians = arange(-180,210,30)
parallels = arange(-90,120,30)
map.drawmeridians(meridians,linewidth=0.1,dashes=[1,0],color=[0.2,0.2,0.2])
map.drawparallels(parallels,linewidth=0.1,dashes=[1,0],color=[0.2,0.2,0.2])
pcx,pcy = map(clon,clat)

map.plot(array([pcx]),array([pcy]),'r*',linewidth=1,markersize=5,markeredgecolor='r')
map.drawmapboundary(color='k',linewidth=2.0)

ax.set_frame_on(True)
ax.patch.set_linewidth(4.0)

plt.savefig('output.png')


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Jeff Whitaker
Michael Hearne wrote:
 Forgot the attachment...

Michael: It's ax.frame.set_linewidth (not ax.patch).

-Jeff


 Michael Hearne wrote:
 Chris - Thanks for your reply.  Unfortunately, it didn't seem to have 
 any effect on the frame I created.

 I notice with matplotlib 0.98.5.1, I get a warning with get_frame(), 
 telling me to use the patch object of the axes instead of get_frame().

 So, when I use this with an axes created for a Basemap, I can't get 
 the thickness of the frame around the axes to change.

 I'm using Basemap 0.99.2.

 The code demonstrating the issue is attached, and the relevant lines 
 of code are near the bottom of the script.

 Thanks,

 Mike

 Christopher Brown wrote:
 Hi Michael,

 MH The Axes object has a method for turning on the frame:
 MH set_frame_on().   How do I set the thickness of the frame that
 MH appears?

 I use:

 plt.gca().get_frame().set_linewidth(2)




 

 --
 Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
 software. With Adobe AIR, Ajax developers can use existing skills and code to
 build responsive, highly engaging applications that combine the power of local
 resources and data with the reach of the web. Download the Adobe AIR SDK and
 Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
 

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-- 
Jeffrey S. Whitaker Phone  : (303)497-6313
Meteorologist   FAX: (303)497-6449
NOAA/OAR/PSD  R/PSD1Email  : jeffrey.s.whita...@noaa.gov
325 BroadwayOffice : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-04 Thread Jae-Joon Lee
 Actually, I just went back and found a reply from Jae-Joon to a post of
 mine in November about this. He points out that get_frame() is
 deprecated, but that gca().frame.set_linewidth(2) should work. This is
 not working for me either now (it was at the time), and now that I
 notice, I am also unable to change the tick width the way I used to:

 for tl in pp.gca().get_xticklines() + pp.gca().get_yticklines():
 tl.set_markeredgewidth(2)

 ...and I also can get invert_yaxis() (or xaxis) to work either.

 I'm on windows, using 0.98.5, ang Qt4Agg backend. I get no warnings or
 errors. Does anyone have any ideas?


Christopher,

Everything works fine for me.
Can it be just that the canvas is not redrawn after you set the linewidth?
It will be helpful if you post a standalone script that reproduces your problem.
Regards,

-JJ

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users