0

I am trying to create the marks needed for this graph and this process is very lengthy. Is there a shorter way I could do this? I am trying to create a mark at every 1/6 mark between 1 and 6 so that I can place each interval. Here is what I'm trying to create:

enter image description here

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=2]
   \draw [-] (0,0)--coordinate(x axis mid)(6,0);
   \foreach\x/\xtext in {0,{1/6}/{1/6},{2/6}/{2/6},
   {3/6}/{3/6},{4/6}/{4/6},{5/6}/{5/6},1,{7/6}/{7/6},6}
    \draw[shift={(\x,0)}] (0pt,0pt)--(0pt,-2pt);
   \draw [-] (0,0)--coordinate(y axis mid)(0,4);
\end{tikzpicture}
\end{document}

If I need to just hardcode everything then just let me know.

  • Can you give a better example of what the goal is? There is a smooth curve is it a closed form formula? What is the zigzagged line? Is that coming from a data source? – percusse Dec 5 '14 at 4:45
  • I can create the graph its self, but the labels at the bottom of the graph {13-47}, I've had to type in each marks, and I assume there's a shorter way to type it all in. – BMarc20 Dec 5 '14 at 4:49
  • Ah by marks you mean tick labels? – percusse Dec 5 '14 at 5:03
  • Exactly, I thought they were referred to as tick labels. – BMarc20 Dec 5 '14 at 5:32
  • 3
    the title of your post is absolutely useless. Be more specific please – pluton Dec 5 '14 at 8:01
2

Here is how you put the ticks down without having to type them in one at a time by hand.

\begin{tikzpicture}[scale=2]
   \draw [-] (0,0)--coordinate(x axis mid)(5.54,0);
   \draw [-] (0,4)--coordinate(x axis mid)(5.54,4);
   \draw [-] (0,0)--coordinate(y axis mid)(0,4);
   \draw [-] (0,0.8)--coordinate(y axis mid)(5.54,0.8) node[left] at (0,0.8) {11};
   \draw [-] (0,1.6)--coordinate(y axis mid)(5.54,1.6) node[left] at (0,1.6) {12};
   \draw [-] (0,2.4)--coordinate(y axis mid)(5.54,2.4) node[left] at (0,2.4) {13};
   \draw [-] (0,3.2)--coordinate(y axis mid)(5.54,3.2) node[left] at (0,3.2) {14};
   \draw [-] (5.54,-.06)--coordinate(y axis mid)(5.54,4) node[left] at (0,4) {15};
   \foreach\x/\xtext in {0,.167,.33,...,5.54} \draw[shift={(\x,0)}] (0pt,0pt)--(0pt,-2pt);
\end{tikzpicture}

It will look like this when finished.

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.