Reply To: Creating subplots

Welcome to Taipy Forums Taipy GUI Creating subplots Reply To: Creating subplots

#238261
Florian JactaFlorian Jacta
Keymaster

Hi,

It is possible to have subplots. For example, for polar charts, an example can be found here: https://docs.taipy.io/en/latest/manuals/gui/viselements/charts/polar/#specifying-the-angular-range.

However, we recommend using the layout (https://docs.taipy.io/en/latest/manuals/gui/viselements/layout/) block to create subplots like this:


from taipy.gui import Gui

# Sample small plot definition
data = {
    "x": [1, 2, 3, 4, 5],
    "y": [5, 40, 80, 120, 160],
}

# Sample small plot definition
data2 = {
    "x": [1, 2, 3, 4, 5],
    "y": [1, 4, 3, 10, 20],
}

md = """
<|layout|columns=1 1|
<|{data}|chart|>

<|{data2}|chart|>

<|{data}|chart|type=bar|>

<|{data2}|chart|type=bar|>
|>
"""

Gui(md).run()

I hope this helps!