Skip to content

Plot types

Madelene Sandmer edited this page Apr 30, 2025 · 42 revisions

This page is a WIP of plot types and examples. Plots are in active development and this page may quickly become out of date.

Python files related to plots are available under C:\ProgramData\BHoM\Extensions\PythonCode\LadybugTools_Toolkit\src\ladybugtools_toolkit\plot

Axes and figures

Some plot types return an axis object rather than a figure object. This provides more flexibility as multiple axes can now be added to the same figure.

To set up a figure with a single axis:

import matplotlib.pyplot as plt
from ladybugtools_toolkit.plot import utci_journey

fig, ax = plt.subplots(1, 1, figsize=(10,3))
utci_journey([23,34,12], ax=ax)

This sets up a figure with a single subplot (the 1, 1 means 1 subplot along and 1 subplot down), sets its size, and adds a utci_journey to the figure.

_condensation_potential

Create a plot of the condensation potential for a given set of timeseries dry bulb temperature and dew point temperature.

Args:
    dry_bulb_temperature (pd.Series):
        The dry bulb temperature dataset.
    dew_point_temperature (pd.Series):
        The dew point temperature dataset.
    ax (plt.Axes, optional):
        An optional plt.Axes object to populate. Defaults to None,
        which creates a new plt.Axes object.
    dbt_quantile (float, optional):
        The quantile of the dry bulb temperature to use for the
        condensation potential calculation. Defaults to 0.1.
    dpt_quantile (float, optional):
        The quantile of the dew point temperature to use for the
        condensation potential calculation. Defaults to 0.9.
    **kwargs:
        A set of kwargs to pass to plt.plot.

Returns:
    plt.Axes: The plt.Axes object populated with the plot.

29dae7ac-e461-41d4-abcf-2ac29b1acbce

from ladybug.epw import EPW
from ladybugtools_toolkit.ladybug_extension.datacollection import collection_to_series
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
temp = collection_to_series(epw.dry_bulb_temperature)
dewp = collection_to_series(epw.dew_point_temperature)

from ladybugtools_toolkit.plot._condensation_potential import condensation_potential
condensation_potential(temp, dewp)

_degree_days

Plot the heating and cooling degree days from a given EPW object.

Args:
    epw (EPW):
        An EPW object.
    heat_base (float, optional):
        The temperature at which heating kicks in. Defaults to 18.
    cool_base (float, optional):
        The temperature at which cooling kicks in. Defaults to 23.
    **kwargs:
        Additional keyword arguments to pass to the plot. These can include:
        heat_color (str):
            The color of the heating degree days bars.
        cool_color (str):
            The color of the cooling degree days bars.
        figsize (Tuple[float]):
            The size of the figure.

Returns:
    Figure:
        A matplotlib Figure object.

d92079f5-d950-4783-9205-49f83fb8753b

You can plot heating and cooling in the same plot (degree_days), or plot them separately (heating_degree_days), (cooling_degree_days)

from ladybug.epw import EPW
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)

from ladybugtools_toolkit.plot._degree_days import degree_days
from ladybugtools_toolkit.plot._degree_days import heating_degree_days
from ladybugtools_toolkit.plot._degree_days import cooling_degree_days
degree_days(epw)
heating_degree_days(epw)
cooling_degree_days(epw)

_evaporative_cooling_potential

Plot evaporative cooling potential (DBT - DPT).

Args:
    dbt (pd.Series):
        A pandas Series containing Dry Bulb Temperature data.
    dpt (pd.Series):
        A pandas Series containing Dew Point Temperature data.
    ax (plt.Axes, optional):
        The matplotlib axes to plot the figure on. Defaults to None.
    **kwargs:
        Additional keyword arguments to pass to the heatmap function.

Returns:
    plt.Axes: The matplotlib axes.

1fd6484a-9938-463d-991f-18e73d7ccec6

