I have been searching for hours now on how to fix these small problems, and I am finally admitting defeat and humbly ask for help. Lately I have been going over some of my badly drawn figures, trying to clean the up and whatnot.
\documentclass[10pt,a4paper]{article}
\usepackage{tikz,tkz-euclide,pgfplots}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[x=0.02cm,y=0.02cm,scale=0.8]
\tkzInit[ymin=-40,ymax=390,xmin=-40,xmax=540]
\tkzClip
\draw[help lines,ultra thin,dashed,gray!50!white] (-50,-50) grid (550,400);
\coordinate [label=below right:{50}] (x_1) at (50,0);
\coordinate [label=below right:{}] (B) at (0,390);
\coordinate [label=above right:{\large $y$}] (U) at (0,350);
\coordinate [label=above left:{\large $x$}] (A) at (540,0);
\coordinate [label=below right:{50}] (x_1) at (50,0);
\coordinate [label=below right:{100}] (x_2) at (100,0);
\coordinate [label=below right:{150}] (x_3) at (150,0);
\coordinate [label=below right:{200}] (x_4) at (200,0);
\coordinate [label=below right:{250}] (x_5) at (250,0);
\coordinate [label=below right:{300}] (x_6) at (300,0);
\coordinate [label=below right:{350}] (x_7) at (350,0);
\coordinate [label=below right:{400}] (x_8) at (400,0);
\coordinate [label=below right:{450}] (x_9) at (450,0);
\coordinate [label=below right:{500}] (x_10) at (500,0);
\coordinate [label=below right:{0}] (O) at (0,0);
\coordinate [label=above left:{50}] (y_1) at (0,50);
\coordinate [label=above left:{100}] (y_2) at (0,100);
\coordinate [label=above left:{150}] (y_3) at (0,150);
\coordinate [label=above left:{200}] (y_4) at (0,200);
\coordinate [label=above left:{250}] (y_5) at (0,250);
\coordinate [label=above left:{300}] (y_6) at (0,300);
\coordinate [label=above left:{350}] (y_7) at (0,350);
\coordinate [label=above left:{\bf Kostnader per m{\aa}ned (kroner)}] (R) at (400,350);
\coordinate [label=above left:{\bf Ringetid (minutter)}] (K) at (540,20);
\tkzDefPoint(0,-50){C}
\tkzDefPoint(-50,0){D}
\tkzDefPoint(0,87.50){S}
\tkzDefPoint(500,337.50){T}
\tkzDrawSegment[thick,-stealth](D,A)
\tkzDrawSegment[thick,-stealth](C,B)
\tkzDrawSegment[ultra thick,red](S,T)
\end{tikzpicture}
\vspace*{2ex}
\begin{tikzpicture}
\begin{axis}[
scale only axis,
grid=major,
grid style={dashed, gray!40},
axis lines=middle,
inner axis line style={-stealth},
xlabel={\begin{tabular}{@{}r@{}}\bf Ringetid (minutter)\\ \large $x$\end{tabular}},
ylabel={\large $y$ \ \ \normalsize \bf Kostnader per m{\aa}ned (kroner)},
ytick={0,50,...,350},
xtick={0,50,...,500},
x tick label style={below right},
y tick label style={above left,},
ymin=-50,
ymax=380,
xmin=-50,
xmax=550,
]
\addplot[color=red,very thick] coordinates { (0, 75) (500, 340)};
\end{axis}
\end{tikzpicture}
\end{document}
The first image as a rather messy code, but the output is exactly as I want it. I tried cleaning up the code, but ran into heaps of problems.
My main issue how to keep the ratio between the x- and y-axis, is there any way to do this?
(Now I also had some problems with the x and y labels, and the thickness of the axis, but I guess that can wait for another answer...). Any other hints on improvements would be great. =)
\bf
,\it
etc. Rather use\bfseries
or\textbf{...}
. See Does it matter if I use \textit or \it, \bfseries or \bf, etc