CommonNets#
- class pyedb.common.nets.CommonNets(_pedb)#
Overview#
Plot a Net to Matplotlib 2D Chart. |
Import detail#
from pyedb.common.nets import CommonNets
Method detail#
- CommonNets.plot(nets: str | list[str] = None, layers: str | list[str] = None, color_by_net: bool = False, show_legend: bool = True, save_plot: str = None, outline: list[list[float]] = None, size: list | tuple = (6000, 3000), plot_components: bool = True, top_view: bool = True, show: bool = True, annotate_component_names: bool = True, plot_vias: bool = False, title: str = None, outline_width: int = 4, plot_components_on_both_side: bool = False, component_top_color: tuple = (0, 0, 0), component_bottom_color: tuple = (41 / 255, 41 / 255, 41 / 255), paths_as_lines: bool = False, plane_alpha: float = 0.5, **kwargs) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] | None#
Plot a Net to Matplotlib 2D Chart.
- Parameters:
- nets
str,list,optional Name of the net or list of nets to plot. If
Noneall nets will be plotted.- layers
str,list,optional Name of the layers to include in the plot. If
Noneall the signal layers will be considered.- color_by_netbool,
optional If
Truethe plot will be colored by net. IfFalsethe plot will be colored by layer. (default)- show_legendbool,
optional If
Truethe legend is shown in the plot. (default) IfFalsethe legend is not shown.- save_plot
str,optional If a path is specified the plot will be saved in this location. If
save_plotis provided, theshowparameter is ignored.- outline
list,optional List of points of the outline to plot. If
Nonea red frame is drawn around the primitives of theOutlinelayer or, if the design has noOutlinelayer primitives, around the plotted objects.- size
tuple,int,optional Image size in pixel (width, height). If an integer is provided the height is half of the width. Default value is
(6000, 3000). Smaller values make the plot generation faster.- plot_componentsbool,
optional If
Truethe components placed on top layer are plotted. (default) IfFalsethe components are not plotted. This may impact in the plot computation time. If nets and/or layers is specified, only the components belonging to the specified nets/layers are plotted.- top_viewbool,
optional Whether if use top view or bottom view. Components will be visible only for the highest layer in the view.
- showbool,
optional Whether to show the plot or not. Default is True.
- annotate_component_names: bool, optional
Whether to add the component names to the plot or not. Default is
True.- plot_viasbool,
optional Whether to plot vias (circular and rectangular) or not. This may impact in the plot computation time. Default is
False.- title
str,optional Specify the default plot title. Is value is
Nonethe project name is assigned by default. Default value isNone.- outline_width
int,optional Line width of the outline. Default is
4.- plot_components_on_both_sidebool,
optional Whether to plot the components of both the top and the bottom layer. Default is
False.- component_top_color
tuple,optional RGB color used for the components placed on the top layer. Default is black.
- component_bottom_color
tuple,optional RGB color used for the components placed on the bottom layer.
- paths_as_linesbool,
optional Whether to draw the paths as thick lines (center line and width) instead of the polygon computed by the server. This is faster on designs with many paths and produces much lighter figures, but it is an approximation: paths with different or clipped end caps are still drawn as polygons, the mitre limit of the corners is the one of matplotlib, and overlapping traces are blended twice when the layer transparency is applied. The axes use an equal aspect ratio so the width is not distorted. Only available with the gRPC backend. Default is
False.- plane_alpha
float,optional Opacity (
0transparent,1opaque) of the polygons (planes). Paths, other primitives, component pads and vias are always opaque. Layers are drawn from the farthest to the nearest to the viewer and all the planes are drawn before the traces, so the nets of every layer remain visible. Default is0.5.
- nets
- Returns:
- (
fig,ax) Matplotlib figure and axes.
- (