from ladybug.epw import EPW
from ladybugtools_toolkit.ladybug_extension.datacollection import collection_to_series
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
temp = collection_to_series(epw.dry_bulb_temperature)
dewp = collection_to_series(epw.dew_point_temperature)

from ladybugtools_toolkit.plot._evaporative_cooling_potential import evaporative_cooling_potential
evaporative_cooling_potential(temp,dewp)

_radiand_cooling_potential

Plot radiant cooling potential.

Args:
    dpt (pd.Series):
        A pandas series of dew point temperature.
    ax (plt.Axes, optional):
        The matplotlib axes to plot the figure on. Defaults to None.
    **kwargs:
        Additional keyword arguments to pass to matplotlib.pyplot.plot.

Returns:
    plt.Axes: The matplotlib axes.

b13dc961-ad99-47a8-be1e-327e0411ed1d

from ladybug.epw import EPW
from ladybugtools_toolkit.ladybug_extension.datacollection import collection_to_series
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dewp = collection_to_series(epw.dew_point_temperature)

from ladybugtools_toolkit.plot._radiant_cooling_potential import radiant_cooling_potential
radiant_cooling_potential(dewp)

_seasonality

Create a plot which shows where the seasohn threshholds are for the input EPW object.

Args:
    epw (EPW):
        An EPW object.
    ax (plt.Axes, optional):
        A matplotlib axes object. Default is None which uses the current axes.
    color_config (dict[str, str], optional):
        A dictionary of colors for each season. If None, then default will be used.
    **kwargs:
        title (str):
            The title of the plot. If not provided, then the name of the EPW file is used.

fa116977-a8ff-4414-9fc1-37642901a035

from ladybug.epw import EPW
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)

from ladybugtools_toolkit.plot._seasonality import seasonality_comparison
seasonality_comparison(epw)

_skymatrix

Create a sky matrix image.

Args:
    epw (EPW):
        A EPW object.
    ax (plt.Axes, optional):
        The matplotlib Axes to plot on. Defaults to None which uses the current Axes.
    analysis_period (AnalysisPeriod, optional):
        An AnalysisPeriod. Defaults to AnalysisPeriod().
    density (int, optional):
        Sky matrix density. Defaults to 1.
    show_title (bool, optional):
        Show the title. Defaults to True.
    show_colorbar (bool, optional):
        Show the colorbar. Defaults to True.
    **kwargs:
        Additional keyword arguments to pass to the plotting function.

Returns:
    Figure:
        A matplotlib Figure object.

b5547a96-9af1-4c49-bdc4-8523a7551886

from ladybug.epw import EPW
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)

from ladybugtools_toolkit.plot._skymatrix import skymatrix
skymatrix(epw)

_sunpath

Plot a sun-path for the given Location and analysis period.

Args:
    location (Location):
        A ladybug Location object.
    ax (plt.Axes, optional):
        A matplotlib Axes object. Defaults to None.
    analysis_period (AnalysisPeriod, optional):
        _description_. Defaults to None.
    data_collection (HourlyContinuousCollection, optional):
        An aligned data collection. Defaults to None.
    cmap (str, optional):
        The colormap to apply to the aligned data_collection. Defaults to None.
    norm (BoundaryNorm, optional):
        A matplotlib BoundaryNorm object containing colormap boundary mapping information.
        Defaults to None.
    sun_size (float, optional):
        The size of each sun in the plot. Defaults to 0.2.
    show_grid (bool, optional):
        Set to True to show the grid. Defaults to True.
    show_legend (bool, optional):
        Set to True to include a legend in the plot if data_collection passed. Defaults to True.
Returns:
    plt.Axes:
        A matplotlib Axes object.

16a8ca83-fec5-4940-af42-359c940c8dd9

from ladybug.epw import EPW, Location
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
location = epw.location

from ladybugtools_toolkit.plot._sunpath import sunpath
sunpath(location)

_misc

Plot cloud cover categories from an EPW file.

