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

matplotlib plots are not rendering #6

Closed
mwcraig opened this issue Jun 18, 2022 · 2 comments
Closed

matplotlib plots are not rendering #6

mwcraig opened this issue Jun 18, 2022 · 2 comments
Labels
discussion Discussion requiring no code changes

Comments

@mwcraig
Copy link

mwcraig commented Jun 18, 2022

I'm using codebraid-preview 0.5.1 with codebraid 0.8. When I run the short file below in a conda environment that includes matplotlib I do not get a plot in the output.

  • Tested on M1 Mac, macOS 12.4
  • Python and codebraid installed in a conda environment.
  • Pandoc installed via homebrew

Screenshot of result:

no-plot_md

Input file is attached:

no-plot.md

@gpoore
Copy link
Owner

gpoore commented Jun 18, 2022

I think this just needs to set a Jupyter kernel, so that plot display is automatic (instead of using the built-in code execution system). Only the first code chunk for a session needs to set the kernel. Probably something like this:

```{.python .cb-nb jupyter_kernel=python3}
print('Hello world!')

import matplotlib.pyplot as plt

plt.plot([0, 1])
```

I'm hoping to reorganize the documentation into a proper website soon, and as part of that I probably need to emphasize jupyter_kernel more. I'm also planning to add a single, document-wide option to make Jupyter the default for code execution, so that individual jupyter_kernel settings won't be required.

@mwcraig
Copy link
Author

mwcraig commented Jun 19, 2022

Thanks -- this worked after I installed jupyter_client and ipykernel!

@gpoore gpoore added the discussion Discussion requiring no code changes label Jun 27, 2022
@gpoore gpoore closed this as completed Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion requiring no code changes
Projects
None yet
Development

No branches or pull requests

2 participants