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.

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
4  
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
1  
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

1 Answer 1

up vote 0 down vote accepted

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

\documentclass{minimal}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=0,xmax=360,ymin=0]
\addplot [domain=0:360,blue] {60-x/6};
\end{axis}
\end{tikzpicture}
\end{document}

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

 
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.