这就是这样一个密码。
\documentclass{standalone}
\usepackage[miktex]{gnuplottex}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{gnuplot}
set terminal epslatex color
set xrange [-4:4]
set yrange [0:16]
set xlabel '$x$'
set ylabel '$y$'
plot x**2 title '$y=x^2$'
\end{gnuplot}
\end{document}是否有可能使用tikz在gnuplot创建的坐标系统中绘制原语,类似于tikz绘图?例如,\draw (axis cs:0 , 0) -- (axis cs:1 , 1);
发布于 2022-02-21 13:29:52
这样做可能有很多方法,这里有一个使用tikzlibrary tikzmark的解决方案,它在ylabel字符串中放置一个名为"a“的自定义标记(但也可以由任意set label命令放置)。您的代码对我来说是不可编译的;原因之一是必须将set terminal命令作为\begin{gnuplot}的选项而不是在gnuplot中提供。既然您想使用tikz,我建议您无论如何使用tikz终端。
\documentclass{standalone}
\usepackage{gnuplot-lua-tikz}
\usepackage{gnuplottex}
\usepackage[utf8]{inputenc}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{gnuplot}[terminal=tikz]
set xrange [-4:4]
set yrange [0:16]
set xlabel '$x$'
set ylabel '$\tikzmark{a}y$'
plot x**2 title '$y=x^2$'
\end{gnuplot}
An arrow going from the $y$ label to exactly here.\tikz[remember picture, overlay] \draw[<-, bend angle = 10, bend right] (0,0) to (pic cs:a);
\end{document}

https://stackoverflow.com/questions/71203397
复制相似问题