Args:
    epw (EPW):
        The EPW file to plot.
    ax (plt.Axes, optional):
        A matploltib axes to plot on. Defaults to None.

Returns:
    plt.Axes:
        The matplotlib axes.

0dfe7e62-9e0a-4c43-8cb8-2f5dacbcdf9a

from ladybug.epw import EPW, Location
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
location = epw.location

from ladybugtools_toolkit.plot._misc import hours_sunlight
hours_sunlight(location)

_monthly_histogram_proportion

Create a monthly histogram of a pandas Series.

Args:
    series (pd.Series):
        The pandas Series to plot. Must have a datetime index.
    bins (list[float]):
        The bins to use for the histogram.
    ax (plt.Axes, optional):
        An optional plt.Axes object to populate. Defaults to None, which creates a new plt.Axes object.
    labels (list[str], optional):
        The labels to use for the histogram. Defaults to None, which uses the bin edges.
    show_year_in_label (bool, optional):
        Whether to show the year in the x-axis label. Defaults to False.
    show_labels (bool, optional):
        Whether to show the labels on the bars. Defaults to False.
    show_legend (bool, optional):
        Whether to show the legend. Defaults to False.
    **kwargs:
        Additional keyword arguments to pass to plt.bar.

Returns:
    plt.Axes:
        The populated plt.Axes object.

fdab2482-266e-4dfd-b117-358cab576764

from ladybug.epw import EPW
from ladybugtools_toolkit.ladybug_extension.datacollection import collection_to_series
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = collection_to_series(epw.dry_bulb_temperature)
bins = [-30, -20, -10, 0, 10, 20, 30]

from ladybugtools_toolkit.plot._monthly_histogram_proportion import monthly_histogram_proportion
monthly_histogram_proportion(dbt, bins)

_psychrometric

Create a psychrometric chart using a LB backend.

Args:
    epw (EPW):
        An EPW object.
    cmap (Colormap, optional):
        A colormap to color things with!. 
        Default is "viridis".
    analysis_period (AnalysisPeriod, optional):
        An analysis period to filter values by. 
        Default is whole year.
    wet_bulb (bool, optional):
        Plot wet-bulb temperature constant lines instead of enthalpy. 
        Default is False.
    psychro_polygons (PsychrometricPolygons, optional):
        A PsychrometricPolygons object to use for plotting comfort polygons. 
        Default is None.
    figsize (tuple[float, float], optional):
        A tuple of floats for the figure size. 
        Default is (10, 7).

Returns:
    plt.Figure:
        A Figure object.

adf3518b-fa4c-4924-b886-f36de22e3b2d

from ladybug.epw import EPW 
epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)

from ladybugtools_toolkit.plot._psychrometric import psychrometric
psychrometric(epw)

_utci

Create a combined heatmap/histoghram figure for a UTCI data collection.

Args:
    utci_collection (HourlyContinuousCollection):
        A ladybug HourlyContinuousCollection object.
    utci_categories (Categories, optional):
        A Categories object with colors, ranges and limits. Defaults to UTCI_DEFAULT_CATEGORIES.
    show_colorbar (bool, optional):
        Set to True to show the colorbar. Defaults to True.
    **kwargs:
        Additional keyword arguments to pass.

Returns:
    Figure:
        A matplotlib Figure object.

3e099e3b-41c4-46e6-a569-fe14f0713dbe

from ladybug.epw import EPW
from ladybugtools_toolkit.external_comfort.typology import Typology
from ladybugtools_toolkit.external_comfort.simulate import SimulationResult
from ladybugtools_toolkit.external_comfort.material import Materials
from ladybugtools_toolkit.external_comfort.externalcomfort import ExternalComfort

epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = epw.dry_bulb_temperature
typology = Typology(identifier="Unshaded, wind (baseline)")
ground_material = Materials.Generic_HW_Concrete
shade_material = Materials.Generic_25mm_Wood
sr = SimulationResult(epw_path, ground_material, shade_material)
ec = ExternalComfort(sr, typology)

