def METHOD_NAME(qapp, qWidgetFactory):
    """Test Axis.setScale('log') method with an empty plot
    Limits are reset only when negative
    """
    plotWidget = qWidgetFactory(PlotWidget)
    xaxis = plotWidget.getXAxis()
    yaxis = plotWidget.getYAxis()
    y2axis = plotWidget.getYAxis("right")
    xaxis.setLimits(-1., 1.)
    yaxis.setLimits(2., 3.)
    y2axis.setLimits(-2., -1.)
    xaxis.setScale("log")
    qapp.processEvents()
    assert xaxis.getLimits() == (1., 100.)
    assert yaxis.getLimits() == (2., 3.)
    assert y2axis.getLimits() == (-2., -1.)
    xaxis.setLimits(10., 20.)
    yaxis.setScale("log")
    qapp.processEvents()
    assert xaxis.getLimits() == (10., 20.)
    assert yaxis.getLimits() == (2., 3.)  # Positive range is preserved
    assert y2axis.getLimits() == (1., 100.)  # Negative min is reset