We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discord message: https://discord.com/channels/689892369998676007/1247700012952191049/1276592777823653979
Inspired by fh-matplotlib, I wrote a decorator for matplotlib svg, which gives better resolution as it uses vector graph. Here's the code:
def fh_svg(func): "svg to fasthtml item" def wrapper(*args, **kwargs): func(*args, **kwargs) f = io.StringIO() plt.savefig(f, format='svg', bbox_inches='tight') f.seek(0) svg_data = f.getvalue() plt.close() return NotStr(svg_data) return wrapper
To use:
@fh_svg def matplotlib_plot(): plt.plot(np.arange(25), np.random.exponential(1, size=25)) # to display in fasthtml Div(matplotlib_plot())
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
credit to Lily Cai
No branches or pull requests
Discord message: https://discord.com/channels/689892369998676007/1247700012952191049/1276592777823653979
Inspired by fh-matplotlib, I wrote a decorator for matplotlib svg, which gives better resolution as it uses vector graph.
Here's the code:
To use:
The text was updated successfully, but these errors were encountered: