The issue: making a background gradient with tikz I had the following problem. The resolution of gradient is very low and hatched lines appear. (see an MWE + picture below)
The question: Is it possible to increase the resolution so that the gradient be smooth?
\documentclass[border=0pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,calc}
\usetikzlibrary{positioning,fadings,through}
\definecolor{mydb} {RGB}{68,48,0}
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
\node [shading = axis,rectangle, left color=mydb, right color=mydb!30!white,shading angle=135, anchor=north, minimum width=45.5cm, minimum height=25.5cm, samples=2000] (box) at (10,25){};
\end{tikzpicture}
\begin{tikzpicture}
\node[minimum height=210mm,minimum width=148.5mm,outer sep=0pt] (a)
{};
\end{tikzpicture}
\end{document}
latex
→dvips
→ps2pdf
by any chance? If so, I think you are out of luck because of how the shadings are constructed in Level 2 PostScript. If you are usingpdflatex
, then I think this is a viewer issue. It looks bad for me in some viewers (notablyacroread
9), but good inzathura
(poppler
based viewer). – David Purton Aug 29 '19 at 13:28latex → dvips → ps2pdf
, eitherpdflatex
I'm getting, more or less, the same result. I think that the interesting issue is the possibility of changing the resolution from tikz itself. I'm not sure whether this is possible or not. – Grigorios Kostakos Aug 29 '19 at 13:58dvips
driver by rewriting the PostScript. But believe me, you don't want to do this unless you are crazy :). Thepdftex
driver uses a built in PDF function for the gradient.tikz
does not have control over how it renders. Rather viewers decide how they will render the shading, so you get different output from different viewers. Banding effects are also increased when your two colours are very similar as there aren't as many colours to go in between. – David Purton Aug 29 '19 at 14:07ghostscript
and include the bitmap. This also gives a smooth gradient for me. – David Purton Aug 29 '19 at 14:10samples=2000
has no effect on your shading. – David Purton Aug 29 '19 at 14:33