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.Fri, 30 Jun 2023 20:03:36 +0200SageTex - Initializing plots directory fails in external drive.https://ask.sagemath.org/question/69631/sagetex-initializing-plots-directory-fails-in-external-drive/Hello,
MacOS 13.4.1 - TexLive 2023 - SageMath version 10.0, Release Date: 2023-05-20 │
│ Using Python 3.11.1.
When I run
% !TEX TS-program = sage
\documentclass{article}
\usepackage{sagetex}
\begin{document}
\begin{sagesilent}
G = plot(sin(x),-pi,pi)
\end{sagesilent}
This is
\sageplot{G}
my plot
\end{document}
I have 3 different results for these two cases:
a) Whether the sage-plots-for-Untitled.tex directory exists or not.
b) whether the location is an external device or not.
If the directory does not exist (running for the first time or has been deleted), the result is as expected for both cases, where the files are on the internal or external hard drive.
If the directory already exists, the result is as expected if the files are on the internal hard drive.
If the files are on an external drive and the directory exists, sagetex fails with:
Processing Sage code for Untitled.tex...
Code block (line 7) begin...end
Initializing plots directory
**** Error in Sage code on line 12 of Untitled.tex! Traceback follows.
Traceback (most recent call last):
File "/Volumes/TOSHIBA4T/teste/Untitled.sagetex.sage.py", line 19, in <module>
_st_.plot(_sage_const_0 , format='notprovided', _p_=G)
File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sagetex.py", line 225, in plot
self.initplot()
File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sagetex.py", line 107, in initplot
shutil.rmtree(self.plotdir)
File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/shutil.py", line 732, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/shutil.py", line 683, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/shutil.py", line 681, in _rmtree_safe_fd
os.unlink(entry.name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: '._plot-0.pdf'
**** Running Sage on Untitled.sage failed! Fix Untitled.tex and try again.
Anyone else had these problem? Can you help me? Is this a VenturaOS Privacy & Security issue?
Thanks,
FilipeqgfreireFri, 30 Jun 2023 20:03:36 +0200https://ask.sagemath.org/question/69631/SageTex and graphshttps://ask.sagemath.org/question/10474/sagetex-and-graphs/Hey guys,
Today i was looking for some graph plotting and i didn't arrived to use that piece of code in my .tex :
from sage.graphs.graph_coloring import edge_coloring
g = graphs.CompleteGraph(10)
g.graphplot(edge_colors=edge_coloring(g, hex_colors=True)).plot()
I can insert the first part in a block, but to plot I don't have the answer.
I tried : \sageplot{g.graphplot(edge_colors=edge_coloring(g, hex_colors=True)).plot()} and \sage{g.graphplot(edge_colors=edge_coloring(g, hex_colors=True))} but nothing works :/
Of course \sage{g} works but i'd like to have the graphical options !
Help plz :)
TyHolosmosTue, 27 Aug 2013 12:27:20 +0200https://ask.sagemath.org/question/10474/Make sage not recreate plot files for sagetexhttps://ask.sagemath.org/question/8943/make-sage-not-recreate-plot-files-for-sagetex/When running sage on a .sagetex.sage file, it spends ages on "Initializing plots directory\n Plot 0". Most of the time I haven't changed the plots. How do I tell sage(tex) to use the files generated last time?chaesloc2Tue, 01 May 2012 07:56:33 +0200https://ask.sagemath.org/question/8943/