Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[tikz]{standalone}
- usepackage{pgfplots}
- usepackage{pgfplotstable}
- begin{document}
- pgfplotstableread{
- 1
- 2.5
- 3
- } myTable % -- I can't use this method with the `expr` syntax ?
- begin{tikzpicture}
- begin{axis}
- [
- xtick = {1,2.5,3},
- ytick = {1,6.25,9},
- domain = 0:4,
- axis lines = middle,
- ]
- addplot [thick, blue] {x^2} node [near end, anchor = east] {$y = x^2$};
- addplot [xcomb, red] table[x index = 0,y expr=x^2] {
- 1
- 2.5
- 3
- };
- addplot [ycomb, red] table[x index = 0,y expr=x^2] {
- 1
- 2.5
- 3
- };
- %addplot table[x index=0,y expr=x^2] {myTable}; % does not work ?!
- end{axis}
- end{tikzpicture}
- end{document}
- draw [myStyle] (axis cs: 1, 0) |- (axis cs: 0, 1) ;
- draw [myStyle] (axis cs: 2.5, 0) |- (axis cs: 0, 6.25) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement