ladybug_charts.to_figure module

Create plotly figures from pandas Dataframe.

ladybug_charts.to_figure.bar_chart(data: List[MonthlyCollection] | List[DailyCollection], min_range: float = None, max_range: float = None, colors: List[Color] = None, title: str = None, center_title: bool = False, stack: bool = False) Figure[source]

Create a plotly bar chart figure from multiple ladybug monthly or daily data.

Parameters:
  • data – A list of either ladybug MonthlyCollection data or DailyCollection data.

  • min_range – Minimum value for the legend. If None, it is autocalculated from the data. (Default: None).

  • max_range – Maximum value for the legend. If None, it is autocalculated from the data. (Default: None).

  • colors – A list of ladybug color objects that matches the length of data argument. If None, random colors will be used. (Default: None).

  • title – A string to be used as the title of the plot. (Default: None).

  • center_title – A boolean to set whether to center the title of the chart. (Default: False).

  • stack – A boolean to determine whether to stack the data. (Default: False).

Returns:

A plotly figure.

ladybug_charts.to_figure.bar_chart_with_table(data: List[MonthlyCollection], min_range: float = None, max_range: float = None, colors: List[Color] = None, title: str = None, show_title: bool = False, stack: bool = False) Figure[source]

Create a plotly bar chart figure from multiple ladybug monthly or daily data.

Parameters:
  • data – A list of ladybug monthly data.

  • min_range – Minimum value for the legend. If not set will be calculated from the data. Defaults to None.

  • max_range – Maximum value for the legend. If not set will be calculated from the data. Defaults to None.

  • colors – A list of ladybug color objects. The length of this list needs to match the length of data argument. If not set, random colors will be used. Defaults to None.

  • title – A string to be used as the title of the plot. If not set, the names of data will be used to create a title for the chart. Defaults to None.

  • show_title – A boolean to set whether to show the title of the chart. Defaults to False.

  • stack – A boolean to determine whether to stack the data. Defaults to False which will show data side by side.

Returns:

A plotly figure.

ladybug_charts.to_figure.daily_bar_chart(data: DailyCollection, title: str = None, show_title: bool = False, color: Color = None) Figure[source]

Create a plotly bar chart figure from a ladybug daily data object.

Parameters:
  • data – A ladybug DailyCollection object.

  • title – A string to be used as the title of the plot. If not set, the name of the data will be used. Defaults to None.

  • show_title – A boolean to determine whether to show the title of the plot. Defaults to False.

  • color – A Ladybug color object. If not set, a random color will be used. Defaults to None.

Returns:

A plotly figure.

ladybug_charts.to_figure.diurnal_average_chart(epw: ~ladybug.epw.EPW, title: str = None, show_title: bool = False, colors: ~typing.List[~ladybug.color.Color] | ~typing.Tuple[~ladybug.color.Color] = ((R:75, G:107, B:169, A:255), (R:115, G:147, B:202, A:255), (R:170, G:200, B:247, A:255), (R:193, G:213, B:208, A:255), (R:245, G:239, B:103, A:255), (R:252, G:230, B:74, A:255), (R:239, G:156, B:21, A:255), (R:234, G:123, B:0, A:255), (R:234, G:74, B:0, A:255), (R:234, G:38, B:0, A:255))) Figure[source]

Create a diurnal average chart from a ladybug EPW object.

Parameters:
  • epw – A ladybug EPW object.

  • title – A string to be used as the title of the plot. Defaults to None.

  • show_title – A boolean to determine whether to show the title of the plot. Defaults to False.

  • colorset – A ColorSet object. Defaults to ColorSet.original.

Returns:

A plotly figure.

ladybug_charts.to_figure.diurnal_average_chart_from_hourly(data: HourlyContinuousCollection, title: str = None, show_title: bool = False, color: Color = None) Figure[source]

Create a diurnal average chart from a ladybug hourly continuous data.

Parameters:
  • data – A ladybug HourlyContinuousCollection object.

  • title – A string to be used as the title of the plot. Defaults to None.

  • show_title – A boolean to determine whether to show the title of the plot. Defaults to False.

  • color – A Ladybug color object. If not set, a random color will be used. Defaults to None.

Returns:

A plotly figure.

ladybug_charts.to_figure.heat_map(hourly_data: HourlyContinuousCollection | HourlyDiscontinuousCollection, min_range: float = None, max_range: float = None, colors: List[Color] = None, title: str = None, show_title: bool = False, num_labels: int = None, labels: List[float] = None) Figure[source]

Create a plotly heat map figure from Ladybug Hourly data.

Parameters:
  • hourly_data – A Ladybug HourlyContinuousCollection object or a Ladybug HourlyDiscontinuousCollection object.

  • min_range – The minimum value for the legend of the heatmap. If not set, value will be calculated based on data. Defaults to None.

  • max_range – The maximum value for the legend of the heatmap. If not set, value will be calculated based on data. Defaults to None.

  • colors – A list of Ladybug Color objects. Defaults to None.

  • title – A string to be used as the title of the plot. If not set, the name of the data will be used. Defaults to None.

  • show_title – A boolean to show or hide the title of the chart. Defaults to False.

  • num_labels – The number of labels to be used in the legend. Defaults to None.

  • labels – A list of floats to be used as labels for the legend. Defaults to None.

