Re: About legend instruction in graphics -

14 messages
Open this post in threaded view
|

Re: About legend instruction in graphics -

 Hello, Samuel’s « legends_mc » is a very nice instruction.It does exactly what  I wanted                xLeg=0.;               yLeg=1.04;                                                            Xlegend=["CVitesse";"Vitesse";"Vannage";"Débit";"Chute";"Puissance"]                                                                                                                       legends_mc(Xlegend, Lpc=-10, framed?=%f, pos=[xLeg yLeg])  Other case                                                           Xlegend=["Cons.Vitesse";'Vitesse filtrée';"Dérivée";"Intégrale";"Lim. Ouverture";"Cons. Vannage CVA";"Cons. charge CC"]                                                                                         legends_mc(Xlegend, Lpc=2, framed?=%f, pos=[xLeg yLeg])  :  Best regard Pierre P.De : users <[hidden email]> De la part de Samuel GougeonEnvoyé : mercredi 8 janvier 2020 20:13À : [hidden email]Objet : Re: [Scilab-users] About legend instruction in graphics Hello, Le 08/01/2020 à 19:30, Perrichon a écrit : Hello, When drawing scope X(t) with multiple chanels, is there a way to get a horizontal legend to maximalize the graphic area (as matlab does)All proposal for the legend positionning reduce the graphic area (vertical display with box or no box) Legend are into the graphic. Some curves are not visibleLegend are out of graphic, but reduces the graphic area.   Best Regards Pierre P.  legend_mc() aims to do that: https://fileexchange.scilab.org/toolboxes/274000 --> legends_mcfunction [] = legends_mc(Texts,Styles,Lpc,font_size,thickness,pos,framed?) For many curves & related legends, displays a multicolumn bloc of legends:  - The shape of the bloc can be specified (Lpc)  - Positionning with Logarithmic or/and reversed axes is supported  - Lines styles and Markers styles are supported and can be mixed.    A set of polyline handles or having polyline children can be    alternatively provided  - Lines thickness(es) can be specified (ignored if handles are     given: read out from the polylines properties) HELP: run legends_mc() without any parameter DEMO: run legends_mc(..) without specifying Texts Texts  : vector of legends Styles : a) vector of related lines or markers styles (integer indices)          Styles(i)>0 -> line color (only solid style supported)          -14<= Styles(i) <=0 -> marker (overlay with line unsupported)         b) (2,n) matrix:              Styles(1,:) = as in a)             Styles(2,:) = line style, or color of marker         c) vector of graphical handles. Then all Polyline children            are searched (in chronological order of creation).            Texts must have as many entries as there are available            polylines.            If only 1 handle is given and is an axes, the legends is             set in this axes. When returning, the focus is restored             to the axes priorly active.            If a set of handles or an handle not being an axes is given,            the legends are set in the currently active axes.         Default Styles : gca() Lpc>0 :  (maximal) number of Lines Per Column (integer) Lpc<0 : -(maximal) number of Columns per line (integer) framed? : boolean: if %T, draws the global box of legends (default) pos : position of the block:      "ur" | 1 : in the upper right corner (default)      "ul" | 2 : in the upper left corner      "ll" | 3 : in the lower left corner      "lr" | 4 : in the lower right corner      "?"  | 5 : interactive positionning with the mouse      [xr,yr]: relative coordinates 0 <= xr,yr <= 1 of the upper left          corner of the block, with respect to the upper left corner         of the data bounds area. [0,0] is equivalent to "ul" thickness: scalar or vector of lines thickness.             If a vector is provided, its length must = Styles one.            If styles are from handles, thickness vector is ignored.  DEMOS: run legends_mc(..) without Texts of legends:   clf, legends_mc( framed?=%f )   clf, legends_mc( Lpc=7, pos="?" )   clf, legends_mc( Lpc=-3, pos="lr" )   clf, legends_mc( Lpc=-2, pos=[0.15 0.3] )   clf, legends_mc( font_size=2, pos="ll" )   clf, legends_mc( pos="?", thickness=2 )   clf, legends_mc( pos="lr", thickness=1+round(rand(1:19)) )   clf, plot2d(), legends_mc( Lpc=-3, pos="ll" )   clf, plot(), f=gcf(); legends_mc(Styles=f.children(\$), pos="?") EXAMPLE:    clf, plot2d(), legends_mc("line #"+string(1:3), Lpc=-3, pos="?" )_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

[Scilab-users] density in a graph

 Dear all, I am drawing a graph in a gray scale (say from 1 to 32), using lines of different density. I would like that, in the region of intersection of two lines, the shade of gray be the sum of the densities of each line. How can I manage that ? Thanks in advance for any hint JP Grivet _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

Re: {EXT} density in a graph

 Hello, > De : Jean-Philippe Grivet > Envoyé : jeudi 23 janvier 2020 16:36 > > I am drawing a graph in a gray scale (say from 1 to 32), using lines of different > density. I would like that, in the region of intersection of two lines, the shade > of gray be the sum of the densities of each line. > How can I manage that ? I'm affraid I can't figure out what you're trying to do. Maybe a small drawing or a small sample of data? Do you have lines with a linear density and try to draw a surface density or? -- Christophe Dang Ngoc Chan Mechanical calculation engineer General This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users -- Christophe Dang Ngoc Chan Mechanical calculation engineer
Open this post in threaded view
|

Re: {EXT} density in a graph

 Le 23/01/2020 à 17:24, Dang Ngoc Chan, Christophe a écrit : > Hello, > >> De : Jean-Philippe Grivet >> Envoyé : jeudi 23 janvier 2020 16:36 >> >> I am drawing a graph in a gray scale (say from 1 to 32), using lines of different >> density. I would like that, in the region of intersection of two lines, the shade >> of gray be the sum of the densities of each line. >> How can I manage that ? > I'm affraid I can't figure out what you're trying to do. > > Maybe a small drawing or a small sample of data? > > Do you have lines with a linear density and try to draw a surface density or? > > -- > Christophe Dang Ngoc Chan > Mechanical calculation engineer > > General > This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. > _______________________________________________ > users mailing list > [hidden email] > http://lists.scilab.org/mailman/listinfo/usersSorry that I haven't been clear enough. Suppose that I want to draw a figure X made up of two strips. Strip 1 (SW_NE) has gray level 3; strip 2 (NW-SE) is drawn at gray level 7. The region of overlap of these strips (roughly a parallelogram) should display a density of 7 (darker than either strip). Is that possible within Scilab ? _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

