<jupyter_start><jupyter_text>TCLab PlotterWhen operating in a Jupyter Notebook, a `Plotter` can be used together with the `Historian`.      h = Historian(lab)    p = Plotter(h, tfinal)    where `lab` is a `TCLab` instance as before and the optional parameter `tfinal` provides an initial scaling of the time axes. Each call to `p.update()` will automatically update both the historian and the plot.<jupyter_code>%matplotlib notebook
from tclab import TCLab, clock, Historian, Plotter, setup

TCLab = setup(connected=False, speedup=10)

with TCLab() as lab:
    h = Historian(lab.sources)
    p = Plotter(h, twindow=200)
    for t in clock(200):
        lab.Q1(100 if t < 100 else 0)
        p.update(t)<jupyter_output>Simulated TCLab<jupyter_text>Specifying layoutThe layout of values can be speficied when creating a `Plotter`. Layout is given as a tuple of tuples. Each of the first level tuples creates a new axis, and each of the elements in the tuple is plotted on that same axis.<jupyter_code>%matplotlib notebook
from tclab import setup
from tclab import Historian, Plotter, clock
import time

tic = time.time()
TCLab = setup(connected=False, speedup=10)

with TCLab() as lab:
    h = Historian(lab.sources)
    p = Plotter(h, 200, layout=(('T1', 'T2'), ('Q1', 'Q2')))
    for t in clock(200):
        lab.U1 = 80
        p.update(t)
toc = time.time()

print(toc-tic, 'seconds')<jupyter_output>Simulated TCLab
{'fraction_non_alphanumeric': 0.09887005649717515, 'fraction_numerical': 0.021892655367231638, 'mean_word_length': 4.171532846715328, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '334910', 'license': 'Apache-2.0', 'n_tokens_mistral': 501, 'n_tokens_neox': 473, 'n_words': 174, 'path': 'notebooks/06_TCLab_Plotter.ipynb', 'repo_name': 'jckantor/TClab', 'size': '1416'}