I have a question about placing pgfplots nodes with respect to page coordinates in a tikzgraphics. In particular, I am using beamer (this should not matter), but create the whole frame as a single tikzpicture. It is convenient to place the tikz nodes with respect to the "current page.north west" anchor.

I am having trouble doing the same for pgfplots axis nodes. How do I specify "current page.north west" for the "at" option to the axis environment?

There are several other questions here related to this, but they all use custom macros related to "\coordinate" which do not seem to work in my use case.




\begin{tikzpicture}[remember picture,overlay]
  % My nodes are placed with respect to the "current page.north west" anchor
  \node[anchor=north west,
        minimum width=5cm,
        minimum height=4cm,
        outer sep=0,
        inner sep=0,
  ] at (current page.north west){};

  % How do I do the same thing for pgfplots nodes?
    anchor=north west,
    at={(0, 0)}, % what should I put here instead of "current page.north west"?
    scale only axis,
    axis background/.style={fill=green},

  • 1
    at={(current page.north west)} should work. Note that it will not coincide with your \node because they have a different yshift. – Max Sep 11 '18 at 9:54
  • This works. My bad, I thought that I had tried exactly this several times. Must have been a typo on my end. Thanks! – sblatt Sep 11 '18 at 10:20
  • 1
    No problem. Possibly you forgot the parentheses, I believe those are required. – Max Sep 11 '18 at 10:21
  • 4
    I'm voting to close this question as off-topic because it is solved in the comments. – Max Sep 11 '18 at 10:22

As Max pointed out, simply putting

at={(current page.north west)},

fixes it.

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