Exemplo n.º 1
0
def PLOTTING1():
    """
    croc.Tests.Tests.PLOTTING1
    
    Tests if the contour lines are correctly placed.

    CHANGELOG:
    - 20110912 RB: init
    
    """
    
    print("=== TEST ===\nTest of plotting\n")
    
    print("PLOT 1:\n" + 
        "Ranges from -1 to 1. The white band should be in the middle.\n"+
        "PLOT 2:\n" + 
        "Ranges from -1 to 0.9. The white band should be rotated a bit clockwise."
    )
    
    # plot 1
    X, Y = numpy.meshgrid(numpy.linspace(-1, 0, num=11), numpy.linspace(0, 1, num=11))  
    x_axis = numpy.linspace(0, 1, num=11)
    y_axis = numpy.linspace(0, 1, num=11)
    S = X + Y
    title = "range:-1, 1, zlimit:-1"
    P.contourplot(S, x_axis, y_axis, zlimit = -1, title = title)

    # plot 2
    X, Y = numpy.meshgrid(numpy.linspace(-1, 0, num=11), numpy.linspace(0, 0.9, num=11))
    x_axis = numpy.linspace(0, 1, num=11)
    y_axis = numpy.linspace(0, 1, num=11)
    S = X + Y
    title = "range:-1, 0.9, zlimit:-1"
    P.contourplot(S, x_axis, y_axis, zlimit = -1)