{"id":1686,"date":"2022-11-29T23:49:20","date_gmt":"2022-11-30T07:49:20","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=1686"},"modified":"2022-11-29T23:49:20","modified_gmt":"2022-11-30T07:49:20","slug":"210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-3-2-2-3-2-2-4-2-2-2-2-2-3","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2022\/11\/210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-3-2-2-3-2-2-4-2-2-2-2-2-3\/","title":{"rendered":"#319 Scatter plot using ScottPlot.WinForms and C#"},"content":{"rendered":"<p><a href=\"https:\/\/gantovnik.com\/bio-tips\/2022\/11\/210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-3-2-2-3-2-2-4-2-2-2-2-2-3\/ex319\/\" rel=\"attachment wp-att-1687\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full wp-image-1687\" src=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/11\/ex319.png?resize=1009%2C609&#038;ssl=1\" alt=\"\" width=\"1009\" height=\"609\" srcset=\"https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/11\/ex319.png 1009w, https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/11\/ex319-980x591.png 980w, https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/11\/ex319-480x290.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1009px, 100vw\" \/><\/a><\/p>\n<p>1) Install the ScottPlot.WinForms NuGet package<br \/>\n2) Drag a FormsPlot from the toolbox onto the form<\/p>\n<p>Form1.cs<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nnamespace WinFormsAppEx319\r\n{\r\n    public partial class Form1 : Form\r\n    {\r\n        public Form1()\r\n        {\r\n            InitializeComponent();\r\n        }\r\n\r\n        private void formsPlot1_Load(object sender, EventArgs e)\r\n        {\r\n            \/\/ generate some random X\/Y data\r\n            int pointCount = 1000;\r\n            Random rand = new Random(0);\r\n            double&#x5B;] xs1 = ScottPlot.DataGen.RandomWalk(rand, pointCount);\r\n            double&#x5B;] ys1 = ScottPlot.DataGen.RandomWalk(rand, pointCount);\r\n            double&#x5B;] xs2 = ScottPlot.DataGen.RandomWalk(rand, pointCount);\r\n            double&#x5B;] ys2 = ScottPlot.DataGen.RandomWalk(rand, pointCount);\r\n\r\n            \/\/ plot the data\r\n            formsPlot1.Plot.PlotScatter(xs1, ys1);\r\n            formsPlot1.Plot.PlotScatter(xs2, ys2);\r\n\r\n            \/\/ additional styling\r\n            formsPlot1.Plot.Title($&quot;Scatter Plot ({pointCount} points per group)&quot;);\r\n            formsPlot1.Plot.XLabel(&quot;X&quot;);\r\n            formsPlot1.Plot.YLabel(&quot;Y&quot;);\r\n            formsPlot1.Refresh();\r\n        }\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1) Install the ScottPlot.WinForms NuGet package 2) Drag a FormsPlot from the toolbox onto the form Form1.cs namespace WinFormsAppEx319 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void formsPlot1_Load(object sender, EventArgs e) { \/\/ generate some random X\/Y data int pointCount = 1000; Random rand = new Random(0); double&#x5B;] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[50],"tags":[55],"class_list":["post-1686","post","type-post","status-publish","format-standard","hentry","category-c","tag-mandelbrot"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-rc","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1649,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/11\/210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-3-2-2-3-2-2-4-2-2-2-2\/","url_meta":{"origin":1686,"position":0},"title":"#313 Spline plot using C# Windows Forms App","author":"gantovnik","date":"2022-11-04","format":false,"excerpt":"Add ScottPlot.WinForms using Manage NuGet packages. Form1.cs [code language=\"csharp\"] using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using ScottPlot; namespace Spline { public partial class Form1 : Form { public static class Cubic { \/\/\/ <summary> \/\/\/ Generate a smooth (interpolated) curve that follows the path\u2026","rel":"","context":"In &quot;C#&quot;","block_context":{"text":"C#","link":"https:\/\/gantovnik.com\/bio-tips\/category\/c\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/11\/interpolation.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/11\/interpolation.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/11\/interpolation.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/11\/interpolation.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1596,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/10\/210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-3-2-2-3-2-2-4\/","url_meta":{"origin":1686,"position":1},"title":"#305 Line plot using C#","author":"gantovnik","date":"2022-10-26","format":false,"excerpt":"Temperature.cs [code language=\"python\"] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WindowsFormsApp1 { public class Temperature { public string Location { get; set; } public decimal M1 { get; set; } public decimal M2 { get; set; } public decimal M3 { get; set; } public decimal\u2026","rel":"","context":"In &quot;C#&quot;","block_context":{"text":"C#","link":"https:\/\/gantovnik.com\/bio-tips\/category\/c\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/10\/2022-10-26_041420-300x276.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1088,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/11\/188-create-animation-using-matplotlib\/","url_meta":{"origin":1686,"position":2},"title":"#188 Create animation using  matplotlib","author":"gantovnik","date":"2021-11-12","format":false,"excerpt":"[code language=\"python\"] # Make a movie out of the steps of a 2D random walk. import matplotlib.pyplot as plt from matplotlib import animation from numpy.random import random as rand # Set number of steps for each random walk. num_steps = 1000 # Create an empty figure of the desired size.\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1351,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/01\/133-create-vectors-and-planes-using-tcl-in-hypermesh-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2\/","url_meta":{"origin":1686,"position":3},"title":"#255 Returning multiple values from a procedure in tcl","author":"gantovnik","date":"2022-01-05","format":false,"excerpt":"The return command passes one value to the caller. There is often a need to return multiple values. In such cases, we can return a list. Example: [code language=\"python\"] proc RandomNumbers {} { set r1 [expr round(100*rand())] set r2 [expr round(100*rand())] return [list $r1 $r2] } puts [RandomNumbers] [\/code] Result:\u2026","rel":"","context":"In &quot;tcl&quot;","block_context":{"text":"tcl","link":"https:\/\/gantovnik.com\/bio-tips\/category\/tcl\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8057,"url":"https:\/\/gantovnik.com\/bio-tips\/2025\/02\/458-hypermesh-tcl-script-to-save-selected-node-ids-and-coordinates-to-a-csv-file\/","url_meta":{"origin":1686,"position":4},"title":"#458 HyperMesh tcl script to save selected node IDs and coordinates to a csv file","author":"gantovnik","date":"2025-02-20","format":false,"excerpt":"In this example, we create n=40 random nodes, select several of them, and save their node IDs and coordinates in a csv file. proc RandomReal {min max} { return [expr (rand()*($max-$min)+$min)] } set x_min 0.0 set x_max 20.0 set y_min 0.0 set y_max 10.0 set n 40 for {set i\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":2099,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/01\/410-2d-random-walk-animation-in-python\/","url_meta":{"origin":1686,"position":5},"title":"#410 2D random walk animation in python","author":"gantovnik","date":"2024-01-14","format":false,"excerpt":"[code language=\"python\"] import numpy import random import matplotlib.pyplot as plt from matplotlib import animation # define some plot variables fig, ax = plt.subplots(figsize=(8,8)) bound = 25 ax.set_xlim(-bound,bound) ax.set_ylim(-bound,bound) # define a numpy array to hold the locations visited on the random walk locations = numpy.zeros((1,2)) # 1 row, 2 columns\u2026","rel":"","context":"In &quot;animation&quot;","block_context":{"text":"animation","link":"https:\/\/gantovnik.com\/bio-tips\/category\/animation\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/01\/ex410.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/01\/ex410.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/01\/ex410.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=1686"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1686\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=1686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=1686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=1686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}