from ladybugtools_toolkit.plot._utci import utci_heatmap_histogram
utci_heatmap_histogram(ec.universal_thermal_climate_index)

Create a histogram showing the distribution of UTCI values.

Args:
    utci_collection (HourlyContinuousCollection):
        A ladybug HourlyContinuousCollection object.
    ax (plt.Axes, optional):
        A matplotlib Axes object to plot on. Defaults to None.
    utci_categories (Categories, optional):
        A Categories object with colors, ranges and limits. Defaults to UTCI_DEFAULT_CATEGORIES.
    show_labels (bool, optional):
        Set to True to show the UTCI category labels on the plot. Defaults to False.
    **kwargs:
        Additional keyword arguments to pass to the plotting function.

Returns:
    plt.Axes:
        A matplotlib Axes object.

1b5a529e-a95a-4b12-8d4a-a75f5949e609

from ladybug.epw import EPW
from ladybugtools_toolkit.external_comfort.typology import Typology
from ladybugtools_toolkit.external_comfort.simulate import SimulationResult
from ladybugtools_toolkit.external_comfort.material import Materials
from ladybugtools_toolkit.external_comfort.externalcomfort import ExternalComfort

epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = epw.dry_bulb_temperature
typology = Typology(identifier="Unshaded, wind (baseline)")
ground_material = Materials.Generic_HW_Concrete
shade_material = Materials.Generic_25mm_Wood
sr = SimulationResult(epw_path, ground_material, shade_material)
ec = ExternalComfort(sr, typology)

from ladybugtools_toolkit.plot._utci import utci_histogram
utci_histogram(ec.universal_thermal_climate_index)

Plot the shade benefit category.

Args:
    unshaded_utci (HourlyContinuousCollection | pd.Series):
        A dataset containing unshaded UTCI values.
    shaded_utci (HourlyContinuousCollection | pd.Series):
        A dataset containing shaded UTCI values.
    comfort_limits (tuple[float], optional):
        The range within which "comfort" is achieved. Defaults to (9, 26).
    location (Location, optional):
        A location object used to plot sun up/down times. Defaults to None.
    color_config (dict[str, str], optional):
        A dictionary of colors for each shade-benefit category.
        If None then defaults will be used.
    figsize (tuple[float], optional):
        The size of the figure. Defaults to (15, 5).
    **kwargs:
        Additional keyword arguments to pass to the plotting function.
        title (str, optional):
            The title of the plot. Defaults to None.

Returns:
    plt.Figure:
        A figure object.

45834e2c-fa1b-4fef-8361-e7df6d0f5f70

from ladybug.epw import EPW
from ladybugtools_toolkit.external_comfort.typology import Typology
from ladybugtools_toolkit.external_comfort.simulate import SimulationResult
from ladybugtools_toolkit.external_comfort.material import Materials
from ladybugtools_toolkit.external_comfort.externalcomfort import ExternalComfort

epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = epw.dry_bulb_temperature
typologyOne = Typology(identifier="Unshaded", wind_speed_multiplier=2)
typologyTwo = Typology(identifier="Shaded", wind_speed_multiplier=0.5)
ground_material = Materials.Generic_HW_Concrete
shade_material = Materials.Generic_25mm_Wood
sr = SimulationResult(epw_path, ground_material, shade_material)
ecUnshaded = ExternalComfort(sr, typologyOne)
ecShaded = ExternalComfort(sr, typologyTwo)

from ladybugtools_toolkit.plot._utci import utci_shade_benefit
utci_shade_benefit(ecUnshaded.universal_thermal_climate_index, ecShaded.universal_thermal_climate_index)

Create a figure showing the UTCI proportion for the given analysis period.

