def plotLattice(beamlinepatchlist,
                fignum=1, fig_size=20, fig_ratio=0.5,
                xranges=(-10, 10), yranges=(-10, 10),
                zoomfac=1.5):
    """
    function plot beamline defined by ``beamlinepatchlist``, which is a set of patches for all elements

    :param beamlinepatchlist: generated by function ``makeBeamline()``
    :param fignum: figure number, 1 by default
    :param fig_size: figure size, 20 inch by default
    :param fig_ratio: figure ratio, 0.5 by default
    :param xranges: axes x-ranges, ``(-10, 10)`` by default
    :param yranges: axes y-ranges, ``(-10, 10)`` by default
    :param zoomfac: zoom in factor, 1.5 by default
    """
    fig = plt.figure(fignum, figsize=(fig_size, fig_size * fig_ratio))
    ax = fig.add_subplot(111)
    for ins in beamlinepatchlist:
        [ax.add_patch(inspatch) for inspatch in ins.patch]
    x1, x2 = xranges
    y1, y2 = yranges
    minx = 0.5 * (x2 + x1) - 0.5 * zoomfac * (x2 - x1)
    maxx = 0.5 * (x2 + x1) + 0.5 * zoomfac * (x2 - x1)
    miny = 0.5 * (y2 + y1) - 0.5 * zoomfac * (y2 - y1)
    maxy = 0.5 * (y2 + y1) + 0.5 * zoomfac * (y2 - y1)
    ax.set_xlim([minx, maxx])
    ax.set_ylim([miny, maxy])
    plt.show()
def plotLattice ( beamlinepatchlist , fignum = 1 , fig_size = 20 , fig_ratio = 0.5 , xranges = ( - 10 , 10 ) , yranges = ( - 10 , 10 ) , zoomfac = 1.5 ) : fig = plt . figure ( fignum , figsize = ( fig_size , fig_size * fig_ratio ) ) ax = fig . add_subplot ( 111 ) for ins in beamlinepatchlist : [ ax . add_patch ( inspatch ) for inspatch in ins . patch ] x1 , x2 = xranges y1 , y2 = yranges minx = 0.5 * ( x2 + x1 ) - 0.5 * zoomfac * ( x2 - x1 ) maxx = 0.5 * ( x2 + x1 ) + 0.5 * zoomfac * ( x2 - x1 ) miny = 0.5 * ( y2 + y1 ) - 0.5 * zoomfac * ( y2 - y1 ) maxy = 0.5 * ( y2 + y1 ) + 0.5 * zoomfac * ( y2 - y1 ) ax . set_xlim ( [ minx , maxx ] ) ax . set_ylim ( [ miny , maxy ] ) plt . show ( )
function plot beamline defined by ``beamlinepatchlist``, which is a set of patches for all elements

    :param beamlinepatchlist: generated by function ``makeBeamline()``
    :param fignum: figure number, 1 by default
    :param fig_size: figure size, 20 inch by default
    :param fig_ratio: figure ratio, 0.5 by default
    :param xranges: axes x-ranges, ``(-10, 10)`` by default
    :param yranges: axes y-ranges, ``(-10, 10)`` by default
    :param zoomfac: zoom in factor, 1.5 by default