File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -130,16 +130,18 @@ def __init__(self, *args):
130130 self .plotLayout ().setAlignCanvasToScales (True )
131131 # set legend
132132 legend = Qwt .QwtLegend ()
133- # legend.setDefaultItemMode(Qwt.QwtLegendData.Clickable)
133+ legend .setDefaultItemMode (Qwt .QwtLegendData .Clickable )
134134 self .insertLegend (legend , Qwt .QwtPlot .RightLegend )
135135 # set axis titles
136136 self .setAxisTitle (Qwt .QwtPlot .xBottom , 'time (s)' )
137137 self .setAxisTitle (Qwt .QwtPlot .yLeft , 'frequency (Hz)' )
138138
139139 colorMap = Qwt .QwtLinearColorMap (Qt .Qt .blue , Qt .Qt .red )
140140 interval = Qwt .QwtDoubleInterval (- 1 , 1 )
141- self .axisWidget (Qwt .QwtPlot .yLeft ).setColorBarEnabled (True )
142- self .axisWidget (Qwt .QwtPlot .yLeft ).setColorMap (interval , colorMap )
141+ self .enableAxis (Qwt .QwtPlot .yRight )
142+ self .setAxisScale (Qwt .QwtPlot .yRight , - 1 , 1 )
143+ self .axisWidget (Qwt .QwtPlot .yRight ).setColorBarEnabled (True )
144+ self .axisWidget (Qwt .QwtPlot .yRight ).setColorMap (interval , colorMap )
143145
144146 # calculate 3 NumPy arrays
145147 x = arange (- 2 * pi , 2 * pi , 0.01 )
Original file line number Diff line number Diff line change @@ -15,13 +15,15 @@ class SimplePlot(Qwt.QwtPlot):
1515 def __init__ (self , * args ):
1616 Qwt .QwtPlot .__init__ (self , * args )
1717
18- # make a QwtPlot widget
18+ # make a QwtPlot widget
1919 self .setTitle ('ReallySimpleDemo.py' )
2020 self .insertLegend (Qwt .QwtLegend (), Qwt .QwtPlot .RightLegend )
2121
2222 # set axis titles
2323 self .setAxisTitle (Qwt .QwtPlot .xBottom , 'x -->' )
2424 self .setAxisTitle (Qwt .QwtPlot .yLeft , 'y -->' )
25+ self .enableAxis (self .xTop )
26+ self .enableAxis (self .yRight )
2527
2628 # insert a few curves
2729 cSin = Qwt .QwtPlotCurve ('y = sin(x)' )
You can’t perform that action at this time.
0 commit comments