我的问题如下。我有一份 pdf 报告,我想在需要时将其与 ocg 一起使用来显示。有许多图具有可点击点选项,并由 pgfplot 库绘制。这些图可以通过 ocg 支持的按钮显示/隐藏,而且正如我之前所说,它们是可点击的,并且捕捉选项已激活。
当我想点击点来检查其上的值时,问题就开始了。在这里您可以看到,即使曲线不可见,只要它在捕捉范围内,点击点也会捕捉。
例如,在下面的代码中,我点击了 wave2 按钮来隐藏“wave2”,然后点击到图形上大约 15,15 点,它仍然像 wave2 一样可见。我理解捕捉点有一个参数作为精确点:x 值、y 值。
如果我单击 wave2 曲线的点弹出窗口,则在 wave2 下方处于活动状态,这是正常的,因为可见性状态。
但是在这里如果我单击 wave2 曲线的点,它仍然会像 wave2 visibile 一样弹出。
那么,有没有办法根据曲线的可见性状态禁用捕捉?
下面您可以看到完整的代码;
\documentclass{report}
\usepackage[tikz]{ocgx2}
\usetikzlibrary{backgrounds,calc,shadows,chains,shapes.geometric}
\usetikzlibrary{fit}
\usetikzlibrary{matrix}
\usetikzlibrary{arrows,patterns}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[ddmmyyyy,hhmmss]{datetime}
\usepackage{titlesec}
\renewcommand{\dateseparator}{.}
\usepackage{abstract}
\renewcommand{\abstractnamefont}{\normalfont\Large\bfseries}
\renewcommand{\absnamepos}{flushleft}
\setlength{\absleftindent}{0pt}
\setlength{\absrightindent}{0pt}
%\titleformat{\chapter}[display]\normalfont\bfseries}{\thechapter.}{0pt}{\Huge}
\titleformat{\chapter}{\normalfont\huge\bf}{\thechapter.}{20pt}{\Huge\bf}
\pagenumbering{roman}
\setcounter{section}{0}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\usepackage[hidelinks]{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
\usepackage{pgfplotstable,pgfplots}
\pgfplotsset{width=7cm,compat=1.17}
\usepgfplotslibrary{clickable}
\tikzset{%
button on/.style={%
draw,minimum size=5mm,
line width=1pt,
fill=blue!50,rounded corners,
switch ocg with mark off={#1}{},
},
}
\begin{document}
\tableofcontents
\newpage
\begin{abstract}
Some text...
\end{abstract}
\pagenumbering{arabic}
\newpage
\setcounter{page}{1}
\chapter{Genel Parametreler}
More text...
\chapter{Uygulanan Testler}
asd
\section{Burn In Testleri}
asd
\subsection{Burn-In 1}
asd
\subsubsection{asdasd}
\begin{figure}
\begin{tikzpicture}
\begin{axis}
[% options
xmin=0, xmax=25,
ymin=0, ymax=100,
width = \linewidth,
xlabel=$x$,
ylabel={$y$},
annot/snap dist=5,
clickable coords size = {8,5}, % size in characters for the snapping pop ups
annot/popup size generic = {8,5}, % size in characters for the rest
annot/point format/.initial={(\%.1f, \%.1f)},
scatter/classes={a={mark=*,red!100}, b={mark=*,blue!100}},
cycle list name=color list
]
\begin{scope}[ocg={name=Wawe1 example,ref=Wawe1,status=invisible}]
\addplot
[% options
scatter,smooth, scatter src=explicit symbolic,clickable coords = {exact coords: <br/> (xy)}, mark size = 1pt
]
coordinates
{
(0,0)[a]
(10,9.8)[a]
(5,5)[a]
(9,9)[a]
};
\end{scope}
\begin{scope}[ocg={name=Wawe2 example,ref=Wawe2,status=invisible}]
\addplot
[% options
scatter,smooth, scatter src=explicit symbolic, clickable coords = {exact coords: <br/> (xy)}, mark size = 1pt
]
coordinates
{
(10,10)[b]
(12,12)[b]
(15,15)[b]
(13,7)[b]
};
\end{scope}
\end{axis}
\node[button on=Wawe1]at (-2,8)(but){};
\node[right=0 of but]{Wawe1};
\node[below=3pt of but,button on=Wawe2](but){};
\node[right=0 of but]{Wawe2};
\end{tikzpicture}
\end{figure}
\subsubsection{asdas2d}
asdasd
\end{document}