wxmplot 0.9.18__tar.gz → 0.9.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wxmplot-0.9.18 → wxmplot-0.9.20}/PKG-INFO +2 -1
- {wxmplot-0.9.18 → wxmplot-0.9.20}/README.txt +2 -2
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/installation.rst +69 -66
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/plotpanel.rst +2 -1
- wxmplot-0.9.20/examples/__pycache__/tifffile.cpython-35.pyc +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/contour.py +0 -4
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/demo.py +12 -11
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/floatcontrol.py +2 -11
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/floatcontrol.pyc +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/image.py +1 -3
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/leftright.py +0 -3
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/multiplot.py +2 -1
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/pilatus_display.py +0 -4
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/scatterplot.py +2 -9
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/simple.py +1 -7
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/stripchart.py +6 -9
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/tiff_display.py +1 -5
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/tifffile.pyc +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/__init__.py +7 -14
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/baseframe.py +1 -1
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/basepanel.py +7 -3
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/colors.py +4 -4
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/config.py +10 -3
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/imageframe.py +8 -4
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/imagepanel.py +3 -1
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/multiframe.py +2 -3
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/plotconfigframe.py +34 -5
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/plotpanel.py +23 -8
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/utils.py +12 -9
- {wxmplot-0.9.18 → wxmplot-0.9.20}/setup.py +1 -1
- wxmplot-0.9.18/doc/.DS_Store +0 -0
- wxmplot-0.9.18/doc/images/.DS_Store +0 -0
- wxmplot-0.9.18/examples/Demo_py2app.py +0 -48
- wxmplot-0.9.18/examples/Test_Plot.png +0 -0
- wxmplot-0.9.18/examples/ceo2.tiff +0 -0
- wxmplot-0.9.18/examples/dislin_comp.spec +0 -33
- wxmplot-0.9.18/examples/elements.pyc +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/ChangeLog +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/LICENSE.txt +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/MANIFEST.in +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/Makefile +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/_static/empty +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/_templates/indexsidebar.html +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/conf.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/imagepanel.rst +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/images/basic_screenshot.png +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/images/configuration_frame.png +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/images/contour.png +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/images/image_3color.png +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/images/image_3color_white.png +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/images/imagedisplay.png +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/images/multiplot.png +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/images/scatterplot.png +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/images/two_axes.png +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/doc/index.rst +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/Pilatus.tiff +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/basic_screenshot.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/dislin_comp.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/errorbar.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/plot_fromdatafile.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/plotapp.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/rgb_image.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/tifffile.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/time.dat +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/timedata.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/update_line.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/examples/xafs.dat +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/contourdialog.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/imageconf.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/ordereddict.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/plotapp.py +0 -0
- {wxmplot-0.9.18 → wxmplot-0.9.20}/lib/plotframe.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.1
|
|
2
2
|
Name: wxmplot
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.20
|
|
4
4
|
Summary: A library for plotting in wxPython using matplotlib
|
|
5
5
|
Home-page: http://newville.github.io/wxmplot/
|
|
6
6
|
Author: Matthew Newville
|
|
@@ -23,3 +23,4 @@ Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
|
23
23
|
Requires: wx
|
|
24
24
|
Requires: numpy
|
|
25
25
|
Requires: matplotlib
|
|
26
|
+
Requires: six
|
|
@@ -52,9 +52,9 @@ user can zoom in, rotate, or flip the image, and adjust the smoothing of
|
|
|
52
52
|
the image and adjust the color table and intensity scale.
|
|
53
53
|
|
|
54
54
|
Programmatically, one can make the same adjustments to an ImagePanel by
|
|
55
|
-
changing its configuaration attributes and
|
|
55
|
+
changing its configuaration attributes and running the redraw() method.
|
|
56
56
|
|
|
57
57
|
=====
|
|
58
58
|
|
|
59
|
-
last update:
|
|
59
|
+
last update: 2016-Oct-24 Matt Newville <newville@cars.uchicago.edu>
|
|
60
60
|
|
|
@@ -1,66 +1,69 @@
|
|
|
1
|
-
====================================
|
|
2
|
-
Downloading and Installation
|
|
3
|
-
====================================
|
|
4
|
-
|
|
5
|
-
Prerequisites
|
|
6
|
-
~~~~~~~~~~~~~~~
|
|
7
|
-
|
|
8
|
-
The wxmplot package requires
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
THE
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
====================================
|
|
2
|
+
Downloading and Installation
|
|
3
|
+
====================================
|
|
4
|
+
|
|
5
|
+
Prerequisites
|
|
6
|
+
~~~~~~~~~~~~~~~
|
|
7
|
+
|
|
8
|
+
The wxmplot package requires wxpython, matplotlib, numpy, and six.
|
|
9
|
+
|
|
10
|
+
For wxPython Classic, wxmplot works well with Python 2.7, but not Python 3.
|
|
11
|
+
Since matplotlib 1.5 introduced support for wxPython Phoenix, wxmplot also
|
|
12
|
+
works with matplotlib 1.5, wxPython Phoenix 3.0.3, and with both Python 2.7
|
|
13
|
+
and Python 3.5. As wxPython Phoenix is still in development (available at
|
|
14
|
+
http://wxpython.org/Phoenix/snapshot-builds/), support for it should be
|
|
15
|
+
viewed as provisional. Testing with Phoenix and with Python 3.5 has been
|
|
16
|
+
modest, but all wxmplot functionality appears to work.
|
|
17
|
+
|
|
18
|
+
Downloads
|
|
19
|
+
~~~~~~~~~~~~~
|
|
20
|
+
|
|
21
|
+
.. _github: http://github.com/newwville/wxmplot
|
|
22
|
+
.. _PyPI: http://pypi.python.org/pypi/wxmplot
|
|
23
|
+
|
|
24
|
+
The latest version is available from `PyPI`_ or `github`_, and the package
|
|
25
|
+
can be installed with::
|
|
26
|
+
|
|
27
|
+
pip install wxmplot
|
|
28
|
+
|
|
29
|
+
Development Version
|
|
30
|
+
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
31
|
+
|
|
32
|
+
To get the latest development version, use::
|
|
33
|
+
|
|
34
|
+
git clone http://github.com/newville/wxmplot.git
|
|
35
|
+
|
|
36
|
+
Installation from Source
|
|
37
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
38
|
+
|
|
39
|
+
wxmplot is a pure python module, so installation on all platforms can use the source kit::
|
|
40
|
+
|
|
41
|
+
tar xvzf wxmplot-0.9.XX.tar.gz
|
|
42
|
+
cd wxmplot-0.9.XX/
|
|
43
|
+
python setup.py install
|
|
44
|
+
|
|
45
|
+
You can also install with ``pip install wxmplot``, or for Anaconda Python,
|
|
46
|
+
using ``conda install -c newville wxmplot``
|
|
47
|
+
|
|
48
|
+
License
|
|
49
|
+
~~~~~~~~~~~~~
|
|
50
|
+
|
|
51
|
+
The wxmplot code is distribution under the following license:
|
|
52
|
+
|
|
53
|
+
Copyright (c) 2015 Matthew Newville, The University of Chicago
|
|
54
|
+
|
|
55
|
+
Permission to use and redistribute the source code or binary forms of this
|
|
56
|
+
software and its documentation, with or without modification is hereby
|
|
57
|
+
granted provided that the above notice of copyright, these terms of use,
|
|
58
|
+
and the disclaimer of warranty below appear in the source code and
|
|
59
|
+
documentation, and that none of the names of The University of Chicago or
|
|
60
|
+
the authors appear in advertising or endorsement of works derived from this
|
|
61
|
+
software without specific prior written permission from all parties.
|
|
62
|
+
|
|
63
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
64
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
65
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
66
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
67
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
68
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
69
|
+
DEALINGS IN THIS SOFTWARE.
|
|
@@ -82,7 +82,8 @@ many additional methods to interact with the plots.
|
|
|
82
82
|
|
|
83
83
|
.. method:: oplot(x, y, **kws)
|
|
84
84
|
|
|
85
|
-
Draw a plot of the numpy arrays *x* and *y*,
|
|
85
|
+
Draw a plot of the numpy arrays *x* and *y*, overplotting any existing
|
|
86
|
+
plot, so that both traces are visible.
|
|
86
87
|
|
|
87
88
|
The :meth:`oplot` method has many optional parameters, as listed in
|
|
88
89
|
:ref:`Table of Plot Arguments <plotopt_table>`
|
|
Binary file
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
if not hasattr(sys, 'frozen'):
|
|
3
|
-
import wxversion
|
|
4
|
-
wxversion.ensureMinimal('2.8')
|
|
5
|
-
|
|
6
2
|
import wx
|
|
3
|
+
is_wxPhoenix = 'phoenix' in wx.PlatformInfo
|
|
4
|
+
if is_wxPhoenix:
|
|
5
|
+
PyDeadObjectError = RuntimeError
|
|
6
|
+
else:
|
|
7
|
+
from wx._core import PyDeadObjectError
|
|
8
|
+
|
|
7
9
|
import time, os, sys
|
|
8
10
|
|
|
9
11
|
from numpy import arange, sin, cos, exp, pi, linspace, ones, random
|
|
@@ -22,17 +24,16 @@ class TestFrame(wx.Frame):
|
|
|
22
24
|
self.SetFont(wx.Font(12,wx.SWISS,wx.NORMAL,wx.BOLD,False))
|
|
23
25
|
menu = wx.Menu()
|
|
24
26
|
ID_EXIT = wx.NewId()
|
|
25
|
-
ID_TIMER = wx.NewId()
|
|
26
27
|
|
|
27
|
-
menu.Append(ID_EXIT, "E&xit", "Terminate the program")
|
|
28
|
+
menu_exit = menu.Append(ID_EXIT, "E&xit", "Terminate the program")
|
|
28
29
|
|
|
29
30
|
menuBar = wx.MenuBar()
|
|
30
31
|
menuBar.Append(menu, "&File");
|
|
31
32
|
self.SetMenuBar(menuBar)
|
|
32
33
|
|
|
33
|
-
wx.EVT_MENU
|
|
34
|
+
self.Bind(wx.EVT_MENU, self.OnExit, menu_exit)
|
|
34
35
|
|
|
35
|
-
self.Bind(wx.EVT_CLOSE,self.OnExit) # CloseEvent)
|
|
36
|
+
self.Bind(wx.EVT_CLOSE, self.OnExit) # CloseEvent)
|
|
36
37
|
|
|
37
38
|
self.plotframe = None
|
|
38
39
|
|
|
@@ -79,8 +80,8 @@ class TestFrame(wx.Frame):
|
|
|
79
80
|
self.SetSizer(framesizer)
|
|
80
81
|
framesizer.Fit(self)
|
|
81
82
|
|
|
82
|
-
wx.EVT_TIMER
|
|
83
|
-
self.timer = wx.Timer(self
|
|
83
|
+
self.Bind(wx.EVT_TIMER, self.onTimer)
|
|
84
|
+
self.timer = wx.Timer(self)
|
|
84
85
|
self.Refresh()
|
|
85
86
|
|
|
86
87
|
def create_data(self):
|
|
@@ -105,7 +106,7 @@ class TestFrame(wx.Frame):
|
|
|
105
106
|
self.has_plot = False
|
|
106
107
|
try:
|
|
107
108
|
self.plotframe.Show()
|
|
108
|
-
except
|
|
109
|
+
except PyDeadObjectError:
|
|
109
110
|
self.plotframe = PlotFrame(self)
|
|
110
111
|
self.plotframe.Show()
|
|
111
112
|
|
|
@@ -5,17 +5,9 @@ This is a collection of general purpose utility functions and classes,
|
|
|
5
5
|
especially useful for wx functionality
|
|
6
6
|
"""
|
|
7
7
|
import sys
|
|
8
|
-
try:
|
|
9
|
-
if not hasattr(sys, 'frozen'):
|
|
10
|
-
import wxversion
|
|
11
|
-
wxversion.ensureMinimal('2.8')
|
|
12
|
-
except:
|
|
13
|
-
pass
|
|
14
|
-
|
|
15
8
|
import wx
|
|
16
9
|
import wx.lib.masked as masked
|
|
17
10
|
|
|
18
|
-
import fpformat
|
|
19
11
|
import numpy
|
|
20
12
|
|
|
21
13
|
|
|
@@ -210,7 +202,8 @@ class FloatCtrl(wx.TextCtrl):
|
|
|
210
202
|
|
|
211
203
|
def GetValue(self):
|
|
212
204
|
if self.__prec > 0:
|
|
213
|
-
|
|
205
|
+
fmt = "{{:.{:d}f}}".format(self.__prec)
|
|
206
|
+
return set_float(fmt.format(self.__val))
|
|
214
207
|
else:
|
|
215
208
|
return int(self.__val)
|
|
216
209
|
|
|
@@ -252,5 +245,3 @@ class FloatCtrl(wx.TextCtrl):
|
|
|
252
245
|
self.SetForegroundColour(fgcol)
|
|
253
246
|
self.SetBackgroundColour(bgcol)
|
|
254
247
|
self.Refresh()
|
|
255
|
-
|
|
256
|
-
|
|
Binary file
|
|
@@ -14,6 +14,8 @@ y4 = numpy.cos(2*x)*numpy.exp(-x/10.)
|
|
|
14
14
|
app = wx.App()
|
|
15
15
|
|
|
16
16
|
pframe = wxmplot.MultiPlotFrame(rows=2,cols=3,panelsize=(2.5,1.75))
|
|
17
|
+
|
|
18
|
+
|
|
17
19
|
pframe.plot(x,y1,panel=(0,0))
|
|
18
20
|
pframe.plot(x,y2,panel=(0,1))
|
|
19
21
|
pframe.plot(x,y3,panel=(1,1))
|
|
@@ -26,4 +28,3 @@ pframe.Show()
|
|
|
26
28
|
pframe.Raise()
|
|
27
29
|
|
|
28
30
|
app.MainLoop()
|
|
29
|
-
|
|
@@ -3,19 +3,14 @@
|
|
|
3
3
|
# scatterplot example, with lassoing and
|
|
4
4
|
# a user-level lasso-callback
|
|
5
5
|
import sys
|
|
6
|
-
if not hasattr(sys, 'frozen'):
|
|
7
|
-
import wxversion
|
|
8
|
-
wxversion.ensureMinimal('2.8')
|
|
9
|
-
|
|
10
|
-
import wxmplot
|
|
11
|
-
|
|
12
6
|
import wx
|
|
7
|
+
import wxmplot
|
|
13
8
|
import numpy
|
|
14
9
|
|
|
15
10
|
x = numpy.arange(100)/20.0 + numpy.random.random(size=100)
|
|
16
11
|
y = numpy.random.random(size=len(x))
|
|
17
12
|
def onlasso(data=None, selected=None, mask=None):
|
|
18
|
-
print ':: lasso ', selected
|
|
13
|
+
print( ':: lasso ', selected)
|
|
19
14
|
|
|
20
15
|
app = wx.App()
|
|
21
16
|
|
|
@@ -28,5 +23,3 @@ pframe.write_message('WXMPlot PlotFrame example: Try Help->Quick Reference')
|
|
|
28
23
|
pframe.Show()
|
|
29
24
|
#
|
|
30
25
|
app.MainLoop()
|
|
31
|
-
|
|
32
|
-
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
import time
|
|
3
3
|
import numpy as np
|
|
4
4
|
import sys
|
|
5
|
-
if not hasattr(sys, 'frozen'):
|
|
6
|
-
import wxversion
|
|
7
|
-
wxversion.ensureMinimal('2.8')
|
|
8
|
-
|
|
9
5
|
import wx
|
|
10
6
|
from wx.lib import masked
|
|
11
7
|
from floatcontrol import FloatCtrl
|
|
@@ -34,16 +30,17 @@ class StripChartFrame(wx.Frame):
|
|
|
34
30
|
ID_EXIT = wx.NewId()
|
|
35
31
|
ID_TIMER = wx.NewId()
|
|
36
32
|
|
|
37
|
-
menu.Append(ID_EXIT, "E&xit",
|
|
33
|
+
menu_exit = menu.Append(ID_EXIT, "E&xit",
|
|
34
|
+
"Terminate the program")
|
|
38
35
|
|
|
39
36
|
menuBar = wx.MenuBar()
|
|
40
37
|
menuBar.Append(menu, "&File");
|
|
41
38
|
self.SetMenuBar(menuBar)
|
|
42
39
|
|
|
43
|
-
wx.EVT_MENU
|
|
40
|
+
self.Bind(wx.EVT_MENU, self.OnExit, menu_exit)
|
|
44
41
|
self.Bind(wx.EVT_CLOSE, self.OnExit)
|
|
45
42
|
|
|
46
|
-
sbar = self.CreateStatusBar(2,wx.CAPTION
|
|
43
|
+
sbar = self.CreateStatusBar(2,wx.CAPTION)
|
|
47
44
|
sfont = sbar.GetFont()
|
|
48
45
|
sfont.SetWeight(wx.BOLD)
|
|
49
46
|
sfont.SetPointSize(11)
|
|
@@ -83,8 +80,8 @@ class StripChartFrame(wx.Frame):
|
|
|
83
80
|
self.SetSizer(mainsizer)
|
|
84
81
|
mainsizer.Fit(self)
|
|
85
82
|
|
|
86
|
-
wx.EVT_TIMER
|
|
87
|
-
self.timer = wx.Timer(self
|
|
83
|
+
self.Bind(wx.EVT_TIMER, self.onTimer)
|
|
84
|
+
self.timer = wx.Timer(self)
|
|
88
85
|
self.Refresh()
|
|
89
86
|
|
|
90
87
|
def write_message(self, msg, panel=0):
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
if not hasattr(sys, 'frozen'):
|
|
3
|
-
import wxversion
|
|
4
|
-
wxversion.ensureMinimal('2.8')
|
|
5
|
-
|
|
6
2
|
import wx
|
|
7
3
|
from tifffile import imread
|
|
8
4
|
from wxmplot import ImageFrame
|
|
9
5
|
|
|
10
|
-
img = imread(
|
|
6
|
+
img = imread('Pilatus.tiff')
|
|
11
7
|
|
|
12
8
|
app = wx.App()
|
|
13
9
|
frame = ImageFrame()
|
|
Binary file
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
#
|
|
3
3
|
# Name: wxmplot
|
|
4
|
-
# Version: 0.9.
|
|
5
|
-
#
|
|
4
|
+
# Version: 0.9.20
|
|
5
|
+
# user-configurable 2D plotting module, using wxPython
|
|
6
6
|
# and matplotlib.
|
|
7
7
|
# Author: Matthew Newville
|
|
8
|
-
# Copyright: Matthew Newville, The University of Chicago,
|
|
8
|
+
# Copyright: Matthew Newville, The University of Chicago, 2016
|
|
9
9
|
# Licence: BSD license
|
|
10
|
-
# Updated:
|
|
10
|
+
# Updated: 2016/11/22
|
|
11
11
|
#-----------------------------------------------------------------------------
|
|
12
12
|
|
|
13
13
|
"""
|
|
@@ -64,18 +64,11 @@ these basic methods:
|
|
|
64
64
|
save_figure(): bring up file dialog for saving image of figure
|
|
65
65
|
"""
|
|
66
66
|
|
|
67
|
-
__version__ = '0.9.
|
|
68
|
-
__date__ = '
|
|
67
|
+
__version__ = '0.9.20'
|
|
68
|
+
__date__ = '2016-Nov-22'
|
|
69
69
|
|
|
70
70
|
import sys
|
|
71
|
-
|
|
72
|
-
if not hasattr(sys, 'frozen'):
|
|
73
|
-
import wxversion
|
|
74
|
-
wxversion.ensureMinimal('2.8')
|
|
75
|
-
except ImportError:
|
|
76
|
-
pass
|
|
77
|
-
except: # probably a useless exception from ensureMinimal() about wx already being Imported.
|
|
78
|
-
pass
|
|
71
|
+
import wx
|
|
79
72
|
|
|
80
73
|
from .baseframe import BaseFrame
|
|
81
74
|
from .plotframe import PlotFrame
|
|
@@ -127,7 +127,7 @@ Matt Newville <newville@cars.uchicago.edu>""" % __version__
|
|
|
127
127
|
####
|
|
128
128
|
def BuildFrame(self):
|
|
129
129
|
# Python3 note: wxPython has no THICK_FRAME
|
|
130
|
-
sbar = self.CreateStatusBar(2, wx.CAPTION
|
|
130
|
+
sbar = self.CreateStatusBar(2, wx.CAPTION)
|
|
131
131
|
sfont = sbar.GetFont()
|
|
132
132
|
sfont.SetWeight(wx.BOLD)
|
|
133
133
|
sfont.SetPointSize(10)
|
|
@@ -7,6 +7,8 @@ import sys
|
|
|
7
7
|
import time
|
|
8
8
|
import os
|
|
9
9
|
import wx
|
|
10
|
+
is_wxPhoenix = 'phoenix' in wx.PlatformInfo
|
|
11
|
+
|
|
10
12
|
import matplotlib
|
|
11
13
|
from matplotlib.widgets import Lasso
|
|
12
14
|
from matplotlib import dates
|
|
@@ -194,7 +196,7 @@ class BasePanel(wx.Panel):
|
|
|
194
196
|
defaultDir = os.getcwd(),
|
|
195
197
|
defaultFile=ofile,
|
|
196
198
|
wildcard=file_choices,
|
|
197
|
-
style=wx.
|
|
199
|
+
style=wx.FD_SAVE|wx.FD_CHANGE_DIR)
|
|
198
200
|
|
|
199
201
|
if dlg.ShowModal() == wx.ID_OK:
|
|
200
202
|
path = dlg.GetPath()
|
|
@@ -473,14 +475,16 @@ class BasePanel(wx.Panel):
|
|
|
473
475
|
zdc.SetBrush(wx.TRANSPARENT_BRUSH)
|
|
474
476
|
zdc.SetPen(wx.Pen('White', 2, wx.SOLID))
|
|
475
477
|
zdc.ResetBoundingBox()
|
|
476
|
-
|
|
478
|
+
if not is_wxPhoenix:
|
|
479
|
+
zdc.BeginDrawing()
|
|
477
480
|
|
|
478
481
|
# erase previous box
|
|
479
482
|
if self.rbbox is not None:
|
|
480
483
|
zdc.DrawRectangle(*self.rbbox)
|
|
481
484
|
self.rbbox = (x0, y0, width, height)
|
|
482
485
|
zdc.DrawRectangle(*self.rbbox)
|
|
483
|
-
|
|
486
|
+
if not is_wxPhoenix:
|
|
487
|
+
zdc.EndDrawing()
|
|
484
488
|
|
|
485
489
|
def zoom_leftdown(self, event=None):
|
|
486
490
|
"""leftdown event handler for zoom mode"""
|
|
@@ -4,6 +4,7 @@ color support for MPlot.
|
|
|
4
4
|
|
|
5
5
|
"""
|
|
6
6
|
import numpy as np
|
|
7
|
+
import six
|
|
7
8
|
|
|
8
9
|
HAS_MPL = False
|
|
9
10
|
try:
|
|
@@ -327,7 +328,7 @@ def hexcolor(color):
|
|
|
327
328
|
" returns hex color given a tuple, wx.Color, or X11 named color"
|
|
328
329
|
# first, if this is a hex color already, return!
|
|
329
330
|
# Python 3: needs rewrite for str/unicode change
|
|
330
|
-
if isinstance(color,
|
|
331
|
+
if isinstance(color, six.string_types):
|
|
331
332
|
if color[0] == '#' and len(color)==7:
|
|
332
333
|
return color
|
|
333
334
|
|
|
@@ -337,7 +338,7 @@ def hexcolor(color):
|
|
|
337
338
|
rgb = color
|
|
338
339
|
elif isinstance(color, list):
|
|
339
340
|
rgb = tuple(color)
|
|
340
|
-
elif isinstance(color,
|
|
341
|
+
elif isinstance(color, six.string_types):
|
|
341
342
|
c = color.lower()
|
|
342
343
|
if c.find(' ')>-1: c = c.replace(' ','')
|
|
343
344
|
if c.find('gray')>-1: c = c.replace('gray','grey')
|
|
@@ -404,7 +405,7 @@ def register_custom_colormaps():
|
|
|
404
405
|
"""
|
|
405
406
|
registers custom color maps
|
|
406
407
|
"""
|
|
407
|
-
if not HAS_MPL:
|
|
408
|
+
if not HAS_MPL:
|
|
408
409
|
return ()
|
|
409
410
|
makemap = LinearSegmentedColormap.from_list
|
|
410
411
|
for name, val in custom_colormap_data.items():
|
|
@@ -417,4 +418,3 @@ def register_custom_colormaps():
|
|
|
417
418
|
|
|
418
419
|
return ('stdgamma', 'red_heat', 'green_heat', 'blue_heat',
|
|
419
420
|
'red', 'green', 'blue')
|
|
420
|
-
|
|
@@ -164,9 +164,9 @@ class PlotConfig:
|
|
|
164
164
|
def __init__(self, canvas=None): # trace_color_callback=None):
|
|
165
165
|
self.canvas = canvas
|
|
166
166
|
|
|
167
|
-
self.styles = StyleMap.keys()
|
|
168
|
-
self.drawstyles = DrawStyleMap.keys()
|
|
169
|
-
self.symbols = MarkerMap.keys()
|
|
167
|
+
self.styles = list(StyleMap.keys())
|
|
168
|
+
self.drawstyles = list(DrawStyleMap.keys())
|
|
169
|
+
self.symbols = list(MarkerMap.keys())
|
|
170
170
|
|
|
171
171
|
self.legend_locs = ['upper right' , 'lower right', 'center right',
|
|
172
172
|
'upper left', 'lower left', 'center left',
|
|
@@ -311,6 +311,9 @@ class PlotConfig:
|
|
|
311
311
|
for t in (ax.get_ticklabels() + ax.get_ticklines()):
|
|
312
312
|
t.set_color(self.textcolor)
|
|
313
313
|
self.set_added_text_size()
|
|
314
|
+
if self.mpl_legend is not None:
|
|
315
|
+
for t in self.mpl_legend.get_texts():
|
|
316
|
+
t.set_color(self.textcolor)
|
|
314
317
|
self.canvas.draw()
|
|
315
318
|
|
|
316
319
|
|
|
@@ -458,7 +461,11 @@ class PlotConfig:
|
|
|
458
461
|
self.mpl_legend = lgn(lins, labs,
|
|
459
462
|
loc=self.legend_loc,
|
|
460
463
|
prop=self.legendfont)
|
|
464
|
+
for t in self.mpl_legend.get_texts():
|
|
465
|
+
t.set_color(self.textcolor)
|
|
461
466
|
self.mpl_legend.draw_frame(self.show_legend_frame)
|
|
467
|
+
self.mpl_legend.legendPatch.set_facecolor(axes[0].get_axis_bgcolor())
|
|
468
|
+
|
|
462
469
|
self.set_added_text_size()
|
|
463
470
|
self.canvas.draw()
|
|
464
471
|
|
|
@@ -4,7 +4,11 @@ wxmplot ImageFrame: a wx.Frame for image display, using matplotlib
|
|
|
4
4
|
"""
|
|
5
5
|
import os
|
|
6
6
|
import wx
|
|
7
|
-
|
|
7
|
+
is_wxPhoenix = 'phoenix' in wx.PlatformInfo
|
|
8
|
+
if is_wxPhoenix:
|
|
9
|
+
PyDeadObjectError = RuntimeError
|
|
10
|
+
else:
|
|
11
|
+
from wx._core import PyDeadObjectError
|
|
8
12
|
|
|
9
13
|
import numpy as np
|
|
10
14
|
from matplotlib.cm import get_cmap
|
|
@@ -94,7 +98,7 @@ Keyboard Shortcuts: (For Mac OSX, replace 'Ctrl' with 'Apple')
|
|
|
94
98
|
self.config_mode = None
|
|
95
99
|
if subtitles is not None:
|
|
96
100
|
self.subtitles = subtitles
|
|
97
|
-
sbar = self.CreateStatusBar(2, wx.CAPTION
|
|
101
|
+
sbar = self.CreateStatusBar(2, wx.CAPTION)
|
|
98
102
|
sfont = sbar.GetFont()
|
|
99
103
|
sfont.SetWeight(wx.BOLD)
|
|
100
104
|
sfont.SetPointSize(10)
|
|
@@ -479,7 +483,7 @@ Keyboard Shortcuts: (For Mac OSX, replace 'Ctrl' with 'Apple')
|
|
|
479
483
|
cm_wid = 1.00
|
|
480
484
|
cm_ratio = 0.12
|
|
481
485
|
col = 'int'
|
|
482
|
-
self.cmap_dat[col] = np.outer(np.ones(cmax*cm_ratio),
|
|
486
|
+
self.cmap_dat[col] = np.outer(np.ones(int(cmax*cm_ratio)),
|
|
483
487
|
np.linspace(0, 1, cmax))
|
|
484
488
|
|
|
485
489
|
fig = Figure((cm_wid, cm_wid*cm_ratio), dpi=150)
|
|
@@ -787,7 +791,7 @@ Keyboard Shortcuts: (For Mac OSX, replace 'Ctrl' with 'Apple')
|
|
|
787
791
|
defaultDir=os.getcwd(),
|
|
788
792
|
defaultFile=ofile,
|
|
789
793
|
wildcard=file_choices,
|
|
790
|
-
style=wx.
|
|
794
|
+
style=wx.FD_SAVE|wx.FD_CHANGE_DIR)
|
|
791
795
|
|
|
792
796
|
if dlg.ShowModal() == wx.ID_OK:
|
|
793
797
|
self.cmap_canvas[col].print_figure(dlg.GetPath(), dpi=600)
|
|
@@ -73,6 +73,8 @@ class ImagePanel(BasePanel):
|
|
|
73
73
|
conf.log_scale = False
|
|
74
74
|
conf.rot, conf.flip_ud, conf.flip_lr = False, False, False
|
|
75
75
|
conf.highlight_areas = []
|
|
76
|
+
if 1 in data.shape:
|
|
77
|
+
data = data.squeeze()
|
|
76
78
|
self.data_shape = data.shape
|
|
77
79
|
self.data_range = [0, data.shape[1], 0, data.shape[0]]
|
|
78
80
|
|
|
@@ -300,7 +302,7 @@ class ImagePanel(BasePanel):
|
|
|
300
302
|
defaultDir = os.getcwd(),
|
|
301
303
|
defaultFile=ofile,
|
|
302
304
|
wildcard=file_choices,
|
|
303
|
-
style=wx.
|
|
305
|
+
style=wx.FD_SAVE|wx.FD_CHANGE_DIR)
|
|
304
306
|
|
|
305
307
|
if dlg.ShowModal() == wx.ID_OK:
|
|
306
308
|
self.writeASCIIFile(dlg.GetPath(), title=title)
|
|
@@ -101,7 +101,7 @@ class MultiPlotFrame(BaseFrame):
|
|
|
101
101
|
## create GUI
|
|
102
102
|
####
|
|
103
103
|
def BuildFrame(self):
|
|
104
|
-
sbar = self.CreateStatusBar(2,wx.CAPTION
|
|
104
|
+
sbar = self.CreateStatusBar(2,wx.CAPTION)
|
|
105
105
|
sfont = sbar.GetFont()
|
|
106
106
|
sfont.SetWeight(wx.BOLD)
|
|
107
107
|
sfont.SetPointSize(10)
|
|
@@ -119,7 +119,7 @@ class MultiPlotFrame(BaseFrame):
|
|
|
119
119
|
self.panels[(i,j)] = PlotPanel(self, size=self.panelsize)
|
|
120
120
|
self.panels[(i,j)].messenger = self.write_message
|
|
121
121
|
panel = self.panels[(i,j)]
|
|
122
|
-
|
|
122
|
+
|
|
123
123
|
sizer.Add(panel,(i,j),(1,1),flag=wx.EXPAND|wx.ALIGN_CENTER)
|
|
124
124
|
panel.reportLeftDown = Closure(self.reportLeftDown,
|
|
125
125
|
panelkey=(i,j))
|
|
@@ -147,4 +147,3 @@ class MultiPlotFrame(BaseFrame):
|
|
|
147
147
|
self.BindMenuToPanel(panel=self.panel)
|
|
148
148
|
self.panel.set_bg('#FEFEFA')
|
|
149
149
|
self.panel.canvas.draw()
|
|
150
|
-
|
|
@@ -43,6 +43,35 @@ def autopack(panel, sizer):
|
|
|
43
43
|
panel.SetSizer(sizer)
|
|
44
44
|
sizer.Fit(panel)
|
|
45
45
|
|
|
46
|
+
def clean_texmath(txt):
|
|
47
|
+
"""
|
|
48
|
+
clean tex math string, preserving control sequences
|
|
49
|
+
(incluing \n, so also '\nu') inside $ $, while allowing
|
|
50
|
+
\n and \t to be meaningful in the text string
|
|
51
|
+
"""
|
|
52
|
+
s = "%s " % txt
|
|
53
|
+
out = []
|
|
54
|
+
i = 0
|
|
55
|
+
while i < len(s)-1:
|
|
56
|
+
if s[i] == '\\' and s[i+1] in ('n', 't'):
|
|
57
|
+
if s[i+1] == 'n':
|
|
58
|
+
out.append('\n')
|
|
59
|
+
elif s[i+1] == 't':
|
|
60
|
+
out.append('\t')
|
|
61
|
+
i += 1
|
|
62
|
+
elif s[i] == '$':
|
|
63
|
+
j = s[i+1:].find('$')
|
|
64
|
+
if j < 0:
|
|
65
|
+
j = len(s)
|
|
66
|
+
out.append(s[i:j+2])
|
|
67
|
+
i += j+2
|
|
68
|
+
else:
|
|
69
|
+
out.append(s[i])
|
|
70
|
+
i += 1
|
|
71
|
+
if i > 5000:
|
|
72
|
+
break
|
|
73
|
+
return ''.join(out).strip()
|
|
74
|
+
|
|
46
75
|
class PlotConfigFrame(wx.Frame):
|
|
47
76
|
""" GUI Configure Frame"""
|
|
48
77
|
def __init__(self, parent=None, config=None, trace_color_callback=None):
|
|
@@ -243,7 +272,7 @@ class PlotConfigFrame(wx.Frame):
|
|
|
243
272
|
self.conf.plot_type == 'scatter')
|
|
244
273
|
for i in range(self.nb.GetPageCount()):
|
|
245
274
|
self.nb.GetPage(i).SetBackgroundColour(self.bgcol)
|
|
246
|
-
|
|
275
|
+
|
|
247
276
|
#bok = wx.Button(panel, -1, 'OK', size=(-1,-1))
|
|
248
277
|
#bok.Bind(wx.EVT_BUTTON,self.onExit)
|
|
249
278
|
|
|
@@ -373,11 +402,10 @@ class PlotConfigFrame(wx.Frame):
|
|
|
373
402
|
min_val=0, max_val=10, increment=0.5, digits=1)
|
|
374
403
|
thk.Bind(EVT_FLOATSPIN, Closure(self.onThickness, argu=argu))
|
|
375
404
|
|
|
376
|
-
sty = wx.Choice(panel,
|
|
405
|
+
sty = wx.Choice(panel, choices=self.conf.styles, size=(120,-1))
|
|
377
406
|
sty.Bind(wx.EVT_CHOICE,Closure(self.onStyle,argu=argu))
|
|
378
407
|
sty.SetStringSelection(dsty)
|
|
379
408
|
|
|
380
|
-
|
|
381
409
|
msz = FloatSpin(panel, -1, pos=(-1,-1), size=(FSPINSIZE, 30), value=dmsz,
|
|
382
410
|
min_val=0, max_val=30, increment=1, digits=0)
|
|
383
411
|
msz.Bind(EVT_FLOATSPIN, Closure(self.onMarkerSize, argu=argu))
|
|
@@ -573,8 +601,9 @@ class PlotConfigFrame(wx.Frame):
|
|
|
573
601
|
except TypeError:
|
|
574
602
|
s = ''
|
|
575
603
|
|
|
576
|
-
if '\\
|
|
577
|
-
s = s
|
|
604
|
+
if '\\' in s and '$' in s:
|
|
605
|
+
s = clean_texmath(s)
|
|
606
|
+
# print(" s = ", s)
|
|
578
607
|
if argu in ('xlabel', 'ylabel', 'y2label', 'title'):
|
|
579
608
|
try:
|
|
580
609
|
kws = {argu: s}
|
|
@@ -5,6 +5,12 @@ wxmplot PlotPanel: a wx.Panel for 2D line plotting, using matplotlib
|
|
|
5
5
|
import os
|
|
6
6
|
import sys
|
|
7
7
|
import wx
|
|
8
|
+
is_wxPhoenix = 'phoenix' in wx.PlatformInfo
|
|
9
|
+
if is_wxPhoenix:
|
|
10
|
+
wxCursor = wx.Cursor
|
|
11
|
+
else:
|
|
12
|
+
wxCursor = wx.StockCursor
|
|
13
|
+
|
|
8
14
|
from numpy import nonzero, where, ma, nan
|
|
9
15
|
import matplotlib
|
|
10
16
|
|
|
@@ -166,7 +172,7 @@ class PlotPanel(BasePanel):
|
|
|
166
172
|
axes.set_yscale(self.conf.yscale, basey=10)
|
|
167
173
|
except:
|
|
168
174
|
axes.set_yscale('linear')
|
|
169
|
-
|
|
175
|
+
|
|
170
176
|
axes.xaxis.set_major_formatter(FuncFormatter(self.xformatter))
|
|
171
177
|
if self.use_dates:
|
|
172
178
|
x_dates = [datetime.fromtimestamp(i) for i in xdata]
|
|
@@ -508,12 +514,18 @@ class PlotPanel(BasePanel):
|
|
|
508
514
|
|
|
509
515
|
def configure(self, event=None):
|
|
510
516
|
"""show configuration frame"""
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
517
|
+
if self.win_config is not None:
|
|
518
|
+
try:
|
|
519
|
+
self.win_config.Raise()
|
|
520
|
+
except:
|
|
521
|
+
self.win_config = None
|
|
522
|
+
|
|
523
|
+
if self.win_config is None:
|
|
514
524
|
self.win_config = PlotConfigFrame(parent=self,
|
|
515
525
|
config=self.conf,
|
|
516
526
|
trace_color_callback=self.trace_color_callback)
|
|
527
|
+
self.win_config.Raise()
|
|
528
|
+
|
|
517
529
|
|
|
518
530
|
####
|
|
519
531
|
## create GUI
|
|
@@ -534,7 +546,7 @@ class PlotPanel(BasePanel):
|
|
|
534
546
|
self.printer.canvas = self.canvas
|
|
535
547
|
self.set_bg()
|
|
536
548
|
self.conf.canvas = self.canvas
|
|
537
|
-
self.canvas.SetCursor(
|
|
549
|
+
self.canvas.SetCursor(wxCursor(wx.CURSOR_CROSS))
|
|
538
550
|
|
|
539
551
|
# overwrite ScalarFormatter from ticker.py here:
|
|
540
552
|
self.axes.xaxis.set_major_formatter(FuncFormatter(self.xformatter))
|
|
@@ -605,7 +617,10 @@ class PlotPanel(BasePanel):
|
|
|
605
617
|
|
|
606
618
|
# Axes positions update
|
|
607
619
|
for ax in self.fig.get_axes():
|
|
608
|
-
|
|
620
|
+
try:
|
|
621
|
+
ax.update_params()
|
|
622
|
+
except ValueError:
|
|
623
|
+
pass
|
|
609
624
|
ax.set_position(ax.figbox)
|
|
610
625
|
|
|
611
626
|
def draw(self):
|
|
@@ -663,7 +678,7 @@ class PlotPanel(BasePanel):
|
|
|
663
678
|
dlg = wx.FileDialog(self, message='Export Map Data to ASCII...',
|
|
664
679
|
defaultDir = os.getcwd(),
|
|
665
680
|
defaultFile=ofile,
|
|
666
|
-
style=wx.
|
|
681
|
+
style=wx.FD_SAVE|wx.FD_CHANGE_DIR)
|
|
667
682
|
|
|
668
683
|
if dlg.ShowModal() == wx.ID_OK:
|
|
669
684
|
self.writeASCIIFile(dlg.GetPath(), title=title)
|
|
@@ -703,7 +718,7 @@ class PlotPanel(BasePanel):
|
|
|
703
718
|
defaultDir=thisdir,
|
|
704
719
|
defaultFile=ofile,
|
|
705
720
|
wildcard=file_choices,
|
|
706
|
-
style=wx.
|
|
721
|
+
style=wx.FD_SAVE|wx.FD_CHANGE_DIR)
|
|
707
722
|
|
|
708
723
|
if dlg.ShowModal() == wx.ID_OK:
|
|
709
724
|
self.writeASCIIFile(dlg.GetPath(), title=title)
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
#
|
|
3
3
|
|
|
4
4
|
import wx
|
|
5
|
+
is_wxPhoenix = 'phoenix' in wx.PlatformInfo
|
|
6
|
+
|
|
5
7
|
import sys
|
|
6
8
|
import matplotlib
|
|
7
9
|
if (matplotlib.__version__ < '1.2'):
|
|
@@ -50,7 +52,7 @@ class LabelEntry(wx.TextCtrl):
|
|
|
50
52
|
# style=wx.ALIGN_LEFT|wx.ST_NO_AUTORESIZE)
|
|
51
53
|
# row = wx.BoxSizer(wx.HORIZONTAL)
|
|
52
54
|
# row.Add(entry.label, 1,wx.ALIGN_LEFT|wx.EXPAND)
|
|
53
|
-
# row.Add(entry, 1,wx.ALIGN_LEFT|wx.EXPAND)
|
|
55
|
+
# row.Add(entry, 1,wx.ALIGN_LEFT|wx.EXPAND)
|
|
54
56
|
|
|
55
57
|
"""
|
|
56
58
|
def __init__(self,parent,value,size=-1,
|
|
@@ -64,7 +66,7 @@ class LabelEntry(wx.TextCtrl):
|
|
|
64
66
|
if action is None:
|
|
65
67
|
action = self.GetValue
|
|
66
68
|
self.action = action
|
|
67
|
-
|
|
69
|
+
|
|
68
70
|
if labeltext is not None:
|
|
69
71
|
self.label = wx.StaticText(parent, -1, labeltext,
|
|
70
72
|
size = (labelsize,-1),
|
|
@@ -92,13 +94,13 @@ class LabelEntry(wx.TextCtrl):
|
|
|
92
94
|
self.SetForegroundColour(color)
|
|
93
95
|
if bgcolor:
|
|
94
96
|
self.SetBackgroundColour(bgcolor)
|
|
95
|
-
|
|
97
|
+
|
|
96
98
|
def __act(self,event=None):
|
|
97
99
|
self.action(event=event)
|
|
98
100
|
val = self.GetValue()
|
|
99
101
|
event.Skip()
|
|
100
102
|
return val
|
|
101
|
-
|
|
103
|
+
|
|
102
104
|
class PrintoutWx(wx.Printout):
|
|
103
105
|
"""Simple wrapper around wx Printout class -- all the real work
|
|
104
106
|
here is scaling the matplotlib canvas bitmap to the current
|
|
@@ -109,7 +111,7 @@ class PrintoutWx(wx.Printout):
|
|
|
109
111
|
title=None):
|
|
110
112
|
if title is None:
|
|
111
113
|
title = self._title_
|
|
112
|
-
|
|
114
|
+
|
|
113
115
|
wx.Printout.__init__(self, title=title)
|
|
114
116
|
self.canvas = canvas
|
|
115
117
|
self.width = width
|
|
@@ -126,7 +128,10 @@ class PrintoutWx(wx.Printout):
|
|
|
126
128
|
|
|
127
129
|
ppw,pph = self.GetPPIPrinter() # printer's pixels per in
|
|
128
130
|
pgw,pgh = self.GetPageSizePixels() # page size in pixels
|
|
129
|
-
|
|
131
|
+
if is_wxPhoenix:
|
|
132
|
+
grw, grh = self.canvas.GetSize()
|
|
133
|
+
else:
|
|
134
|
+
grw, grh = self.canvas.GetSizeTuple()
|
|
130
135
|
dc = self.GetDC()
|
|
131
136
|
dcw,dch = dc.GetSize()
|
|
132
137
|
|
|
@@ -150,7 +155,7 @@ class PrintoutWx(wx.Printout):
|
|
|
150
155
|
self.canvas.draw()
|
|
151
156
|
except:
|
|
152
157
|
return
|
|
153
|
-
|
|
158
|
+
|
|
154
159
|
# page may need additional scaling on preview
|
|
155
160
|
page_scale = 1.0
|
|
156
161
|
if self.IsPreview(): page_scale = float(dcw)/pgw
|
|
@@ -264,5 +269,3 @@ def inside_poly(vertices,data):
|
|
|
264
269
|
mask = Path(vertices).contains_points(data)
|
|
265
270
|
|
|
266
271
|
return mask
|
|
267
|
-
|
|
268
|
-
|
|
@@ -19,7 +19,7 @@ setup(name = 'wxmplot',
|
|
|
19
19
|
author_email = 'newville@cars.uchicago.edu',
|
|
20
20
|
url = 'http://newville.github.io/wxmplot/',
|
|
21
21
|
download_url = 'http://github.com/newville/wxmplot/',
|
|
22
|
-
requires = ('wx', 'numpy', 'matplotlib'),
|
|
22
|
+
requires = ('wx', 'numpy', 'matplotlib', 'six'),
|
|
23
23
|
license = 'OSI Approved :: MIT License',
|
|
24
24
|
description = 'A library for plotting in wxPython using matplotlib',
|
|
25
25
|
long_description = long_desc,
|
wxmplot-0.9.18/doc/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
from setuptools import setup
|
|
2
|
-
import epics
|
|
3
|
-
import sys
|
|
4
|
-
import os
|
|
5
|
-
import wx
|
|
6
|
-
import wx.lib.agw.flatnotebook
|
|
7
|
-
import numpy
|
|
8
|
-
import scipy
|
|
9
|
-
import matplotlib
|
|
10
|
-
matplotlib.use('WXAgg')
|
|
11
|
-
|
|
12
|
-
import sqlalchemy
|
|
13
|
-
import wxutils
|
|
14
|
-
import wxmplot
|
|
15
|
-
from wxmplot.plotframe import PlotFrame
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
APP = 'demo.py'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
OPTIONS = {'includes': ['ConfigParser', 'Image', 'ctypes',
|
|
22
|
-
'fpformat',
|
|
23
|
-
'matplotlib', 'numpy', 'scipy',
|
|
24
|
-
'scipy.constants', 'scipy.fftpack',
|
|
25
|
-
'scipy.io.matlab.mio5_utils',
|
|
26
|
-
'scipy.io.matlab.streams', 'scipy.io.netcdf',
|
|
27
|
-
'scipy.optimize', 'scipy.signal',
|
|
28
|
-
'scipy.sparse.csgraph._validation', 'skimage',
|
|
29
|
-
'skimage.exposure', 'sqlalchemy',
|
|
30
|
-
'sqlalchemy.dialects.sqlite', 'sqlalchemy.orm',
|
|
31
|
-
'sqlalchemy.pool', 'sqlite3', 'wx', 'wx._core',
|
|
32
|
-
'wx.lib', 'wx.lib.*', 'wx.lib.agw',
|
|
33
|
-
'wx.lib.agw.flatnotebook',
|
|
34
|
-
'wx.lib.agw.pycollapsiblepane',
|
|
35
|
-
'wx.lib.colourselect', 'wx.lib.masked',
|
|
36
|
-
'wx.lib.mixins', 'wx.lib.mixins.inspection',
|
|
37
|
-
'wx.lib.newevent', 'wx.py', 'wxmplot', 'wxutils',
|
|
38
|
-
'wxversion', 'xml.etree',
|
|
39
|
-
'xml.etree.cElementTree'],
|
|
40
|
-
'excludes': ['Tkinter', '_tkinter', 'Tkconstants', 'tcl',
|
|
41
|
-
'h5py.ipy_completer', 'IPython',
|
|
42
|
-
'_imagingtk', 'PIL._imagingtk', 'ImageTk',
|
|
43
|
-
'PIL.ImageTk', 'FixTk''_gtkagg', '_tkagg',
|
|
44
|
-
'matplotlib.tests',
|
|
45
|
-
'qt', 'PyQt4Gui', 'email', 'IPython'],
|
|
46
|
-
'site_packages': True,
|
|
47
|
-
}
|
|
48
|
-
setup(app=[APP], options={'py2app': OPTIONS})
|
|
Binary file
|
|
Binary file
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# -*- mode: python -*-
|
|
2
|
-
|
|
3
|
-
block_cipher = None
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
a = Analysis(['dislin_comp.py'],
|
|
7
|
-
pathex=['/Users/Newville/Codes/wxmplot/examples'],
|
|
8
|
-
binaries=None,
|
|
9
|
-
datas=None,
|
|
10
|
-
hiddenimports=[],
|
|
11
|
-
hookspath=None,
|
|
12
|
-
runtime_hooks=None,
|
|
13
|
-
excludes=None,
|
|
14
|
-
win_no_prefer_redirects=None,
|
|
15
|
-
win_private_assemblies=None,
|
|
16
|
-
cipher=block_cipher)
|
|
17
|
-
pyz = PYZ(a.pure, a.zipped_data,
|
|
18
|
-
cipher=block_cipher)
|
|
19
|
-
exe = EXE(pyz,
|
|
20
|
-
a.scripts,
|
|
21
|
-
exclude_binaries=True,
|
|
22
|
-
name='dislin_comp',
|
|
23
|
-
debug=False,
|
|
24
|
-
strip=None,
|
|
25
|
-
upx=True,
|
|
26
|
-
console=True )
|
|
27
|
-
coll = COLLECT(exe,
|
|
28
|
-
a.binaries,
|
|
29
|
-
a.zipfiles,
|
|
30
|
-
a.datas,
|
|
31
|
-
strip=None,
|
|
32
|
-
upx=True,
|
|
33
|
-
name='dislin_comp')
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|