Args:
    utci_collection (HourlyContinuousCollection):
        A ladybug HourlyContinuousCollection object.
    ax (plt.Axes, optional):
        The matplotlib Axes to plot on. Defaults to None which uses the current Axes.
    show_legend (bool, optional):
        Set to True to plot the legend also. Default is True.
    show_values (bool, optional):
        Set to True to show values. Default is True.
    utci_categories (Categories, optional):
        The UTCI categories to use. Defaults to UTCI_DEFAULT_CATEGORIES.
    **kwargs:
        Additional keyword arguments to pass to the plotting function.

Returns:
    plt.Axes: A matplotlib Axes object.

a474ca80-87db-485c-bcb7-37ca6120c767

from ladybug.epw import EPW
from ladybugtools_toolkit.external_comfort.typology import Typology
from ladybugtools_toolkit.external_comfort.simulate import SimulationResult
from ladybugtools_toolkit.external_comfort.material import Materials
from ladybugtools_toolkit.external_comfort.externalcomfort import ExternalComfort

epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = epw.dry_bulb_temperature
typology = Typology(identifier="Unshaded, wind (baseline)")
ground_material = Materials.Generic_HW_Concrete
shade_material = Materials.Generic_25mm_Wood
sr = SimulationResult(epw_path, ground_material, shade_material)
ec = ExternalComfort(sr, typology)

from ladybugtools_toolkit.plot._utci import utci_pie
utci_pie(ec.universal_thermal_climate_index)

Create a heatmap showing the annual hourly UTCI difference between collections.

Args:
    utci_collection1 (HourlyContinuousCollection):
        The first UTCI collection.
    utci_collection2 (HourlyContinuousCollection):
        The second UTCI collection.
    ax (plt.Axes, optional):
        The matplotlib Axes to plot on. Defaults to None which uses the current Axes.

    **kwargs:
        Additional keyword arguments to pass to the heatmap function.

Returns:
    plt.Axes:
        A matplotlib Axes object.

c6117015-4e64-4a15-aedc-4ed0a334b089

from ladybug.epw import EPW
from ladybugtools_toolkit.external_comfort.typology import Typology
from ladybugtools_toolkit.external_comfort.simulate import SimulationResult
from ladybugtools_toolkit.external_comfort.material import Materials
from ladybugtools_toolkit.external_comfort.externalcomfort import ExternalComfort

epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = epw.dry_bulb_temperature
typologyOne = Typology(identifier="Unshaded", wind_speed_multiplier=3)
typologyTwo = Typology(identifier="Shaded", wind_speed_multiplier=0.5)
ground_material = Materials.Generic_HW_Concrete
shade_material = Materials.Generic_25mm_Wood
sr = SimulationResult(epw_path, ground_material, shade_material)
ecUnshaded = ExternalComfort(sr, typologyOne)
ecShaded = ExternalComfort(sr, typologyTwo)

from ladybugtools_toolkit.plot._utci import utci_heatmap_difference
utci_heatmap_difference(ecUnshaded.universal_thermal_climate_index, ecShaded.universal_thermal_climate_index)

Plot a single days UTCI with composite DBT, RH, MRT and WS components shown also.

Args:
    utci (pd.Series):
        An annual time-indexed series containing UTCI values.
    dbt (pd.Series):
        An annual time-indexed series containing DBT values.
    mrt (pd.Series):
        An annual time-indexed series containing MRT values.
    rh (pd.Series):
        An annual time-indexed series containing RH values.
    ws (pd.Series):
        An annual time-indexed series containing WS values.
    ax (plt.Axes, optional):
        The matplotlib Axes to plot on. Defaults to None which uses the current Axes.
    month (int, optional):
        The month to plot. Default is 6.
    day (int, optional):
         The day to plot. Default is 21.
    kwargs:
        Additional keyword arguments to pass to the matplotlib plot function.


Returns:
    Figure:
        A matplotlib Figure object.

2a7cb6bc-fcdc-4b12-b293-a3eb7ff3c8a1

