[scilab-Users] Can I draw a graph without giving "node_x" and "node_y" values? (show_graph)

pam pierre-alain.millet at insa-lyon.fr
Wed Jun 11 16:17:41 CEST 2008


seems to be normal. u have to calculate x and y
i've used this...

//---------------GRAPHEENROND(graphe)
function gr=grapheenrond(g)
    // les positions x et y sont calculées pour un affichage en cercle 
des sommets du graphe g
    nbpoints=g.node_number;
    for i=1:nbpoints                            
        pos_x(i)=100*sin(2*i*%pi/nbpoints);
        pos_y(i)=100*cos(2*i*%pi/nbpoints);
    end
    g.node_y=100+round(pos_y');
    g.node_x=100+round(pos_x');    
    gr=g;   
endfunction

after force directed algorithms could be interseting to have better 
positionning.. i did not find som standard function to do that so i 
developped a limited one...

pam



Rémi G. a écrit :
> Hello!
>
> If I define a graph :
>  g = make_graph('toto',0,3,[1,2,3],[2,3,1])
> And I want to draw it :
>  show_graph(g)
>
> I get many errors begining with (I don't know how to copy/past from 
> scilab interpretor output) :
>  !-- error 60
>  argument with incompatible dimensions
>  ...
>
> This error seems to come from the lack of "node_x" and "node_y" 
> value... Nevertheless, I saw in the graph-list help page that these 
> values are computed by default!
> Could you help on this matter?
>
> Rémi.
>





More information about the users mailing list