Bonjour à tous,

I hope I'm not too much out of topic, but I'm trying
to put a metapost figure in a context file.
I use a separate file for the figure to keep it
independant, (and to avoid cumul of problems :-)

The objectif is to build a graph by positionning some
node (for now, it is just a circle)
connecting them bu some ncarc connector (using metaObj)
and the put label onto these arc.

I know that one can do that using tree or matrix mataObj
feature, but I'd want to be flexible on the node positions,

Thank you very much for any help!

-- Maurice Diamantini  http://www.ensta.fr/~diam

%%% START SAMPLE %%%%%%%%%%%%%%%%%%%%%%%
input mp-tool ; % some initializations and auxiliary macros
input mp-spec ; % macros that support special features
input metaobj.mp ; % suffixe non indispensable ?

beginfig(1) ;
    numeric u; u=1cm;

    z0=(0u,2u);
    z1=(3u,4u);
    z2=(6u,4u);
    % ...

    % I'll have to create my one metaObj (later)
    % newCircle.a1("") "circmargin(0.3u)";
    % label(btex $x^2$ etex, z1);

    newCircle.a0(btex 0 etex) "circmargin(0.1u)";
    newCircle.a1(btex 1 etex) "circmargin(0.1u)";
    newCircle.a2(btex 2 etex) "circmargin(0.1u)";

    a0.c = z0;
    a1.c = z1;
    a2.c = z2;

    % Question: how can I put a label on this arc???
    ncarc(a0)(a1) "name(nc01)";
    % The following doesn't work !
    % ObjLabel.nc01(btex 0 etex)   "labpos(0.75)",
    %                              "labdir(top)";

    drawObj(a0,a1,a2,a3,a4,a5,a6);

endfig ;
end .
%%% END SAMPLE %%%%%%%%%%%%%%%%%%%%%%%
_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to