This question continuous my another.
See the code:
\documentclass{scrartcl}
\usepackage{tikz}
\usepackage[per-mode = fraction]{siunitx}
\usetikzlibrary{datavisualization.formats.functions}
\begin{document}
\begin{tikzpicture}
\datavisualization[scientific axes = {clean,
end labels
},
x axis = {label = $\frac{v}{\si{\cubic\m\per\kg}}$},
y axis = {label = $\frac{p}{\si{\bar}}$},
data/format = function,
visualize as smooth line/.list = {isentropic_press,
isobaric,
isentropic_decompress
}
]
data[set = isentropic_press] {var x : interval[.5 : 2];
func y = 1 / \value x ^ 1.4;
}
data[set = isobaric] {var x : interval[.5 : 1];
func y = 1 / .5 ^ 1.4;
}
data[set = isentropic_decompress] {var x : interval[1 : 2];
func y = 1 / (\value x - .5) ^ 1.4;%-.5: shifts the function by - 0.5 to the right
}
%accents important points
info {\draw (visualization cs:x = 2,
y = {(1 / 2 ^ 1.4)}
) circle [radius = 1pt]
node [right,
font = \footnotesize
] {1};
}
info {\draw (visualization cs:x = .5,
y = {(1 / .5 ^ 1.4)}
) circle [radius = 1pt]
node [above,
font = \footnotesize
] {2};
}
info {\draw (visualization cs:x = 1,
y = {(1 / .5 ^ 1.4)}
) circle [radius = 1pt]
node [above,
font = \footnotesize
] {3};
}
info {\draw (visualization cs:x = 2,
y = {(1 / 1.5 ^ 1.4)}
) circle [radius = 1pt]
node [right,
font = \footnotesize
] {4};
};
\end{tikzpicture}
\end{document}
The info lines (starts with the comment %accents important points) above looks already the same (only coordinates, alignment and text changes). Is there a way to reduce the amount of code when accenting several points?
The \datavisualization ... info[options]{code} ...; command is described on page 766 of the TikZ & PGF manual.
Thank you for your help in advance!
infovia a/.listargument, just like you did with thevisualize asarguments. Generally, they are two separate steps: Draw the data graph and the annotation. Within\datavisualization, they are separate. If you need to combine them, you would have to turn topgfplots. – Huang_d Jun 03 '17 at 14:29info, like you wrote, goes in the right direction. But I have difficulties to achieve it. I don't know how to do it via/.list. Shame on me! Can you please create an answer with the solution you described (put it all into oneinfovia a/.list)? @cfr you are right, the most important things changes. I thought one can reduce the code, because it is already the same. – Su-47 Jun 04 '17 at 11:10