2

I am trying to create scatter plot using an input .dat file with custom markers (which are saved as a .png file)

If I do not use the custom markers my plot is plotting correctly - it is overlaid on another image (Overnight_loc.png)

\begin{document}

    \begin{tikzpicture} 

    \begin{axis}[
    enlargelimits = false,
    hide axis,
    ]
        \addplot graphics [
        xmin=-80.5430, xmax=-80.5150,
        ymin=43.4580, ymax=43.4740,
        ]{Overnight_loc.png};
        \addplot+[
        only marks,
            mark=*,
        ]
        table {overnight.dat};
        \end{axis}
    \end{tikzpicture}

\end{document}

works perfectly and with standard * markers. If I change the code by adding:

\pgfdeclareplotmark{home}{%
        \includegraphics[scale=0.05]{home1.png};
        }

before the tikzpicture and set mark=home the code runs, my map appears and the custom markers appear, however they appear clustered at the bottom rather than at the positions they should appear given in overnight.dat.

How can I get tex to plot with my custom markers?

4

Some random images to define a plotmark with image.

\documentclass[]{standalone} 
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\pgfdeclareimage[interpolate,height=4mm,width=8mm]{dmark}{dmark.jpg}

\pgfdeclareplotmark{dmark}{%
\pgftext[at=\pgfpointorigin]{\pgfuseimage{dmark}}%
}

\begin{document}
  \begin{tikzpicture} 
  \begin{axis}[enlargelimits = false,hide axis]
    \addplot graphics[xmin=0,xmax=20,ymin=0,ymax=20]{Dark_Side_of_the_Moon};
    \addplot+[only marks,mark=dmark,domain=0:20,samples=10] {x};
  \end{axis}
  \end{tikzpicture}
\end{document}

enter image description here

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.