Skip to content

Commit 7de5426

Browse files
committed
Fixed Issue #22: fixed scale issues in CurveDemo2.py and ImagePlotDemo.py
Fixed QwtScaleMap constructor (the PyQwt constructor variant was not implemented correctly).
1 parent 9a3403d commit 7de5426

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

qwt/scale_map.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@ class QwtScaleMap(object):
2727
and vice versa.
2828
2929
The scale and paint device intervals are both set to [0,1].
30+
31+
.. py:class:: QwtScaleMap([other=None])
32+
33+
Constructor (eventually, copy constructor)
34+
35+
:param qwt.scale_map.QwtScaleMap other: Other scale map
36+
37+
.. py:class:: QwtScaleMap(p1, p2, s1, s2)
38+
39+
Constructor (was provided by `PyQwt` but not by `Qwt`)
40+
41+
:param int p1: First border of the paint interval
42+
:param int p2: Second border of the paint interval
43+
:param float s1: First border of the scale interval
44+
:param float s2: Second border of the scale interval
3045
"""
3146
def __init__(self, *args):
3247
self.__transform = None # QwtTransform
@@ -38,13 +53,13 @@ def __init__(self, *args):
3853
if len(args) == 1:
3954
other, = args
4055
elif len(args) == 4:
41-
s1, s2, p1, p2 = args
56+
p1, p2, s1, s2 = args
4257
self.__s1 = s1
4358
self.__s2 = s2
4459
self.__p1 = p1
4560
self.__p2 = p2
4661
elif len(args) != 0:
47-
raise TypeError("%s() takes 1, 3, or 4 argument(s) (%s given)"\
62+
raise TypeError("%s() takes 0, 1, or 4 argument(s) (%s given)"\
4863
% (self.__class__.__name__, len(args)))
4964
if other is None:
5065
self.__cnv = 1.

qwt/tests/CurveDemo2.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# developments (e.g. ported to PythonQwt API)
77
# (see LICENSE file for more details)
88

9-
#FIXME: scale issue!
10-
119
SHOW = True # Show test in GUI-based test launcher
1210

1311
import sys

qwt/tests/ImagePlotDemo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# developments (e.g. ported to PythonQwt API)
77
# (see LICENSE file for more details)
88

9-
#FIXME: This example is still not working: image scaling issue (see PlotImage.draw)
10-
119
SHOW = True # Show test in GUI-based test launcher
1210

1311
import sys

0 commit comments

Comments
 (0)