from ladybug.epw import EPW
import pandas as pd
from ladybugtools_toolkit.external_comfort.typology import Typology
from ladybugtools_toolkit.external_comfort.simulate import SimulationResult
from ladybugtools_toolkit.external_comfort.material import Materials
from ladybugtools_toolkit.external_comfort.externalcomfort import ExternalComfort

epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = epw.dry_bulb_temperature
typology = Typology(identifier="Unshaded, wind (baseline)")
ground_material = Materials.Generic_HW_Concrete
shade_material = Materials.Generic_25mm_Wood
sr = SimulationResult(epw_path, ground_material, shade_material)
ec = ExternalComfort(sr, typology)
utci = pd.Series(data=ec.universal_thermal_climate_index, index=pd.date_range(start="2025-01-01 00:00:00", end="2025-12-31 23:00:00", freq="h"), name="UTCI")
dbt = pd.Series(data=ec.dry_bulb_temperature, index=pd.date_range(start="2025-01-01 00:00:00", end="2025-12-31 23:00:00", freq="h"), name="DBT")
mrt = pd.Series(data=ec.mean_radiant_temperature, index=pd.date_range(start="2025-01-01 00:00:00", end="2025-12-31 23:00:00", freq="h"), name="MRT")
rh = pd.Series(data=ec.relative_humidity, index=pd.date_range(start="2025-01-01 00:00:00", end="2025-12-31 23:00:00", freq="h"), name="RH")
ws = pd.Series(data=ec.wind_speed, index=pd.date_range(start="2025-01-01 00:00:00", end="2025-12-31 23:00:00", freq="h"), name="WS")

from ladybugtools_toolkit.plot._utci import utci_day_comfort_metrics
utci_day_comfort_metrics(utci,dbt,mrt,rh,ws)

Create a proportional bar chart showing how different UTCI collections compare in terms of time within each comfort band.

Args:
    utci_collections (list[HourlyContinuousCollection]):
        A list of UTCI collections.
    ax (plt.Axes, optional):
        The matplotlib Axes to plot on. Defaults to None which uses the current Axes.
    identifiers (list[str], optional):
        A list of names to give each collection. Defaults to None.
    utci_categories (Categories, optional):
        The UTCI categories to use. Defaults to UTCI_DEFAULT_CATEGORIES.
    density (bool, optional):
        If True, then show percentage, otherwise show count. Defaults to True.
    **kwargs:
        Additional keyword arguments to pass to the function.

Returns:
    plt.Axes:
        A matplotlib Axes object.

5c74138e-b4f1-4724-9dff-77f21a8d7f88

from ladybug.epw import EPW
from ladybugtools_toolkit.external_comfort.typology import Typologies
from ladybugtools_toolkit.external_comfort.simulate import SimulationResult
from ladybugtools_toolkit.external_comfort.material import Materials
from ladybugtools_toolkit.external_comfort.externalcomfort import ExternalComfort

epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = epw.dry_bulb_temperature
typology_one = Typologies.OPENFIELD
typology_two = Typologies.SKY_SHELTER
ground_material = Materials.Generic_HW_Concrete
shade_material = Materials.Generic_25mm_Wood
sr = SimulationResult(epw_path, ground_material, shade_material)
ec_one = ExternalComfort(sr, typology_one)
ec_two = ExternalComfort(sr, typology_two)
utci_collection = ec_one.universal_thermal_climate_index, ec_two.universal_thermal_climate_index

from ladybugtools_toolkit.plot._utci import utci_comfort_band_comparison
utci_comfort_band_comparison(utci_collection)

Create a proportional bar chart showing how different UTCI collections compare in terms of time within each comfort band.

Args:
    utci_series (list[pd.Series]):
        A list of UTCI series objects.
    ax (plt.Axes, optional):
        The matplotlib Axes to plot on. Defaults to None which uses the current Axes.
    identifiers (list[str], optional):
        A list of names to give each collection. Defaults to None.
    utci_categories (Categories, optional):
        The UTCI categories to use. Defaults to UTCI_DEFAULT_CATEGORIES.
    density (bool, optional):
        If True, then show percentage, otherwise show count. Defaults to True.
    **kwargs:
        Additional keyword arguments to pass to the function.

