Differences

This shows you the differences between two versions of the page.

Link to this comparison view

latex:tikz:rose [2013/07/04 08:45] (current)
Line 1: Line 1:
 +<code latex> 
 +\documentclass{article} 
 +\usepackage[pdftex,​active,​tightpage]{preview} 
 +\usepackage{tikz} 
 + \usetikzlibrary{patterns} 
 +\PreviewEnvironment{tikzpicture} 
 +\begin{document} 
 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
 +\def\radius{1} 
 +\def\ticklength{.3} 
 +\def\labelshift{0.35} 
 +\def\overlap{.075} 
 +\def\projangle{17} 
 +\def\angleshift{2} 
 +\begin{tikzpicture}[scale=1.6] 
 + \scriptsize 
 + %% Fill CenterScan 
 + \pattern [pattern=checkerboard light gray] (1,0) -- (3,0) arc (0:​180:​3*\radius) -- (-1,0) arc (180:​0:​\radius);​ 
 + \fill [color=red,​nearly transparent] (1,0) -- (3,0) arc (0:​180:​3*\radius) -- (-1+\overlap,​0) arc (180:​0:​\radius-\overlap);​ 
 + %% Fill RingScan 1 
 + \fill [color=green,​nearly transparent] (0,0) circle (\radius+\overlap);​ 
 + %% Fill RingScan 2 
 + \pattern [pattern=horizontal lines gray] (1,0) -- (3,0) arc (0:​-180:​3*\radius) -- (-1,0) arc (-180:​0:​\radius);​ 
 + \fill [color=blue,​nearly transparent] (1,0) -- (3,0) arc (0:​-180:​3*\radius) -- (-1+\overlap,​0) arc (-180:​0:​\radius-\overlap);​ 
 + %% Projections  
 + \draw [ultra thick,​color=red](\projangle:​\radius-\overlap) -- (\projangle:​3*\radius);​ 
 + \draw [ultra thick,​color=green](\projangle+180+\angleshift:​\radius+\overlap) -- (\projangle+\angleshift:​\radius+\overlap);​ 
 + \draw [ultra thick,​color=blue](\projangle+180:​3*\radius) -- (\projangle+180:​\radius-\overlap);​ 
 + %% inner ring 
 + % ring 
 + \draw (0,0) circle (\radius);​ 
 + % projections 
 + \foreach \angle in {0,​20,​...,​181} 
 + \draw (\angle:​-\radius) -- (\angle:​\radius+\ticklength);​ 
 + \foreach \angle in {0,​5,​...,​179} 
 +
 + % inner ticks 
 + \draw (\angle:​-.5*\ticklength) -- (\angle:​.5*\ticklength);​ 
 +% % median ticks 
 +% \draw [dotted] (\angle:​.5*\ticklength) -- (\angle:​\radius-.5*\ticklength);​  
 +% \draw [dotted] (180+\angle:​.5*\ticklength) -- (180+\angle:​\radius);​  
 + % outer ticks 
 + \draw (\angle:​\radius-.5*\ticklength) -- (\angle:​\radius);​ 
 + }  
 + % labels 
 + \foreach \angle / \label in {0/​1,​30/​200,​60/​500,​90/​750,​120/​1000,​150/​1250,​180/​1500} 
 + \draw (\angle:​\radius-\labelshift) node {\label}; % {\textsf{\label}};​ 
 + %% outer ring  
 + % circle 
 + \draw (0,0) circle (3*\radius);​ 
 + % projections 
 + \foreach \angle in {0,​20,​...,​719} 
 + \draw (.5*\angle:​\radius) -- (.5*\angle:​3*\radius+\ticklength);​ 
 + \foreach \angle in {0,​2.5,​...,​359} 
 +
 + % inner ticks 
 + \draw (\angle:​3*\radius-.5*\ticklength) -- (\angle:​3*\radius+.5*\ticklength);​ 
 +% % median ticks 
 +% \draw [dotted] (\angle:​\radius+.5*\ticklength) -- (\angle:​3*\radius-.5*\ticklength);​ 
 + % outer ticks 
 + \draw (\angle:​\radius) -- (\angle:​\radius+.5*\ticklength);​ 
 + }  
 + % labels 
 + \foreach \angle / \label in {2/1 and,​15/​200,​30/​500,​45/​750,​60/​1000,​75/​1250,​90/​1500,​105/​1750,​120/​2000,​135/​2250,​150/​2500,​165/​2750,​178/​3000} 
 + \draw (\angle:​3*\radius+\labelshift) node {\label}; 
 + \foreach \angle / \label in {2/and 1,​15/​200,​30/​500,​45/​750,​60/​1000,​75/​1250,​90/​1500,​105/​1750,​120/​2000,​135/​2250,​150/​2500,​165/​2750,​178/​3000} 
 + \draw (180+\angle:​3*\radius+\labelshift) node {\label}; 
 + \end{tikzpicture}% 
 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
 +\end{document} 
 +</​code>​