Returns:

A plotly figure.

ladybug_charts.to_figure.hourly_line_chart(data: HourlyContinuousCollection, color: Color = None, title: str = None, show_title: bool = False) Figure[source]

Create a plotly line chart figure from a ladybug hourly continuous data object.

Parameters:
  • data – A ladybug HourlyContinuousCollection object.

  • color – A Ladybug color object. If not set, a random color will be used. Defaults to None.

  • title – A string to be used as the title of the plot. Defaults to None.

  • show_title – A boolean to determine whether to show the title of the plot. Defaults to False.

Returns:

A plotly figure.

ladybug_charts.to_figure.monthly_bar_chart(data: MonthlyCollection, title: str = None, show_title: bool = False, color: Color = None) Figure[source]

Create a plotly bar chart figure from a ladybug monthly data object.

Parameters:
  • data – A ladybug MonthlyCollection object.

  • title – A string to be used as the title of the plot. If not set, the name of the data will be used. Defaults to None.

  • show_title – A boolean to set whether to show the title of the chart. Defaults to False.

  • color – A Ladybug color object. If not set, a random color will be used. Defaults to None.

Returns:

A plotly figure.

ladybug_charts.to_figure.psych_chart(psych: ~ladybug.psychchart.PsychrometricChart, data: ~ladybug._datacollectionbase.BaseCollection = None, title: str = None, show_title: bool = False, polygon_pmv: ~ladybug_comfort.chart.polygonpmv.PolygonPMV = None, strategies: ~typing.List[~ladybug_charts.utils.Strategy] = [Strategy.comfort], strategy_parameters: ~ladybug_charts.utils.StrategyParameters = <ladybug_charts.utils.StrategyParameters object>, solar_data: ~ladybug.datacollection.HourlyContinuousCollection = None, colors: ~typing.List[~ladybug.color.Color] = None) Figure[source]

Create a psychrometric chart.

Parameters:
  • psych – A ladybug PsychrometricChart object.

  • data – A ladybug DataCollection object.

  • title – A title for the plot. Defaults to None.

  • show_title – A boolean to show or hide the title. Defaults to False.

  • polygon_pmv – A ladybug PolygonPMV object. If provided, polygons will be drawn. Defaults to None.

  • strategies – A list of strategies to be applied to the chart. Accepts a list of Stragegy objects. Defaults to out of the box StrategyParameters object.

  • strategy_parameters – A StrategyParameters object. Defaults to None.

  • solar_data – An annual hourly continuous data collection of irradiance (or radiation) in W/m2 (or Wh/m2) that aligns with the data points on the psychrometric chart. This is only required when plotting a “Passive Solar Heating” strategy polygon on the chart. The irradiance values should be incident on the orientation of the passive solar heated windows. So using global horizontal radiation assumes that all windows are skylights (like a greenhouse). Defaults to None.

  • colors – A list of colors to be used for the comfort polygons. Defaults to None.

Returns:

A plotly figure.

ladybug_charts.to_figure.sunpath(sunpath: ~ladybug.sunpath.Sunpath, data: ~ladybug.datacollection.HourlyContinuousCollection = None, colorset: ~ladybug.color.Colorset = ((R:75, G:107, B:169, A:255), (R:115, G:147, B:202, A:255), (R:170, G:200, B:247, A:255), (R:193, G:213, B:208, A:255), (R:245, G:239, B:103, A:255), (R:252, G:230, B:74, A:255), (R:239, G:156, B:21, A:255), (R:234, G:123, B:0, A:255), (R:234, G:74, B:0, A:255), (R:234, G:38, B:0, A:255)), min_range: float = None, max_range: float = None, title: str = None, show_title: bool = False) Figure[source]

Plot Sunpath.

Parameters:
  • sunpath – A Ladybug Sunpath object.

  • data – An HourlyContinuousCollection object to be plotted on the sunpath. Defaults to None.

  • colorset – A Ladybug Colorset object. Defaults to ColorSet.original.

  • min_range – Minimum value for the colorbar. If not set, the minimum value will be set to the minimum value of the data. Defaults to None.

  • max_range – Maximum value for the colorbar. If not set, the maximum value will be set to the maximum value of the data. Defaults to None.

  • title – A string to be used as the title of the plot. Defaults to None.

  • show_title – A boolean to show or hide the title of the plot. Defaults to False.

Returns:

A plotly Figure.

ladybug_charts.to_figure.wind_rose(lb_wind_rose: WindRose, title: str = None, show_title: bool = False) Figure[source]

Create a windrose plot.

Parameters:
  • lb_wind_rose – A ladybug WindRose object.

  • title – A title for the plot. Defaults to None.

  • show_title – A boolean to show or hide the title. Defaults to False.

Returns:

A plotly figure.