Returns:
    plt.Axes:
        A matplotlib Axes object.

34e21a37-4b29-4f9b-8b62-a5aee657ca78

from ladybug.epw import EPW
from ladybugtools_toolkit.external_comfort.typology import Typologies
from ladybugtools_toolkit.external_comfort.simulate import SimulationResult
from ladybugtools_toolkit.external_comfort.material import Materials
from ladybugtools_toolkit.external_comfort.externalcomfort import ExternalComfort
from ladybugtools_toolkit.ladybug_extension.datacollection import collection_to_series

epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = epw.dry_bulb_temperature
typology_one = Typologies.OPENFIELD
typology_two = Typologies.SKY_SHELTER
ground_material = Materials.Generic_HW_Concrete
shade_material = Materials.Generic_25mm_Wood
sr = SimulationResult(epw_path, ground_material, shade_material)
ec_one = ExternalComfort(sr, typology_one)
ec_two = ExternalComfort(sr, typology_two)
utci_one_series = collection_to_series(ec_one.universal_thermal_climate_index)
utci_two_series = collection_to_series(ec_two.universal_thermal_climate_index)
utcis_series = (utci_one_series, utci_two_series)

from ladybugtools_toolkit.plot._utci import utci_comfort_band_comparison_series
utci_comfort_band_comparison_series(utcis_series)

Plot a set of UTCI collections on a single figure for monthly diurnal periods.

Args:
    utci_collections (list[HourlyContinuousCollection]):
        A list of UTCI collections.
    ax (plt.Axes, optional):
        The matplotlib Axes to plot on. Defaults to None which uses the current Axes.
    month (int, optional):
        The month to get the typical day from. Default is 6.
    collection_ids (list[str], optional):
        A list of descriptions for each of the input collections. Defaults to None.
    agg (str, optional):
        How to generate the "typical" day. Defualt is "mean" which uses the mean for each timestep in that month.
    utci_categories (Categories, optional):
        The UTCI categories to use. Defaults to UTCI_DEFAULT_CATEGORIES.
    show_legend (bool, optional):
        If True, show the legend. Defaults to True.
    categories_in_legend (bool, optional):
        If True, add the UTCI categories to the legend. Defaults to True.
    **kwargs:
        Additional keyword arguments to pass to the matplotlib plot function.
        ylims (list[float], optional):
            The y-axis limits. Defaults to None which just uses the min/ax of the fiven collections.

Returns:
    Figure:
        A matplotlib figure object.

b5412040-a727-430a-95ee-d6b9c2cdc004

from ladybug.epw import EPW
from ladybugtools_toolkit.external_comfort.typology import Typologies
from ladybugtools_toolkit.external_comfort.simulate import SimulationResult
from ladybugtools_toolkit.external_comfort.material import Materials
from ladybugtools_toolkit.external_comfort.externalcomfort import ExternalComfort

epw_path = r" Paste path to epw file inside quotation marks "
epw = EPW(epw_path)
dbt = epw.dry_bulb_temperature
typology_one = Typologies.OPENFIELD
typology_two = Typologies.SKY_SHELTER
typology_three = Typologies.NEAR_WATER
ground_material = Materials.Generic_HW_Concrete
shade_material = Materials.Generic_25mm_Wood
sr = SimulationResult(epw_path, ground_material, shade_material)
ec_one = ExternalComfort(sr, typology_one)
ec_two = ExternalComfort(sr, typology_two)
ec_three = ExternalComfort(sr,typology_three)
utci_collection = [ec_one.universal_thermal_climate_index, ec_two.universal_thermal_climate_index, ec_three.universal_thermal_climate_index]

from ladybugtools_toolkit.plot._utci import utci_comparison_diurnal_day
utci_comparison_diurnal_day(utci_collection)

