Re: Graphics of functions

Ivan Ivanov <[email protected]> Mon, 29 Sep 2003 15:11:15 -0700 (PDT)
Newsgroups gmane.comp.tex.metapost,gmane.comp.tex.metafont
Message-ID <[email protected]>
Johan,
Thank you very much for your response. I added my
remarks in your letter below.

--- Johan Ingvast <[email protected]> wrote:
> Hi
> I hope I understand your problem right,

Yes, perfectly right.

> Would it help if you got the function you want to
> draw in one path?
> Then you can do it as follows. (maybe a bit more
> complicated than
> needed, but on the other hand pretty general)

I really need this generality.

<Skipped some parts> 
> beginfig(1);
>         path p;
>         p:=makePath(H,0,0.1,1); % Generate the path
> from fuction H
>         draw p scaled 5cm;
>         draw p scaled 5cm shifted (0.2cm*right)
> withcolor red;
> endfig;

If I modify your example as follows:

beginfig(2);
         path p;
         p:=makePath(F,0,0.1,1); % Generate the path
 from fuction F
         draw p scaled 5cm;
         draw p scaled 5cm shifted (0.2cm*right)
 withcolor red withpen pencircle scaled .2cm;
endfig;,

I receieve a white gap between red thick graphics and
the real fraphics of F and the gap is at the point of
local minimum. This was what I wanted to overcome.
So I did the following:
beginfig(2);
        path p;
        p:=makePath(H,0,0.1,1); % Generate the path
from fuction H
        draw p scaled 5cm;
        draw p scaled 5cm shifted (0.2cm*down)
withcolor red;
	save cyc, a, b;
	path cyc;
	path a, b;
	a := (0,H(0)) scaled 5cm -- (0,H(0)) scaled 5cm
shifted (0.2cm*down);
	b := (1,H(1)) scaled 5cm -- (1,H(1)) scaled 5cm
shifted (0.2cm*down);
	cyc := buildcycle(p scaled 5cm, a, p scaled 5cm
shifted (0.2cm*down), b);
	fill cyc withcolor red;
	draw p scaled 5cm;
endfig;

Thus I can avoid the gap.
 
> Hope this can help you
Thank you very much for your help. It really help me
to find the correct answer

Best Wished Ivan


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com