<--- On Jan 19, David Arnold wrote --->
All,
I have:
\startMPpage %figure library name: intersection
%initialize scale numeric u; 10u=3in;
%ellipses path A, B; A:=fullcircle xyscaled (4u,3u); B:=A shifted (2u,0); draw A withcolor red; label.ulft(btex $A$ etex, point 3 of A) withcolor red; draw B withcolor blue; label.urt(btex $B$ etex, point 1 of B) withcolor blue;
%bounding box draw bbox currentpicture enlarged (0.5u,0.5u);
\stopMPpage
I need an easy way of shading these areas:
1. A intersect B 2. A union B 3. A intersect (complement of B) 4. (complement of A) intersect B
There is venn.mp on ctan. Using it you can do basic shading of intersection, union etc for 0,1,2 or 3 sets very quickly. Read the documentation in source for details. For example \startMPinclusions input venn; pair A,B,T[]; A = (.4venn_width-.5venn_circle_diameter,.5venn_height); B = (.6venn_width+.5venn_circle_diameter,.5venn_height); T1 = (.5venn_width , 0); T2 = (.5venn_width,.5venn_height-.5venn_circle_diameter); vardef venn_shade = red; \stopMPinclusions \startMPpage draw_venn_two(false,true,true,true); label.lft(btex $A$ etex,A); label.rt(btex $B$ etex,B); label.bot(btex $A\cup B$ etex,T2); \stopMPpage \startMPpage draw_venn_two(false,false,true,false); label.lft(btex $A$ etex,A); label.rt(btex $B$ etex,B); label.bot(btex $A\cap B$ etex,T2); \stopMPpage \startMPpage draw_venn_two(true,false,false,false); label.lft(btex $A$ etex,A); label.rt(btex $B$ etex,B); label.bot(btex $A'\cap B'$ etex,T2); \stopMPpage Perhaps one can combine the transparent color functionality of metapost with venn.mp to get really nice colors for intersections etc. Another related question, does anyone know of a good way to hash (hatch) a "set" (in general, any mp closed curve). I know that there is hatching.mp but I was wondering if there are better solutions. Aditya -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008