Skip to content
New issue

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

Problem Exporting Rendered Graphs to PDF with "Obsidian Code Emitter" #114

Open
Seikened opened this issue Sep 26, 2024 · 0 comments
Open

Comments

@Seikened
Copy link

Description:
I have been using "Code Emitter" in Obsidian to execute Python code and visualize graphs. While the graphs render correctly in the note view within Obsidian, they are not included when exporting the note to a PDF. This issue occurs with several visualization libraries, such as matplotlib, plotly, seaborn, bokeh, altair, and pygal.

Problem Details:

  1. Rendered graphs are not exported to PDF: When exporting notes containing Python-generated graphs, the resulting PDF includes only the code and text, but the visualized graphs are missing. This happens with all of the mentioned libraries.

  2. Code Example: Here's an example using matplotlib. The graph is displayed correctly in Obsidian but is not present in the exported PDF:

    import matplotlib.pyplot as plt
    import numpy as np
    
    x = np.linspace(0, 2 * np.pi, 100)
    y = np.sin(x)
    
    plt.plot(x, y)
    plt.xlabel('x axis')
    plt.ylabel('sin(x)')
    plt.title('Graph of the Sine Function')
    plt.show()

System Information:

  • Operating System: Darwin (MacOS)
  • System Version: 24.0.0
  • Architecture: arm64

Obsidian Environment Details:

  • Obsidian Version: v1.6.7
  • Code Emitter Version: 0.3.2

Python Details:

  • Python Version: 3.12.4 (packaged by Anaconda, Inc.)

Request

Is it possible to add support for including the generated graphs when exporting notes to PDF? This would greatly help with documentation and exporting notes containing visual content generated by code.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant