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.

I use Tikz for creating figures. But there is a problem. If I use for example

\begin{tikzpicture}
\draw[->] (0,0)--(10,0);
\draw[->] (0,0)--(0,10);
\draw[help lines] (-0.1,-0.1) grid (9.9,9.9); 
\draw[thick] (0,0) -- (4,4) -- (5,9) -- (0,0);
\end{tikzpicture}

in TikzEdt then the lines from the grid are grey. But If I use the code in Texmaker then the grid lines are all black and looks like the lines from the axes.

enter image description here enter image description here

Both programs use pdflatex. I can't find out why they gave me different results. I also copy the preamble from tikzedt to texmaker.

share|improve this question
    
Are you using the same zoom levels? –  percusse Jun 30 '12 at 16:50
    
yes. I'm sorry I have not enought reputations to add images. First I thought there was a colorpackage missing. But it's all there. –  wieschoo Jun 30 '12 at 16:56
    
@wieschoo Just upload your image to ifile.it and post a link. One of the regular users will edit it in! :) –  kan Jun 30 '12 at 17:04
    
    
I just tested your code in both texmaker and tikzedt and they produce the desired output. –  azetina Jun 30 '12 at 17:06
add comment

2 Answers

up vote 2 down vote accepted

One problem is that you first draw the axes, and then the grid over it, which you see nicely at high magnification:

enter image description here


You can solve it by reversing the order of the commands:

\begin{tikzpicture}[scale=0.7]
\draw[help lines] (-0.1,-0.1) grid (9.9,9.9); 
\draw[->] (0,0)--(10,0);
\draw[->] (0,0)--(0,10);
\draw[thick] (0,0) -- (4,4) -- (5,9) -- (0,0);
\end{tikzpicture}

enter image description here


Personally, I prefer non-solid lines, e.g. densely dotted

\begin{tikzpicture}[scale=0.7]
\draw[densely dotted] (-0.1,-0.1) grid (9.9,9.9); 
\draw[->] (0,0)--(10,0);
\draw[->] (0,0)--(0,10);
\draw[thick] (0,0) -- (4,4) -- (5,9) -- (0,0);
\end{tikzpicture}

enter image description here

share|improve this answer
    
That's cool. I only have to find a permutation of the commands. Your are "densely dotted" looks much better. –  wieschoo Jun 30 '12 at 18:03
    
While I prefer dashed,color=gray!30!white ;) Great answer –  N3buchadnezzar Jun 30 '12 at 19:47
add comment

The only thing that I can think of that is causing this effect would be the viewer of choice or the update you have for your packages but that shouldn't be the case. The following are the results I get with:

TikzEdt 0.2:

enter image description here

Texmaker:

enter image description here

Note: I am using SumatraPDF viewer.

share|improve this answer
    
thats the problem, but this doesn't solve it. The internal viewer from tikzedt produce the right output but if I choose "Show output in a external viewer" the grid is black again. So the grid is only grey in the internal viewer. How does tikz work with the adobe reader? –  wieschoo Jun 30 '12 at 17:16
    
@wieschoo I don't think the gray output is the right one as long as you did not specify \draw[gray,...] etc. There is an issue with the PDF viewers about the anti-aliasing effects. See for example tex.stackexchange.com/questions/60916/… and other linked questions. –  percusse Jun 30 '12 at 17:46
    
Ok. In the german version of "adobe reader" the option "Dünne Linien deutlicher darstellen" was activated, which means "show thin lines more significant" (my translation). But this isn't satisfying for me. –  wieschoo Jun 30 '12 at 19:04
    
@percusse: According to the manual, help lines is defined as line width=0.2pt,gray. –  Caramdir Jun 30 '12 at 20:20
    
@wieschoo: You can't influence Acrobat Reading settings from withing the pdf. Rasterizing vector graphics on a screen (which usually has a relatively low resolution) is always a trade-off and different programs might choose to display things differently. On a (good) printer the document usually looks much better. –  Caramdir Jun 30 '12 at 20:22
show 1 more comment

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.