This is driving me crazy.... I've tried setting the axes' frame's
edgecolor but nothing I try lets me get rid of or
change the color of the black border around my axes. What is the
recommend way of doing this, or is it even possible?
(screenshot of my current results attached.)
Thanks for any enlightenment. :)
Peter L. Buschman wrote:
> Okay, removing the frame turns out to work like this.
> setp(ax, frame_on=False)
I'm new to matplotlib, and I can't even get this to work (let alone the
other fix of changing the colors). Could you elaborate about how to
implement this? I've tried putting these lines in the __init__ of the
PlotPanel() class, but I can't get it. Any help is appreciated, thank you.
View this message in context: http://www.nabble.com/Removing-the-black-border-around-a-plot--tf3409211.html#a9785048
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Ken McIvor <mcivor@ii...> - 2007-04-03 15:51:42
On Apr 1, 2007, at 11:27 PM, Chelonian wrote:
> I'm new to matplotlib, and I can't even get this to work (let alone
> other fix of changing the colors). Could you elaborate about how to
> implement this? I've tried putting these lines in the __init__ of the
> PlotPanel() class, but I can't get it. Any help is appreciated,
> thank you.
It sounds like you're using WxMpl to embed matplotlib in something.
If that's the case, you should look at the example code below.
Otherwise, please send a short example script to the list.
Also, please note that disabling the frame effectively makes the
figure's background transparent when using the WXAgg backend. I'm
not sure if this is the intended behavior. If that's not what you
want, you can probably just set the Figure's face and edge colors to
the same thing using Figure.set_edgecolor() and Figure.set_facecolor().
def __init__(self, parent, id, **kwds):
wxmpl.PlotPanel.__init__(self, parent, id, **kwds)
fig = self.get_figure()
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = wx.Frame(None, -1, 'Frame Off')
panel = MyPlotPanel(frame, -1)
szr = wx.BoxSizer(wx.VERTICAL)
szr.Add(panel, 1, wx.EXPAND|wx.ALL, 5)
axes = panel.get_figure().gca()