def create_log_plot():
    plot = QwtPlot('LogCurveDemo.py (or how to handle -inf values)')
    plot.enableAxis(QwtPlot.xBottom)
    plot.setAxisScaleEngine(QwtPlot.yLeft, QwtLogScaleEngine())
    curve = QwtPlotCurve()
    curve.setRenderHint(QwtPlotCurve.RenderAntialiased)
    pen = QPen(Qt.magenta)
    pen.setWidth(1.5)
    curve.setPen(pen)
    curve.attach(plot)
    x = np.arange(0.0, 10.0, 0.1)
    y = 10 * np.cos(x)**2 - .1
    print("y<=0:", y <= 0)
    curve.setData(x, y)
    plot.replot()
    return plot
def create_log_plot():
    plot = QwtPlot('LogCurveDemo.py (or how to handle -inf values)')
    plot.enableAxis(QwtPlot.xBottom)
    plot.setAxisScaleEngine(QwtPlot.yLeft, QwtLogScaleEngine())
    curve = QwtPlotCurve()
    curve.setRenderHint(QwtPlotCurve.RenderAntialiased)
    pen = QPen(Qt.magenta)
    pen.setWidth(1.5)
    curve.setPen(pen)
    curve.attach(plot)
    x = np.arange(0.0, 10.0, 0.1)
    y = 10*np.cos(x)**2-.1
    print("y<=0:", y<=0)
    curve.setData(x, y)
    plot.replot()
    return plot