Create a figure showing the pseudo-journey between different UTCI conditions at a given time of year

Args:
    utci_values (float):
        A list of UTCI values.
    ax (plt.Axes, optional):
        The matplotlib Axes to plot on. Defaults to None which uses the current Axes.
    names (list[str], optional):
        A list of names to label each value with. Defaults to None.
    curve (bool, optional):
        Whether to plot the pseudo-journey as a spline. Defaults to False.
    show_legend (bool, optional):
        Set to True to plot the UTCI comfort band legend also.
    show_grid (bool, optional):
        Set to True to include a grid on the plot.
    utci_categories (Categories, optional):
        The UTCI categories to use. Defaults to UTCI_DEFAULT_CATEGORIES.
    **kwargs:
        Additional keyword arguments to pass to the plotting function.

Returns:
    plt.Axes: A matplotlib Axes object.

fd9d832a-7964-4324-a693-21f758fc02a2

from ladybugtools_toolkit.plot._utci import utci_journey
utci_journey((-20, 0, 5, 12, -11, 30, 21), names=("to cold","better now", "spring is on its way", "spring is here", "oh no, is it winter again?", "lovley summer day", "favorite tempertur"))

Solar

Create a solar radiation rose

Args:
    epw_file (Path):
        The EPW file representing the weather data/location to be visualised.
    ax (plt.Axes, optional):
        A polar axis onto which the radiation rose will be plotted.
        Defaults to None.
    rad_type (IrradianceType, optional):
        The type of radiation to plot.
        Defaults to "TOTAL".
    analysis_period (AnalysisPeriod, optional):
        The analysis period over which radiation shall be summarised.
        Defaults to AnalysisPeriod().
    tilt_angle (float, optional):
        The tilt (from 0 at horizon, to 90 facing the sky) to asses.
        Defaults to 0.
    cmap (str, optional):
        The colormap to apply.
        Defaults to "YlOrRd".
    directions (int, optional):
        The number of directions to bin data into.
        Defaults to 36.
    label (bool, optional):
        Set to True to include labels on teh plot.
        Defaults to True.
    bar_width (float, optional):
        Set the bar width for each of the bins.
        Defaults to 1.
    lims (tuple[float, float], optional):
        Set the limits of the plot.
        Defaults to None.

Returns:
    plt.Axes:
        The matplotlib axes.

05a3b57b-adfa-41b2-a749-ee055e3950b6

from pathlib import Path
epw_path = r" Paste path to epw file inside quotation marks "
epw_file = Path(epw_path) 

from ladybugtools_toolkit.solar import radiation_rose
radiation_rose(epw_file)

Create a tilt-orientation factor plot.

Args:
    epw_file (Path):
        The EPW file representing the weather data/location to be visualised.
    ax (plt.Axes, optional):
        The axes to plot on.
        Defaults to None.
    rad_type (IrradianceType, optional):
        The type of radiation to plot.
        Defaults to TOTAL.
    analysis_period (AnalysisPeriod, optional):
        The analysis period over which radiation shall be summarised.
        Defaults to AnalysisPeriod().
    cmap (str, optional):
        The colormap to apply.
        Defaults to "YlOrRd".
    directions (int, optional):
        The number of directions to bin data into.
        Defaults to 36.
    tilts (int, optional):
        The number of tilts to calculate.
        Defaults to 9.
    quantiles (tuple[float], optional):
        The quantiles to plot.
        Defaults to (0.05, 0.25, 0.5, 0.75, 0.95).
    lims (tuple[float, float], optional):
        The limits of the plot.
        Defaults to None.

Returns:
    plt.Axes:
        The matplotlib axes.

70329e10-d76b-4356-ba90-787ab0ed4a47

from pathlib import Path
epw_path = r" Paste path to epw file inside quotation marks "
epw_file = Path(epw_path) 

from ladybugtools_toolkit.solar import tilt_orientation_factor
tilt_orientation_factor(epw_file)

Clone this wiki locally