Re: ?==?utf-8?q? density in a graph

 In reply to this post by jean-philippe grivet Hello Jean-Philippe, I think I understand what you want to do, but there is no easy way to get this in scilab. The main issue is that scilab does not support transparency. Otherwise, you could just plot your lines in black with 1/32 alpha (or 255/32 alpha if 0 means transparent and 255 solid color). For this kind of plot, I usually plot everything in scilab with a dummy color (let's say blue), export in svg, edit the svg to replace the dummy color by the transparent one. Antoine     Le Jeudi, Janvier 23, 2020 16:35 CET, Jean-Philippe Grivet <[hidden email]> a écrit:   > Dear all, > > I am drawing a graph in a gray scale (say from 1 to 32), using lines of > different density. I would like that, in the region of intersection of > two lines, the shade of gray be the sum of the densities of each line. > How can I manage that ? > > Thanks in advance for any hint > > JP Grivet > > > _______________________________________________ > users mailing list > [hidden email] > http://lists.scilab.org/mailman/listinfo/users> _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

Re: {EXT} density in a graph

 In reply to this post by jean-philippe grivet Hi Jean-Philippe To me it sounds like you are trying to fill a set of polygons in Scilab, i.e. that what you wish to do can be done with xfpolys ... https://help.scilab.org/docs/6.0.2/en_US/xfpolys.htmlI doubt there is an automagic way to do it in Scilab. Probably it will require some manual labor and or thinking up some function on your own. (?) Best regards, Claus On 23.01.2020 17:50, Jean-Philippe Grivet wrote: > Le 23/01/2020 à 17:24, Dang Ngoc Chan, Christophe a écrit : >> Hello, >> >>> De : Jean-Philippe Grivet >>> Envoyé : jeudi 23 janvier 2020 16:36 >>> >>> I am drawing a graph in a gray scale (say from 1 to 32), using lines >>> of different >>> density. I would like that, in the region of intersection of two >>> lines, the shade >>> of gray be the sum of the densities of each line. >>> How can I manage that ? >> I'm affraid I can't figure out what you're trying to do. >> >> Maybe a small drawing or a small sample of data? >> >> Do you have lines with a linear density and try to draw a surface >> density or? >> >> -- >> Christophe Dang Ngoc Chan >> Mechanical calculation engineer >> >> General >> This e-mail may contain confidential and/or privileged information. >> If you are not the intended recipient (or have received this e-mail >> in error), please notify the sender immediately and destroy this >> e-mail. Any unauthorized copying, disclosure or distribution of the >> material in this e-mail is strictly forbidden. >> _______________________________________________ >> users mailing list >> [hidden email] >> http://lists.scilab.org/mailman/listinfo/users> > Sorry that I haven't been clear enough. Suppose that I want to draw a > figure X made up of two strips. Strip 1 (SW_NE) has gray level 3; > strip 2 (NW-SE) is drawn at gray level 7. The region of overlap of > these strips (roughly a parallelogram) should display a density of 7 > (darker than either strip). Is that possible within Scilab ? > > _______________________________________________ > users mailing list > [hidden email] > http://lists.scilab.org/mailman/listinfo/users_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

Re: ?==?utf-8?q? density in a graph

 In reply to this post by Antoine Monmayrant-2 something like this...only in gray?Am Do., 23. Jan. 2020 um 19:08 Uhr schrieb Antoine Monmayrant <[hidden email]>:Hello Jean-Philippe, I think I understand what you want to do, but there is no easy way to get this in scilab. The main issue is that scilab does not support transparency. Otherwise, you could just plot your lines in black with 1/32 alpha (or 255/32 alpha if 0 means transparent and 255 solid color). For this kind of plot, I usually plot everything in scilab with a dummy color (let's say blue), export in svg, edit the svg to replace the dummy color by the transparent one. Antoine Le Jeudi, Janvier 23, 2020 16:35 CET, Jean-Philippe Grivet <[hidden email]> a écrit: > Dear all, > > I am drawing a graph in a gray scale (say from 1 to 32), using lines of > different density. I would like that, in the region of intersection of > two lines, the shade of gray be the sum of the densities of each line. > How can I manage that ? > > Thanks in advance for any hint > > JP Grivet > > > _______________________________________________ > users mailing list > [hidden email] > http://lists.scilab.org/mailman/listinfo/users > _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

Re: ?==?utf-8?q? ?==?utf-8?q? ?= density in a grap

 That's what I understood, but using lines, not polygons. Another approach than what I suggested previously would be to pixelate everything: ie make a big matrix for the whole graph and increment the value stored at a certain coordinate whenever it falls under one of the lines. You could then plot this matrix using matplot of sgrayplot... with a graycolormap (maybe reversed graycolormap). Far from ideal, but it would work. Antoine     Le Jeudi, Janvier 23, 2020 21:27 CET, P M <[hidden email]> a écrit:   > something like this...only in gray? > [image: test.png] > > Am Do., 23. Jan. 2020 um 19:08 Uhr schrieb Antoine Monmayrant < > [hidden email]>: > > > Hello Jean-Philippe, > > > > I think I understand what you want to do, but there is no easy way to get > > this in scilab. > > The main issue is that scilab does not support transparency. > > Otherwise, you could just plot your lines in black with 1/32 alpha (or > > 255/32 alpha if 0 means transparent and 255 solid color). > > For this kind of plot, I usually plot everything in scilab with a dummy > > color (let's say blue), export in svg, edit the svg to replace the dummy > > color by the transparent one. > > > > Antoine > > > > > > Le Jeudi, Janvier 23, 2020 16:35 CET, Jean-Philippe Grivet < > > [hidden email]> a écrit: > > > > > Dear all, > > > > > > I am drawing a graph in a gray scale (say from 1 to 32), using lines of > > > different density. I would like that, in the region of intersection of > > > two lines, the shade of gray be the sum of the densities of each line. > > > How can I manage that ? > > > > > > Thanks in advance for any hint > > > > > > JP Grivet > > > > > > > > > _______________________________________________ > > > users mailing list > > > [hidden email] > > > http://lists.scilab.org/mailman/listinfo/users> > > > > > > _______________________________________________ > > users mailing list > > [hidden email] > > http://lists.scilab.org/mailman/listinfo/users> > _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

Re: ?==?utf-8?q? density in a graph

 In reply to this post by Antoine Monmayrant-2 Le 23/01/2020 à 19:07, Antoine Monmayrant a écrit : > Hello Jean-Philippe, > > I think I understand what you want to do, but there is no easy way to get this in scilab. > The main issue is that scilab does not support transparency. > Otherwise, you could just plot your lines in black with 1/32 alpha (or 255/32 alpha if 0 means transparent and 255 solid color). > For this kind of plot, I usually plot everything in scilab with a dummy color (let's say blue), export in svg, edit the svg to replace the dummy color by the transparent one. > > Antoine >   >   > Le Jeudi, Janvier 23, 2020 16:35 CET, Jean-Philippe Grivet <[hidden email]> a écrit: >   >> Dear all, >> >> I am drawing a graph in a gray scale (say from 1 to 32), using lines of >> different density. I would like that, in the region of intersection of >> two lines, the shade of gray be the sum of the densities of each line. >> How can I manage that ? >> >> Thanks in advance for any hint >> >> JP Grivet >> >> >> _______________________________________________ >> users mailing list >> [hidden email] >> http://lists.scilab.org/mailman/listinfo/users>> > _______________________________________________ > users mailing list > [hidden email] Thank you Antoine; I am not famo=iliar with the SVG format, but I will investigate. JP Grivet _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

Re: ?==?utf-8?q? density in a graph

 In reply to this post by der_Phil Le 23/01/2020 à 21:27, P M a écrit : something like this...only in gray? Am Do., 23. Jan. 2020 um 19:08 Uhr schrieb Antoine Monmayrant <[hidden email]>: Hello Jean-Philippe, I think I understand what you want to do, but there is no easy way to get this in scilab. The main issue is that scilab does not support transparency. Otherwise, you could just plot your lines in black with 1/32 alpha (or 255/32 alpha if 0 means transparent and 255 solid color). For this kind of plot, I usually plot everything in scilab with a dummy color (let's say blue), export in svg, edit the svg to replace the dummy color by the transparent one. Antoine Le Jeudi, Janvier 23, 2020 16:35 CET, Jean-Philippe Grivet <[hidden email]> a écrit: > Dear all, > > I am drawing a graph in a gray scale (say from 1 to 32), using lines of > different density. I would like that, in the region of intersection of > two lines, the shade of gray be the sum of the densities of each line. > How can I manage that ? > > Thanks in advance for any hint > > JP Grivet > > > _______________________________________________ > users mailing list > [hidden email] > http://lists.scilab.org/mailman/listinfo/users > _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users ```_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users ``` You understood perfectly, although my goal is simpler: instead of a blend of colors I look for a sum of densities. _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
Open this post in threaded view
|

Re: {EXT} Re: ?==?utf-8?q? density in a graph

 In reply to this post by jean-philippe grivet Hello, > De : Jean-Philippe Grivet > Envoyé : vendredi 24 janvier 2020 10:24 > > Thank you Antoine; I am not famo=iliar with the SVG format, but I will > investigate. As you seem to understand French, may I recommend you a small page of mine? https://fr.wikibooks.org/wiki/D%C3%A9couvrir_le_SVG/Le_SVG_pour_l%27enseignement_des_math%C3%A9matiques_et_de_la_programmationHope this helps, regards -- Christophe Dang Ngoc Chan Mechanical calculation engineer General This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users -- Christophe Dang Ngoc Chan Mechanical calculation engineer
Open this post in threaded view
|

Re: ?= density in a grap

 In reply to this post by Antoine Monmayrant-2 Le 24/01/2020 à 08:45, Antoine Monmayrant a écrit : > That's what I understood, but using lines, not polygons. > > Another approach than what I suggested previously would be to pixelate everything: ie make a big matrix for the whole graph and increment the value stored at a certain coordinate whenever it falls under one of the lines. > You could then plot this matrix using matplot of sgrayplot... with a graycolormap (maybe reversed graycolormap). > Far from ideal, but it would work. > > Antoine >   >   > Le Jeudi, Janvier 23, 2020 21:27 CET, P M <[hidden email]> a écrit: >   >> something like this...only in gray? >> [image: test.png] >> >> Am Do., 23. Jan. 2020 um 19:08 Uhr schrieb Antoine Monmayrant < >> [hidden email]>: >> >>> Hello Jean-Philippe, >>> >>> I think I understand what you want to do, but there is no easy way to get >>> this in scilab. >>> The main issue is that scilab does not support transparency. >>> Otherwise, you could just plot your lines in black with 1/32 alpha (or >>> 255/32 alpha if 0 means transparent and 255 solid color). >>> For this kind of plot, I usually plot everything in scilab with a dummy >>> color (let's say blue), export in svg, edit the svg to replace the dummy >>> color by the transparent one. >>> >>> Antoine >>> >>> >>> Le Jeudi, Janvier 23, 2020 16:35 CET, Jean-Philippe Grivet < >>> [hidden email]> a écrit: >>> >>>> Dear all, >>>> >>>> I am drawing a graph in a gray scale (say from 1 to 32), using lines of >>>> different density. I would like that, in the region of intersection of >>>> two lines, the shade of gray be the sum of the densities of each line. >>>> How can I manage that ? >>>> >>>> Thanks in advance for any hint >>>> >>>> JP Grivet >>>> >>>> >>>> _______________________________________________ >>>> users mailing list >>>> [hidden email] >>>> http://lists.scilab.org/mailman/listinfo/users>>>> >>> _______________________________________________ >>> users mailing list >>> [hidden email] >>> http://lists.scilab.org/mailman/listinfo/users>>> > _______________________________________________ > users mailing list > [hidden email] > http://lists.scilab.org/mailman/listinfo/usersThis approach looks rather easy to me. Have you a suggestion on how I can define the pixels to be modified ? Than you all for your suggestions JP Grivet _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users