I'm updating wx.lib.plot

Douglas Thor <[email protected]>
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>
Hello,

I've decided to make some updates to wx.lib.plot.

You can see progress here: https://github.com/dougthor42/Phoenix


Here are my proposed changes:

   - [x] Add `drawstyle` option to PolyLine class which mimics matplotlib's 
   Line2D.drawstyle option.
       See the matplotlib Line2D.set_drawstyle docs 
   <http://matplotlib.org/api/lines_api.html#matplotlib.lines.Line2D.set_drawstyle> 
   for some more information.
   - [ ] Mage gridlines and axes more customizable.
       Update PlotCanvas._drawAxes by separating out the grid, axes, and 
   tick drawing
       Add new options: _gridStyle, _axesStyle, _tickStyle and their 
   related methods.
       For example, I haven't found an easy way to set the grid style to 
   dashed while keeping the axes solid.
   - [x] Fix FutureWarning: Replace instances of `x == None` with `x is 
   None`.


As I work on this I'll continue to update the list with other changes that 
I make. Once I feel like things are complete, I'll submit the PR to github.


I do have a question though:
plot.PlotCanvas uses various methods like 'GetEnableGrid' and 
'SetEngbleGrid' to access private attributes. Would you want new private 
attributes to use @property? I would think that we'd want to keep the 
current way so that the API is similar to the rest of the module. If 
desired, I could go through and switch everything to @properties, but that 
would be a pretty big API change.

Example using the new _gridStyle that I'm implementing.

----- Current Way -----
def GetGridStyle(self):
    return self._gridStyle

def SetGridStyle(self, style):
    if isinstance(style, wx.PenStyle):
        self._gridStyle = style
    else:
        raise TypeError("`style` must be an instance of wx.PenStyle")
-----------------------


----- Property Way -----
@property
def gridStyle(self):
    return self._gridStyle

@gridStyle.setter
def gridStyle(self, style):
    if isinstance(style, wx.PenStyle):
        self._gridStyle = style
    else:
        raise TypeError("`style` must be an instance of wx.PenStyle")
------------------------

-- 
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.