Done with the mfpic
package, a (La)TeX interface to MetaPost.
Since the picture borders' coordinates \xmin
, \xmax
, \ymin
, \ymax
take their values in the four arguments of the mfpic
environment, I've tried to parameterize the picture as much as possible in function of them. Hence the relative length of the code.
Key parameters here are the x-coordinate of the upper left summit G of the ‘‘LH Gap’’, that is to say \xmin
, the common height barheight
of these gaps, which is also the second coordinate of G, and the y-coordinate \ymax
of the picture's upper-right corner.
It may be fun to play with those three parameters and see how the picture fares (without warranty :-)). Below I gave those parameters the values given in Harish Kumar's tikz coding.
\documentclass{scrartcl}
\usepackage[metapost, mplabels, truebbox]{mfpic}
\setlength{\mfpicunit}{1cm}
\mfpverbtex{%&latex
\documentclass{scrartcl}
\begin{document}}
\opengraphsfile{\jobname}
\begin{document}
\begin{mfpic}[1]{-5}{6}{0}{8}
\setmfnumeric{barheight}{1}
\setmfpair{G}{(\xmin, barheight)} % Upper left summit of "LH Gap"
\setmfpair{C}{(- xpart G, \ymax - barheight)} % Lower right summit of "RH Gap"
\hatchcolor[gray]{.8}
\lhatch\rect{G, (xpart C, \ymin)}
\lines{G, (xpart C, ypart G)}
\lhatch\rect{(xpart G, \ymax), C}
\lines{(xpart G, ypart C), C}
\lines{(xpart G, \ymax), (xpart C, \ymax)}
\drawcolor[gray]{.6}
\dashed\mfobj{origin{dir 60} --- (.4xpart C, .6ypart C) .. C{right}}
\dashed\mfobj{G{right} .. C{right}}
\dashed\mfobj{G{right} .. (0, \ymax){dir 70}}
\setmfarray{path}{P}{%
G{right} ... (0, 3/7ypart C){dir 60},
(0, 5/7ypart C){dir 10} .. (3.5/5xpart C, ypart C) --- C{right}}
\drawcolor{blue}
\mfobj{P1}\mfobj{P2}
\pointcolor{blue}
\point[3bp]{point 1 of P1}
\point[3bp]{point 0 of P2}
\drawcolor{black}
\doaxes{xy}
\dashed\lines{(xpart C, 0), (xpart C, \ymax)}
\tlpointsep{3bp}
\tlabels{[tc]{origin}{$O$} [cl]{(\xmax, 0)}{$\beta_p$}
[tc]{(xpart C, 0)}{$+\pi$} [bc]{(0, \ymax)}{$\omega$}
[cc]{(.5xpart C, .5(ypart C + \ymax))}{\textbf{RH Gap}}
[cc]{(.5xpart G, .5(ypart G + \ymin))}{\textbf{LH Gap}}}
\end{mfpic}
\closegraphsfile
\end{document}
The result is thus more or less the same, when the program is executed with (PDF)LaTeX, then with MetaPost and then again with (PDF)LaTeX:
