[Scilab-users] Filled polygons from polylines

Samuel Gougeon sgougeon at free.fr
Fri Apr 9 19:51:23 CEST 2021


Le 07/04/2021 à 09:25, arctica1963 a écrit :
> Hello,
>
> I have script that reads a csv file containing the data and uses that to
> calculate subsidence from well information. This all works fine, but it is
> not the best way to display the result. Is it possible to take the polyline
> output and generate filled polygons (similar to attached image)?
>
> I am not sure how it is possible from the existing code to close the output
> result used in the plot function to create a closed polygon. Essentially it
> needs extra points otherwise you would just tie the end point and start
> point of the polyline.
>
> It would be good to get some other ideas and whether it is actually
> possible. Original code was in Matlab and had all of the data within the
> script, so I took that out and stored in a separate data file for ease of
> use.
>
> Thanks for any suggestions.
>
> Lester
>
> Backstrip_1D_v1.sce
> <http://mailinglists.scilab.org/file/t495709/Backstrip_1D_v1.sce>
> A1-NC198.csv <http://mailinglists.scilab.org/file/t495709/A1-NC198.csv>
> Backstrip_1D_filled-plot.jpg
> <http://mailinglists.scilab.org/file/t495709/Backstrip_1D_filled-plot.jpg>


Here is a simple example:

y = rand(1,20);
y2 = rand(1,20)+1;
y3 = rand(1,20)+2;
clf, plot([0 y3 0])
plot([0 y2 0])
plot([0 y 0])
gca().children.children.fill_mode = "on";
gca().children.children.background = [color("grey30") ; color("grey50") 
; color("grey70")];

Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210409/4cbfb855/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdoocbpkmhcmpnmg.png
Type: image/png
Size: 10081 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20210409/4cbfb855/attachment.png>


More information about the users mailing list