TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to plot some intervals with pgfplots and wanted to use a custom mark for upper and lower bound. I planned doing this by using a "V" for the upper bound and a "^" for the lower bound (ideally not the letters but symbols that look like the upper and lower half of an X). The idea here is that both symbols will merge into an X for empty intervals.

I guess I could get symbols like those with text mark={v} but the alignment would be off, as pgfplots would center the mark instead of using the tip of the "v" as its baseline.

Any idea how I could get the alignment right?

share|improve this question

PGFPlots can use any plot mark which is defined in pgf. You may want to study pgflibraryplotmarks.code.tex (which is shipped with pgf) and define a mark accordingly.

The alignment is simple: at the time when plot marks are drawn, the origin (0pt,0pt) is the marks position. Simply make sure that your V has y>0pt and ^ has y < 0pt, that's all.

share|improve this answer
Thanks, thats what I found, when I was looking at the definition of the existing plot marks in the source code. I tried to add an answer here but I don't have enough reputation yet, so I have to wait for 7 more hours. I will add the answer tomorrow. If someone discovers the question in the meantime: the answer involves using \pgfdeclareplotmark, \pgfpathmoveto, \pgfpathlineto and \pgfplotmarksize – Flogo Sep 7 '11 at 18:04
up vote 3 down vote accepted

I found a solution after looking in the pgfplots source code. With the following definition I got the plot marks I wanted


After the definition the marks can be used like any other mark, e.g.

\addplot[only marks, mark=^] coordinates { (0,0) }
\addplot[only marks, mark=v] coordinates { (0,1) }
\addplot[mark=none] coordinates { (0,0) (0,1) }
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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