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

Pandoc plot does not recognize the Matplotlib I installed #34

Closed
fanrongqitiancai opened this issue Feb 5, 2022 · 6 comments
Closed

Comments

@fanrongqitiancai
Copy link

My running environment is Windows 7

  1. Run the python command and the result is

python 3.8.5

  1. Run the PIP list command to display

matplotlib 3.5.1

  1. Run the pandoc plot toolkits command to display:

Toolkit: python/matplotlib

code block trigger: matplotlib

  1. Markdown file

import matplotlib. pyplot as plt



plt. figure()

plt. plot([0,1,2,3,4], [1,2,3,4,5])

plt. title('This is an example figure')

  1. Operation

pandoc --filter pandoc-plot --highlight-style pygments markdown. md -s -o output. html

  1. Error reporting

renderer for python/matplotlib needed but is not installed

@LaurentRDC
Copy link
Owner

Hello there,

I'm sorry you're having trouble. I notice that your markdown file doesn't look like what pandoc-plot expects. Can you try the following file?

# My document

```{.matplotlib}
import matplotlib.pyplot as plt

plt.figure()
plt.plot([0,1,2,3,4], [1,2,3,4,5])
plt.title('This is an example figure')
```

It is important that your plotting code be 'sandwiched' between ```{.matplotlib} and ```

@fanrongqitiancai
Copy link
Author

My document is in ``` 。I think there is a problem with pandoc plot or Python environment variables, which leads to incorrect identification. My pandoc plot downloads exe files and communicates with Pando Exe is in the same directory.

@LaurentRDC
Copy link
Owner

Allright, let's turn on logging to see what's going on.

In the same repository as your file, can you create a file named .pandoc-plot.yml with the following content?

# .pandoc-plot.yml
logging:
    verbosity: debug

Then, if you run the conversion command pandoc --filter pandoc-plot markdown.md -s -o output.html you should see a lot more information. Please copy and paste this information

@fanrongqitiancai
Copy link
Author

image

I write Python code in eclipse,

import matplotlib. pyplot as plt

plt. figure()

Is right. However, I enter Python in the CMD command window,

Enter the command line and enter

import matplotlib. pyplot as plt

Display:
image

@fanrongqitiancai
Copy link
Author

I modified the environment variable and it can work normally.

@LaurentRDC
Copy link
Owner

Awesome, I'll close this issue for now, but don't hesitate to reopen if it stops working

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

2 participants