I'd like to get the plot in the following figure (without grid):

enter image description here

Until now I got only axis+point:



Thank you very much for your time.


You mean something like the following?

% used PGFPlots v1.15
        xmin=0,     xmax=8,
        ymin=0,     ymax=8,
        axis lines=center,
        \addplot [color=red,mark=*] coordinates {(2,2)};

        \draw [dashed,help lines] (0,2) -| (2,0);

image showing the result of above code

  • Hello @StefanPinnow, how come it does not work if I use compat=1.9? – Gennaro Arguzzi Nov 5 '17 at 13:36
  • @GennaroArguzzi, because then the TikZ coordinates have to be preceded by axis cs:, i.e. you have write \draw [dashed,help lines] (axis cs:0,2) -| (axis cs:2,0);. – Stefan Pinnow Nov 5 '17 at 15:08
  • @GennaroArguzzi, you are welcome. – Stefan Pinnow Nov 5 '17 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.