Commit Graph

29 Commits

Author SHA1 Message Date
Douglas Thor
9d3f510383 Updated changelog. 2016-05-27 14:18:41 -07:00
dougthor42
2e70f53fd6 Updates for lib.plot.py to include histograms and bar charts.
+ Added PolyBars class for bar charts
+ Added PolyHistogram class for histograms
  + lots of duplicate code from PolyBars - should look into making a parent class.
+ Added demos draw9 and draw10 for histogram and bar charts, respectively
  + added required menu items
+ updated plotNN menu items status-bar text to be descriptive.
+ increased default size of demo - menus were sometimes covering the status bar.
+ updated XSpec and YSpec to accept a list or tuple of (min, max) values.
+ Updated default size of TestFrame to be a bit bigger.
2016-05-27 14:09:40 -07:00
Douglas Thor
37581e2cd7 Stared work on Symmetric Log Scale, other minor updates.
+ Started work on Symmetric Log Scale (see http://matplotlib.org/examples/pylab_examples/symlog_demo.html)
+ Added some TODOs
+ Fixed BoxPlot so that jitter is not recalculated on every draw event.
+ Removed some redundant error checking in PlotGraphics.LogScale and AbsScale
2015-09-15 16:57:08 -07:00
Douglas Thor
12c6a097dc Doc updates, refactoring of GridLines, removal of unused API
+ moved all line calculation of PolyLine to path method
+ Refactoring of PlotCanvas
  + moved around attribute initialization in PlotCanvas.__init__
  + Removed extra API such as GetGridPen, GridColor, AxesLocation, etc. (these
    were ones that I added at the start of this PR)
  + Changed various occurrences of "if type(x) == y" to "if isinstance(x, y)"
    + also occurrences of "if value not in [True, False]" to "is not isinstance(value, bool)"
  + Added docstrings (still incomplete though)
  + Fixed some cases where the private attribute was being get/set directly rather than via the public properties
  + Changed GridLines API to be 2-tuple of bools rather than True, False, 'Horizontal', 'Vertical'
  + Refactored drawing of gridlines
    + now only 1 line is drawn for each tick rather than two lines that meet in the middle
    + easier to understand
  + removed some extra variable declarations in _drawTicks
  + Ticks are now drawn on top of gridlines
  + Changes to Demo
    + "25000 pts" plot now plots random (normal distribution) points.
    + "draw2" now demos the step function (drawstyle) of PolyLine
    + Grid on/off menu items changed to submenu
    + moved all check/uncheck logic to separate private methods
2015-08-21 12:47:13 -07:00
Douglas Thor
099bbdef96 Fixed box plot median line issue, added 3rd example box plot.
+ Changed box plot pen caps to be wx.CAP_BUTT - this fixes issues where the median line extended outside the box.
+ Updated some documentation
+ Removed Chart object and additional unused chart classes (histogram, pareto, etc.)
  + Looks like there needs to be a full architecture change in order to add these properly.
  + Will wait for this PR to be accepted before starting work on Charts.
2015-08-20 12:35:22 -07:00
Douglas Thor
9592e4d32a Documentation updates, bugfixes for box plot
+ Added and updated docstrings for some functions.
+ Box Plot updates and bugfixes
  + point-snap now only snaps to outliers, fence, and quartiles as intended,
    rather than snapping to all points.
  + Box plots now require 2D data, where the 1st dimension is the x location
    + this mimics the bar chart workaround.
  + Moved outlier calculation to separate method
+ Updated some error texts to be a bit more clear
+ Starting work on Chart class again. We'll see if I get anywhere with it...
2015-08-19 14:25:32 -07:00
Douglas Thor
ee2b440db5 Minor PEP8 changes, added pylint:disable for some pylint items. 2015-08-17 17:29:00 -07:00
Douglas Thor
0f974a9e60 Added individual control of Axes, axes values, and ticks
+ Added _DisplaySide class
  + this class is uses for storing the booleans associated with display various sides of
    the plot. Basically it's a fancy structure for a list of 4 boolean values (bottom,
    left, top, right). We'll see if I actually keep it.
  + Slightly reminiscent of a collections.namedtuple
  + Has type and value checking when setting attributes
+ Changed ticks, axes, and axesValues to use the _DisplaySide class to determine
  which sides of each to show.
+ Changed setters for EnableTicks, EnableAxes, and EnableAxesValues to essentially have
  overload methods:
  + self.EnableTicks = True   # enables all ticks
  + self.EnableTicks = (True, True)   # enables Bottom and left only
  + self.EnableTicks = (True, True, True, True)   # enables all ticks
+ removed last call to _titleEnabled, replaced with EnablePlotTitle property.
  + TODO: add deprecation warning to EnableTitle property (replaced by EnablePlotTitle)
+ Changed _drawTicks, _drawAxes, _drawAxesValues to draw each side independently.
+ Added demo items for all of the above.
+ Fixed issue in demo where Zoom and Drag menu items would be incorrectly set to checked
  when the other was disabled.
2015-08-17 15:54:33 -07:00
Douglas Thor
0e19dcc948 Added individual axis display control, updated menus in demo
+ Added a NamedTuple for axis show/hide booleans
+ Move things around in the demo menus.
+ Updated EnableAxes.setter to account for 3 usage cases:
  + bool: turn all axis on/off
  + 2-tuple of bool: only control bottom and left
  + 4-tuple of bool: individual control of all 4 axes
