Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Given the plot as follows

enter image description here

I have two problems:

  1. a and b are superimposed on each other, how should I make this clear on the graph?
  2. How could I change legend c to other icons like star? (It looks a bit similar to a)

The code is shown below:

\documentclass[tikz]{standalone}
\usepackage{pgf}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{arrows,automata,positioning}
\begin{document}
 \begin{tikzpicture}[font=\sffamily]
\begin{semilogyaxis}[title=Random Dataset,
legend pos=outer north east,
legend style={draw=none},
xtick={1,2,...,9}, 
scaled ticks=false,
log ticks with fixed point={1000 sep=},
axis x line=bottom,
axis y line=left,
axis line style=-,
minor tick style={draw=none},
enlargelimits,
ylabel = Solving Time (ms),
xlabel = Number of Constraints,
every axis legend/.append style={xshift=-10pt}
]
\addplot plot coordinates{(1,100)(2,100)(3,100)(4,100)(5,100)(6,100)(7,100)(8,100)(9,100)};
\addplot plot coordinates{(1,100)(2,100)(3,100)(4,100)(5,100)(6,100)(7,100)(8,100)(9,100)};
\addplot plot coordinates{(1,78)(2,62)(3,41)(4,44)(5,120)(6,96)(7,133)(8,133)(9,91)};
\legend{a,b,c}
\end{semilogyaxis}
\end{tikzpicture}
\end{document}
share|improve this question

1 Answer 1

One way would be to change the plot styles so that both the a and b markers could be seen. For example using a howllow square for b allows the a points to be visible.

For your second question, using \addplot+[mark=triangle] uses a triangle shape which is sufficiently different so that it won't be confused with the other markers.

enter image description here

Code:

\documentclass[tikz]{standalone}
\usepackage{pgf}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{arrows,automata,positioning}
\begin{document}
 \begin{tikzpicture}[font=\sffamily]
\begin{semilogyaxis}[title=Random Dataset,
legend pos=outer north east,
legend style={draw=none},
xtick={1,2,...,9}, 
scaled ticks=false,
log ticks with fixed point={1000 sep=},
axis x line=bottom,
axis y line=left,
axis line style=-,
minor tick style={draw=none},
enlargelimits,
ylabel = Solving Time (ms),
xlabel = Number of Constraints,
every axis legend/.append style={xshift=-10pt}
]
\addplot plot coordinates{(1,100)(2,100)(3,100)(4,100)(5,100)(6,100)(7,100)(8,100)(9,100)};
\addplot+[draw opacity=0.5, thick, mark=square] plot coordinates{(1,100)(2,100)(3,100)(4,100)(5,100)(6,100)(7,100)(8,100)(9,100)};
\addplot+[mark=triangle] plot coordinates{(1,78)(2,62)(3,41)(4,44)(5,120)(6,96)(7,133)(8,133)(9,91)};
\legend{a,b,c}
\end{semilogyaxis}
\end{tikzpicture}
\end{document}
share|improve this answer
    
The way of handling the superimpose is ingenious, cool! –  william007 Feb 19 '13 at 8:32

Your Answer

 
discard

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.