Hi

The option to set the edge of a mpl canvas isn't working properly - it's
out by one pixel on the top and right hand sides. Python 2.6.6, wx, mpl
1.0.

Could this be added to the bug list to be fixed please?

Thx

David

import wx
from wx.lib.scrolledpanel import ScrolledPanel
import matplotlib as mpl
from matplotlib.figure import Figure
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg

app = wx.PySimpleApp()
frame = wx.Frame(None, id=wx.ID_ANY, name="mainFrame", size=(500,500))

panel = wx.Panel(frame)

# create a scrollablePanel to hold the canvas        
scrollablePanel = ScrolledPanel(parent=panel, id=wx.ID_ANY,
name="scrolledPanel", style=wx.ALWAYS_SHOW_SB)
scrollablePanel.SetupScrolling()
scrollablePanel.SetBackgroundColour(wx.Colour(128,128,128))

# create mpl canvas and figure
mplFigure = Figure(figsize=(5,5), facecolor="white", edgecolor="black")
mplFigureCanvas = FigureCanvasWxAgg(parent=scrollablePanel,
id=wx.ID_ANY, figure=mplFigure)

# center the FigureCanvas inthe scrollablePanel
sizer1 = wx.BoxSizer(wx.VERTICAL)
sizer1.Add(mplFigureCanvas, proportion=0,
flag=wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, border=8)
sizer2 = wx.BoxSizer(wx.HORIZONTAL)
sizer2.Add(sizer1, proportion=1, flag=wx.ALIGN_CENTER_VERTICAL)
scrollablePanel.SetSizer(sizer2)

# use another sizer to add the scrollablePanel to the main panel
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(scrollablePanel, 1, wx.LEFT | wx.EXPAND)

panel.SetSizer(sizer)

mplFigure.clear()
ax1 = mplFigure.add_subplot(111)
mplFigureCanvas.draw()

frame.Show()
app.MainLoop()
Visit our website at http://www.ubs.com 

This message contains confidential information and is intended only 
for the individual named. If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail. Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system. 

E-mails are not encrypted and cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses. The sender 
therefore does not accept liability for any errors or omissions in the 
contents of this message which arise as a result of e-mail transmission. 
If verification is required please request a hard-copy version. This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities 
or related financial instruments. 

UBS Limited is a company limited by shares incorporated in the United 
Kingdom registered in England and Wales with number 2035362. 
Registered office: 1 Finsbury Avenue, London EC2M 2PP.  UBS Limited 
is authorised and regulated by the Financial Services Authority. 

UBS AG is a public company incorporated with limited liability in 
Switzerland domiciled in the Canton of Basel-City and the Canton of 
Zurich respectively registered at the Commercial Registry offices in 
those Cantons with Identification No: CH-270.3.004.646-4 and having 
respective head offices at Aeschenvorstadt 1, 4051 Basel and 
Bahnhofstrasse 45, 8001 Zurich, Switzerland.  Registered in the 
United Kingdom as a foreign company with No: FC021146 and having a 
UK Establishment registered at Companies House, Cardiff, with No:  
BR 004507.  The principal office of UK Establishment: 1 Finsbury Avenue, 
London EC2M 2PP.  In the United Kingdom, UBS AG is authorised and 
regulated by the Financial Services Authority.

UBS reserves the right to retain all messages. Messages are protected 
and accessed only in legally justified cases. 
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to