I just started using tikZ together and find it to be very suitable for my needs. I wanted to draw the attached diagram, had a difficult time. I would appreciate any starting help.
Thanks a lot in advance

Fawad
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
Then you can for sure show your recent efforts in form of a concrete code example. It's easier and faster to correct some presented code than to write something from scratch.thinkpadT wrote:[…] I wanted to draw the attached diagram, had a difficult time. […]
Code: Select all
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{tikzpicture}
\draw[gray,fill=gray!10] (-1.5,0.5) rectangle +(3,-1);
\fill[blue,path fading=east] (0:0) -- (10:6) -- (-10:6) -- cycle;
\fill[blue,path fading=west] (0:0) -- (-10:-6) -- (10:-6) -- cycle;
\fill[red,path fading=east] (0:0) -- (3:6) -- (-3:6) -- cycle;
\end{tikzpicture}
\end{document}
Code: Select all
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%\draw[help lines,step=.5,lightgray] (-5,-2) grid (5,2) ;
\path [draw=black,fill=red!70] (-5,1) -- (0,0) -- (-5,-1) -- cycle ;
\path [draw=black,fill=red!70] (5,1) -- (0,0) -- (5,-1) -- cycle ;
\path [draw=black,fill=blue!70] (5,0.3) -- (0,0) -- (5,-0.3) -- cycle ;
\draw [gray] (-1,-.4) rectangle (1,.4) ;
\node [below] at (0,-0.5) {gas cell} ;
\draw (-3,0) -- (-3,1.5) node[above] {\small pump laser} ;
\draw (3,0) -- (3,1.5) node[above] {\small higher harmonics} ;
\end{tikzpicture}
\end{document}
Code: Select all
\documentclass[landscape]{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{fadings}
\begin{document}
\begin{tikzpicture}[domain=1:1]
%------------------fundamental and harmonics
\fill[blue,path fading=east] (0:0) -- (10:6) -- (-10:6) -- cycle;
\fill[blue,path fading=west] (0:0) -- (-10:-6) -- (10:-6) -- cycle;
\fill[red,path fading=east] (0:0) -- (3:6) -- (-3:6) -- cycle;
%-----------captions
\draw (-3,0) -- (-3,1.5) node[above] {\small pump laser} ;
\draw (3,0) -- (3,1.5) node[above] {\small higher harmonics} ;
\node [below] at (0,-0.5) {gas cell} ;
%----------transparent gas cell
\begin{scope}[fill opacity = 0.3]
\draw[gray!25,fill=gray!10] (-1.5,0.5) rectangle +(3,-1);
\end{scope}
\end{tikzpicture}
\end{document}
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