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

Good morning, I would like to plot the following function: x=60-(1/6)*y. This function I'd like to be presented only in the positive side of both axes. How can I achive this? Is there a package or any order on how can I have any function plotted? I have tried many things seen both in this site and in others but I haven't succeded yet in making a good looking figure. Thanks in advance

share|improve this question
What things have you tried? PGFPlots? If so, could you show your code and explain why you're not happy with the result? – Jake Feb 6 '13 at 10:01
Welcome to TeX.SX. – Claudio Fiandrino Feb 6 '13 at 10:16
Sorry my function was: y=60-(1/6)*x and the code i've tried was: \documentclass[12pt,a4paper]{article} \begin{document} \usepackage{tikz} \usepackage{color} \begin{tikzpicture}[xscale=14, yscale=4] \draw[thick, <->](0,0.8)--(0,0)--(0.5,0); \draw[blue, domain=0:.5] plot (\x, {60-\x/6}); \end{tikzpicture} – giannis Feb 6 '13 at 19:30
\end{document} forgot it – giannis Feb 6 '13 at 19:31
up vote 1 down vote accepted

As stated in the comments before, you can use the great package pgfplots for this.

\addplot [domain=0:360,blue] {60-x/6};

pgfplots plot as stated above, clipped with preview

But I can't really recomend plotting a simple function like this. It is easy enough to read, the ink to information ratio is not to well. If you want further information on ink to information ratio I suggest reading something written by Edward Tufte. Alternatively I would recommend the TikZ manual. pgfplots is build on TikZ.
If there is a good reason to still do it: Happy TeXing!

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.