CommonNets#

class pyedb.common.nets.CommonNets(_pedb)#

Overview#

plot

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:
netsstr, list, optional

Name of the net or list of nets to plot. If None all nets will be plotted.

layersstr, list, optional

Name of the layers to include in the plot. If None all the signal layers will be considered.

color_by_netbool, optional

If True the plot will be colored by net. If False the plot will be colored by layer. (default)

show_legendbool, optional

If True the legend is shown in the plot. (default) If False the legend is not shown.

save_plotstr, optional

If a path is specified the plot will be saved in this location. If save_plot is provided, the show parameter is ignored.

outlinelist, optional

List of points of the outline to plot. If None a red frame is drawn around the primitives of the Outline layer or, if the design has no Outline layer primitives, around the plotted objects.

sizetuple, 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 True the components placed on top layer are plotted. (default) If False the 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.

titlestr, optional

Specify the default plot title. Is value is None the project name is assigned by default. Default value is None.

outline_widthint, 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_colortuple, optional

RGB color used for the components placed on the top layer. Default is black.

component_bottom_colortuple, 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_alphafloat, optional

Opacity (0 transparent, 1 opaque) 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 is 0.5.

Returns:
(fig, ax)

Matplotlib figure and axes.