laygo2.interface.mpl module#

This module implements the interface with matplotlib.

laygo2.interface.mpl.export(db, cellname=None, scale=1, colormap=None, order=None, xlim=None, ylim=None, filename=None)[source]#

Export a laygo2.object.database.Library object to a matplotlib plot.

Parameters
  • db (laygo2.database.Library) – The library database to exported.

  • cellname (str or List[str]) – (optional) The name(s) of cell(s) to be exported.

  • scale (float) – (optional) The scaling factor between laygo2’s integer coordinates and plot coordinates.

  • colormap (dict) – A dictionary that contains layer-color mapping information.

  • order (list) – A list that contains the order of layers to be displayed (former is plotted first).

  • xlim (list) – (optional) A list that specifies the range of plot in x-axis.

  • ylim (list) – (optional) A list that specifies the range of plot in y-axis.

  • filename (str) – (optional) If specified, export a output file for the plot.

Returns

matplotlib.pyplot.figure or list

Return type

The generated figure object(s).

laygo2.interface.mpl.export_instance(obj, scale=1, colormap=None, order=None, xlim=None, ylim=None, filename=None)[source]#

Export a laygo2.object.physical.Instance object to a matplotlib plot.

Parameters
  • obj (laygo2.object.physical.Instance) – The instance object to exported.

  • scale (float) – (optional) The scaling factor between laygo2’s integer coordinates and plot coordinates.

  • colormap (dict) – A dictionary that contains layer-color mapping information.

  • order (list) – A list that contains the order of layers to be displayed (former is plotted first).

  • xlim (list) – (optional) A list that specifies the range of plot in x-axis.

  • ylim (list) – (optional) A list that specifies the range of plot in y-axis.

  • filename (str) – (optional) If specified, export a output file for the plot.

Returns

matplotlib.pyplot.figure or list

Return type

The generated figure object(s).

laygo2.interface.mpl.export_grid(obj, colormap=None, order=None, xlim=None, ylim=None, filename=None)[source]#

Export a laygo2.object.grid.Grid object to a matplotlib plot.

Parameters
  • obj (laygo2.object.grid.Grid) – The grid object to exported.

  • scale (float) – (optional) The scaling factor between laygo2’s integer coordinates and plot coordinates.

  • colormap (dict) – A dictionary that contains layer-color mapping information.

  • order (list) – A list that contains the order of layers to be displayed (former is plotted first).

  • xlim (list) – (optional) A list that specifies the range of plot in x-axis.

  • ylim (list) – (optional) A list that specifies the range of plot in y-axis.

  • filename (str) – (optional) If specified, export a output file for the plot.

Returns

matplotlib.pyplot.figure or list

Return type

The generated figure object(s).