From: W. Trevor King Date: Sat, 19 Dec 2009 00:00:07 +0000 (-0500) Subject: Transitioned contour figure from MetaPost to Asymptote X-Git-Tag: v1.0~469 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9ea8cc68df5a71751ee8ffc20ad5ce5baa6028ba;p=thesis.git Transitioned contour figure from MetaPost to Asymptote --- diff --git a/tex/src/cantilever_calib/Makefile b/tex/src/cantilever_calib/Makefile index f1b083b..252e60b 100644 --- a/tex/src/cantilever_calib/Makefile +++ b/tex/src/cantilever_calib/Makefile @@ -1,17 +1,16 @@ -GEN_FILES = mp/contour.1 dot/concept_map.png +GEN_FILES = contour.pdf dot/concept_map.png all : $(GEN_FILES) clean : rm -f $(GEN_FILES) - $(MAKE) -C mp clean $(MAKE) -C test clean check : $(MAKE) -C test all -mp/contour.1 : - $(MAKE) -C mp images +contour.pdf : + asy -f pdf contour.asy dot/concept_map.png : dot -Tpng dot/concept_map.dot > $@ diff --git a/tex/src/cantilever_calib/contour.asy b/tex/src/cantilever_calib/contour.asy new file mode 100644 index 0000000..76f11ba --- /dev/null +++ b/tex/src/cantilever_calib/contour.asy @@ -0,0 +1,17 @@ +// Upper half plane contour integral + +import graph; +size(5cm, 5cm); + +real r=2cm; + +pen p_axes = linewidth(0.5*linewidth())+grey; +draw((-1.2r,0)--(1.2r,0), p_axes, Arrow); +label("Re", (1.2r, 0), S); +draw((0,0)--(0,1.2r), p_axes, Arrow); +label("Im", (0, 1.2r), W); + +pen p_contour = linewidth()+blue; +draw((-r,0)--(r,0), p_contour); +draw((0,0)--(r/2,0), p_contour, Arrow); +draw(arc((0,0), r, 0, 180, CCW), p_contour); diff --git a/tex/src/cantilever_calib/contour_integration.tex b/tex/src/cantilever_calib/contour_integration.tex index c8b5de9..5a3d087 100644 --- a/tex/src/cantilever_calib/contour_integration.tex +++ b/tex/src/cantilever_calib/contour_integration.tex @@ -2,7 +2,7 @@ \begin{figure} \begin{centering} - %\includegraphics[width=0.3\textwidth]{mp/contour.1} \\ + \includegraphics[width=0.3\textwidth]{cantilever_calib/contour} \\ \caption{Integral contour \C\ enclosing the upper half plane.} \label{f.UHP_contour} \end{centering} diff --git a/tex/src/cantilever_calib/mp/Makefile b/tex/src/cantilever_calib/mp/Makefile deleted file mode 100644 index be5e052..0000000 --- a/tex/src/cantilever_calib/mp/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -MPS = contour - - -TEMP_FILES = $(MPS:%=%.mp[a-z]) $(MPS:%=%.log) mp* texnum.mpx -GENERATED_FILES = $(MPS:%=%.[0-9]*) sample.log sample.aux sample.pdf - -#PDFVIEWER = gv -PDFVIEWER = xpdf -#PDFVIEWER = evince - -images : $(MPS:%=%.1) - -all : view - -view : sample.pdf - $(PDFVIEWER) sample.pdf & - -clean : semi-clean - rm -f $(GENERATED_FILES) - -semi-clean : - rm -f $(TEMP_FILES) - -# generate a pdf containing all mp images for previewing-troubleshooting -# depend on the first image from each mp file -sample.pdf : sample.tex images - pdflatex sample.tex - -# if we call for the first image from an mp file, make them all -%.1 : %.mp - mpost $< diff --git a/tex/src/cantilever_calib/mp/contour.mp b/tex/src/cantilever_calib/mp/contour.mp deleted file mode 100644 index ce60879..0000000 --- a/tex/src/cantilever_calib/mp/contour.mp +++ /dev/null @@ -1,55 +0,0 @@ -%% Sarcomere graphic - -boolean labels; labels := false; - -% coloring in rgb -color axis_color, contour_color, text_color; -%acolor = (0,.1736,.62); % drexel blue -%mcolor = (1,0.85,0.24); % drexel yellow -axis_color = (0,0,0); % black -contour_color = (0,0,1); % blue -text_color = (0,0,0); % black - -% sizing -numeric radius; -radius := 0.7; -u := 2cm; % define units - -% Generate and draw axes with labels. -% Origin at CENTER, -% LL (lower left) and UR (upper right) define the length of the axis markings -% XLABEL and YLABEL contain text to label the axes -def draw_axis(expr center, ll, ur, xlabel, ylabel) = - save start, stop; - pair start, stop; - - % draw X - start := (ll dotprod (1,0),0); % get the x portion - stop := (ur dotprod (1,0),0); - drawarrow start .. stop withcolor axis_color; - label.bot(xlabel, stop) withcolor text_color; - - % draw Y - start := (0, ll dotprod (0,1)); % get the y portion - stop := (0, ur dotprod (0,1)); - drawarrow start .. stop withcolor axis_color; - label.lft(ylabel, stop) withcolor text_color; -enddef; - -% Generate and draw a semicircle in the upper half plane -% Centered at CENTER with radius RAD. -def draw_UHP_semicircle(expr center, rad) = - % straight line - draw (center-(rad,0)) .. (center+(rad,0)) withcolor contour_color; - % semicircle - draw (center-(rad,0)){up} .. tension(1) .. {down}(center+(rad,0)) - withcolor contour_color; - drawarrow center .. (center+(rad/2,0)) withcolor contour_color; -enddef; - -beginfig(1) - draw_axis(origin, -(u,0.2u), (u,u), "Re", "Im"); - draw_UHP_semicircle(origin, radius * u); -endfig; - -end diff --git a/tex/src/cantilever_calib/mp/sample.tex b/tex/src/cantilever_calib/mp/sample.tex deleted file mode 100644 index e8fca4f..0000000 --- a/tex/src/cantilever_calib/mp/sample.tex +++ /dev/null @@ -1,12 +0,0 @@ -\documentclass{article} -\usepackage{graphicx} -\usepackage{fullpage} - -\DeclareGraphicsRule{*}{mps}{*}{} % if you don't recognize the type, it's mps - -\newcommand{\cmpi}[1]{contour #1 \includegraphics{contour.#1}\vspace{1cm} \\} - -\begin{document} -\centering -\cmpi{1} -\end{document}