Graphics, Figures & Tables ⇒ Resolution of fonts in TikZ plots
Resolution of fonts in TikZ plots
I just started working with TikZ and while results are very pleasing the actual plots looks a bit pixalated. Is there any easy way of changing output plots resolution ?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10350
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Resolution of TikZ plots
Stefan
Resolution of fonts in TikZ plots
The problem seems to be mostly visible with text, and as I mentioned the whole plot looks pixelated. I would pferer to to have 300dpi data instead of what I expect is 72dpi.
I was hoping there is some command allowing you to increase the dpi of the output. Only other way I see, which is troublesome, is to make a big plot and scale it down but text problematic as it does not scale down.
My code:
Code: Select all
\newcommand*{\TXTin}[1]{node[black, sloped, midway, inner sep=.1cm,fill=white]{#1}} \newcommand*{\TXTout}[1]{node[black, midway, below, sloped]{#1}}
\definecolor{LightGrey}{HTML}{BFBFBF}
\begin{tikzpicture}
%earth
\fill[LightGrey] (6,6) -- (3,0) \TXTin{R} -- (0,6) \TXTin{R} to [out=25,in=165] (6,6);
\draw [dashed,ultra thick] (0,6) to [out=25,in=165] (6,6);
\draw [dashed] (0,6) -- (3,0) \TXTin{R} -- (6,6) \TXTin{R}; \filldraw [black] (3,0) circle (2pt);
%observer
\draw (0,6) -- (0,8) \TXTout{$h_{rov}$} -- (6,6) \TXTin{LOS};
\filldraw [gray] (0,8) circle (3pt);
\node [above right] at (0,8) {Observer};
\end{tikzpicture}
- Stefan Kottwitz
- Site Admin
- Posts: 10350
- Joined: Mon Mar 10, 2008 9:44 pm
Resolution of fonts in TikZ plots
So I guess it's a font issue. Perhaps you are using a bitmap font, not a type 1 vector font.LKB wrote:The problem seems to be mostly visible with text
LKB wrote:Code: Select all
\begin{tikzpicture} [resolution: 300 300]
resolution
is not a valid option.When I remove this, the picture is ok and can be scaled without getting pixelated.
Stefan
Re: Resolution of TikZ plots
This might be a font issue indeed. On my output it does look like bitmap has been rescaled. Could you advice how can I change the font? I use Lyx as a front-end here but I suspect that font problem got more to do with pdflatex.
I just corrected the code - you are much faster then me ...
- Stefan Kottwitz
- Site Admin
- Posts: 10350
- Joined: Mon Mar 10, 2008 9:44 pm
Resolution of fonts in TikZ plots
Simply add
Code: Select all
\usepackage{lmodern}
Stefan