| import gradio as gr | |
| # https://github.com/catir/aligned-reaper/ | |
| # | |
| import matplotlib | |
| matplotlib.use('Agg') | |
| import matplotlib.pyplot as plt | |
| def f1(): | |
| fig = plt.figure(figsize=(10,4)) | |
| plt.axline((0,0),slope=1,color="darkgray") | |
| plt.xlabel("Vowel length (ms)") | |
| plt.ylabel("Consonant length (ms)") | |
| return(fig) | |
| bl = gr.Blocks() | |
| with bl: | |
| btn1 = gr.Button(value="The random prosody button") | |
| btn1.style(full_width=False, size="sm") | |
| pl1 = gr.Plot() | |
| btn1.click(f1, [], pl1) | |
| if __name__ == "__main__": | |
| bl.launch() |