ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 17 Jul 2018 18:45:03 +0200Unable to download to PDFhttps://ask.sagemath.org/question/43049/unable-to-download-to-pdf/I'm using SageMath 8.2 on a Windows 10 Native with Jupyter Notebook.
When trying to download to PDF a Jupyter Notebook, I get the following message:
500 : Internal Server Error
nbconvert failed: PDF creating failed, captured latex output:
This is XeTeX, Version 3.14159265-2.6-0.99998 (MiKTeX 2.9.6500 64-bit)
entering extended mode
! I can't find file `/home/danie_000/SageManifolds/test/notebook.tex'.
<*> ...e/danie_000/SageManifolds/test/notebook.tex
Please type another input file name:
! Emergency stop.
<*> ...e/danie_000/SageManifolds/test/notebook.tex
No pages of output.
Transcript written on texput.log.
It is looking for some file in `/home/danie_000` but I don't use that default directory to place my Jupyter files.
I've changed my fstab like this:
D:\Users\danie_000\Sage /home/danie_000 ntfs binary,posix=1,acl 0 0
So I use `D:\Users\danie_000\Sage` instead, a different directory and drive. If SageMath allows changing the default root directory via changing the fstab file, it should also change any command that needs that information!
Daniel
danielvolinskiTue, 17 Jul 2018 18:45:03 +0200https://ask.sagemath.org/question/43049/no more inline matplotlib plots in sage notebookhttps://ask.sagemath.org/question/8608/no-more-inline-matplotlib-plots-in-sage-notebook/Hi,
I can't get any matplotplib/pylab plots inline in a notebook. Plots now are created as pdf files that open in another window.
For example, the code below used to create the plot in a new box after the instruction plt.savefig('.')
import numpy as np
import pylab as plt
x = np.arange(-2 * np.pi, 2 * np.pi,0.1)
plt.figure(1)
plt.clf()
plt.plot(x, np.sin(x), label='sin(x)')
plt.savefig('.')
now it returns a link '.pdf' to a pdf file.
Using
plt.savefig('a.png')
returns the following traceback:
Traceback (most recent call last):
File "", line 1, in <module>
File "/private/var/folders/k7/k7XHz3-82RazCk+kNOj55U+++TM/-Tmp-/tmpjD4zHK/___code___.py", line 14, in <module>
exec compile(u"plt.savefig('a.png')" + '\n', '', 'single')
File "", line 1, in <module>
File "/tmp/sage-mac-app/local/lib/python2.6/site-packages/matplotlib/pyplot.py", line 363, in savefig
return fig.savefig(*args, **kwargs)
File "/tmp/sage-mac-app/local/lib/python2.6/site-packages/matplotlib/figure.py", line 1084, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/tmp/sage-mac-app/local/lib/python2.6/site-packages/matplotlib/backend_bases.py", line 1853, in print_figure
print_method = self._get_print_method(format)
File "/tmp/sage-mac-app/local/lib/python2.6/site-packages/matplotlib/backend_bases.py", line 1793, in _get_print_method
'%s.' % (format, ', '.join(formats)))
ValueError: Format "png" is not supported.
Supported formats: pdf.
I don't know what settings changes I may have done, and couldn't find any documented help format settings in sage for matplotlib plots. Interestingly I used to experience before the impossibility to export sage generated plots in pdf... It would be nice to have a better control on these settings.
Thank you for any help
Samuel
sbottThu, 05 Jan 2012 05:23:41 +0100https://ask.sagemath.org/question/8608/