Changeset 2649 in lmdz_wrf


Ignore:
Timestamp:
Jun 30, 2019, 3:20:09 PM (5 years ago)
Author:
lfita
Message:

Adding:

  • `draw_secs': Function to draw an object according to its dictionary
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/geometry_tools.py

    r2630 r2649  
    6969
    7070## Plotting
     71# draw_secs: Function to draw an object according to its dictionary
    7172# paint_filled: Function to draw an object filling given sections
    7273# plot_sphere: Function to plot an sphere and determine which standard lines will be
     
    25052506    return fig, ax
    25062507
     2508def draw_secs(objdic):
     2509    """ Function to draw an object according to its dictionary
     2510      objdic: dictionary with the parts to draw [polygon, ltype, lcol, lw]
     2511    """
     2512    fname = 'draw_secs'
     2513
     2514    for secn in objdic.keys():
     2515        secv = objdic[secn]
     2516        poly = secv[0]
     2517        lt = secv[1]
     2518        lc = secv[2]
     2519        lw = secv[3]
     2520
     2521        plt.plot(poly[:,1], poly[:,0], lt, color=lc, linewdith=lw)
     2522
     2523    return
     2524
    25072525def paint_filled(objdic, fillsecs):
    25082526    """ Function to draw an object filling given sections
Note: See TracChangeset for help on using the changeset viewer.