2015-08-12 17:36:01 -07:00
Douglas Thor
a756c502aa Refactoring and starting to add separate class for plots that have discrete X values
+ Added SavedPen context manager
  + Changed SavePen decorator to use this CM.
+ Added option for Log10 and Abs on X and Y scales (AbsScale property)
  + Added demo for both
+ Changed instances of __getattr__ (which took care of returning log10 data) to
  property accessors.
  + Changed logic of log10 transform to account for AbsScale property
  + Data is still stored internally as non-transformed data.
+ Updates to BoxPlot
  + Hacked together something that allows multiple box plots on the same chart.
    + I'm not happy with it, which is why I've started working on a separate class called
      'Chart' which will handle data that uses discrete x-axis values (such as BoxPlot,
       Pareto, and BarChart).
  + Separated out each draw action to different methods
  + Verified that getClosestPoint works OK for now
  + Added TODO list to docstring
+ Fixed a few getters/setters that I'd previously missed when converting to properties.
+ Changed grid to be ON by default
+ Changed comments to docstrings on _drawXObjects functions
+ Changed some demos to include negative data to show off AbsScale functionality
+ Changed _draw4Objects demo so that the line is visible
2015-08-10 17:10:51 -07:00
Douglas Thor
b69feea0d4 Added BoxPlot
Added ability to plot a box plot.
Added demo of box plot.
Added connecting line to _draw2Objects in demo.

TODO:
  + customization
  + refactoring
  + documentation
  + other (see TODO in BoxPlot.draw method)
2015-08-08 10:09:57 -07:00
Douglas Thor
7851def54d Updated menu names to include short description of what's plotted. 2015-08-04 17:56:56 -07:00
Douglas Thor
0b600f4eeb Documentation updates
Switched things to reStructuredText
2015-08-04 10:45:37 -07:00
Douglas Thor
5cb14aa820 Moved Title and Label drawing to separate methods
+ changed instances of time.clock to time.perf_counter (Python 3.3+)
+ Moved drawing of plot title and axes label to separate methods
+ Made drawing of axes labels a attribute of PlotCanvas.
+ Added ability to turn axes labels or plot title on and off individually
  + Added demo for this
2015-08-03 22:26:39 -07:00
Douglas Thor
0ad2d04874 PEP8/PyLint and other formatting updates. 2015-08-03 21:27:14 -07:00
Douglas Thor
6a2d1b8a51 API changes
+ Fixed minor formatting issues in docstrings and comments
+ Added deprecation warnings to getters and setters
  + replaced with properties
  + Added PendingDeprecation decorator to do this
  + all instances of getters/setters have been replaced with property accessors
+ All objects now explicitly inherit from `object`
+ Changed new customization options to use a wx.Pen instance instead of separate Colour, Width, and Style properties
  + left _gridColour since it's old API
2015-08-03 18:31:24 -07:00
Douglas Thor
8a3584dc6a Added properties to most getters/setters. 2015-08-03 13:36:20 -07:00
Douglas Thor
ab45d7e42c Major updates to plot.py.
+ Fixed error where wxFlexGridSizer.AddGrowableRow would throw 'invalid row index'
  + Moved sizer.AddGrowableRow to after setting the sizer in PlotCanvas
+ Added 'drawstyle' option to PolyLine which mimmics matplotlib's 'drawstyle' option
+ Added decorator that will reset the dc pen after a function call
+ Fixed FutureWarning errors for `x == None` (replaced with `x is None`)
+ Added more options for plot display
  + Color, style, and width options for: grid, centerline, ticks, axes, diagonal
  + length for: ticks
  + Location (bottom, left, top, right) for: ticks, axes     # TODO: API rename?
+ Moved drawing of plot items to separate private methods (previously all in _drawAxes)
  + _drawPlotAreaItems: draws each plot area item
+ Added menu items to demo which shows off new options.
2015-08-03 12:28:38 -07:00
Robin Dunn
6ef7d83d97 Apply patch updating wx.lib.plot, closes #16590
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@78006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-11 19:58:21 +00:00
Robin Dunn
4ff09cf185 Apply patch #16590 to plot.py, removes support for oldnumeric.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@77976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-08 04:33:33 +00:00
Robin Dunn
bcbdcd9631 Remove more CVS $Id$ and $Revision$ tags, and a bit of code that uses them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-11 03:35:32 +00:00
Robin Dunn
2fb6f00867 PR 42 from Metallicow. Py3 and Phoenix updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75603 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-11 23:13:15 +00:00
Robin Dunn
9f24505715 Merge of PR 11 with the whitespace-only changes omitted.
See https://github.com/RobinD42/Phoenix/pull/11

Mostly phoenix-port changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-10 01:15:34 +00:00
Robin Dunn
48a7ecdd85 Remove all BeginDrawing/EndDrawing calls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-13 07:43:45 +00:00
Robin Dunn
c58fc0bbe4 plot Phoenix Fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-13 07:18:57 +00:00
Robin Dunn
280d9e9e86 Only try to import numpy, the others are just way too old. See #3147, #4130
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73253 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-12-22 08:01:17 +00:00
Robin Dunn
247673201b Copy (branch) wx.lib, wx.py and wx.tools from Classic, and include subpackages branched from 3rdParty
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-13 01:36:07 +00:00
Robin Dunn
a30dfe91e2 I wasn't ready to add this yet.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-22 21:29:15 +00:00
Robin Dunn
c8c2e1d97b set svn:eol-style to native
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71832 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-22 21:02:42 +00:00