<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 591: Handle split contour lines as one continuous curve</title><link>https://sourceforge.net/p/gnuplot/feature-requests/591/</link><description>Recent changes to 591: Handle split contour lines as one continuous curve</description><atom:link href="https://sourceforge.net/p/gnuplot/feature-requests/591/feed.rss" rel="self"/><language>en</language><lastBuildDate>Fri, 15 Aug 2025 23:12:21 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/gnuplot/feature-requests/591/feed.rss" rel="self" type="application/rss+xml"/><item><title>#591 Handle split contour lines as one continuous curve</title><link>https://sourceforge.net/p/gnuplot/feature-requests/591/?limit=50#3224</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for committing an improved implementation — much appreciated!&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hiroki Motoyoshi</dc:creator><pubDate>Fri, 15 Aug 2025 23:12:21 -0000</pubDate><guid>https://sourceforge.net33df853054952cc3eb6d0badb2dc674605f05af3</guid></item><item><title>#591 Handle split contour lines as one continuous curve</title><link>https://sourceforge.net/p/gnuplot/feature-requests/591/?limit=25#0854</link><description>&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;: open --&amp;gt; pending-accepted&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Group&lt;/strong&gt;:  --&amp;gt; &lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ethan Merritt</dc:creator><pubDate>Thu, 14 Aug 2025 05:37:22 -0000</pubDate><guid>https://sourceforge.net0efa116117476679c2a041b3126e66bba57d4be2</guid></item><item><title>#591 Handle split contour lines as one continuous curve</title><link>https://sourceforge.net/p/gnuplot/feature-requests/591/?limit=25#d80e</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Fixed by commit 83cd1370&lt;/p&gt;
&lt;p&gt;Instead of building up a contour line using a fixed-length array of 100 points, dynamically allocate additional points as needed.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ethan Merritt</dc:creator><pubDate>Thu, 14 Aug 2025 05:37:05 -0000</pubDate><guid>https://sourceforge.net39edd3f1ebf94f43d80168995abbce075e3bfbab</guid></item><item><title>#591 Handle split contour lines as one continuous curve</title><link>https://sourceforge.net/p/gnuplot/feature-requests/591/?limit=25#47b0</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I think you may be  overlooking a simpler explanation, and simpler fix, for the discontinuities seen in this example.&lt;/p&gt;
&lt;p&gt;The 100 point per contour segment is a defined constant.   In your example case bumping this up to 1000 points removes the discontinuities.   One possible fix is to make this a limit that the user can set.  &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/src/contour.c b/src/contour.c&lt;/span&gt;
&lt;span class="gh"&gt;index 8a0f6a054..a87a758b3 100644&lt;/span&gt;
&lt;span class="gd"&gt;--- a/src/contour.c&lt;/span&gt;
&lt;span class="gi"&gt;+++ b/src/contour.c&lt;/span&gt;
&lt;span class="gu"&gt;@@ -79,7 +79,7 @@ typedef enum en_edge_position {&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;#define FALSE    0
&lt;span class="w"&gt; &lt;/span&gt;#endif

&lt;span class="gd"&gt;-#define MAX_POINTS_PER_CNTR    100&lt;/span&gt;
&lt;span class="gi"&gt;+#define MAX_POINTS_PER_CNTR    1000&lt;/span&gt;

&lt;span class="w"&gt; &lt;/span&gt;#define SQR(x)  ((x) * (x))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I am not sure, but I think that limit is there because in the old days PostScript output (and later other vector outputs like SVG) behaved poorly if  there were long sequences of relative move/draw segments.   Breaking after each 100 pts forced an absolute coordinate pair to be written, limiting the build-up of errors.    The PostScript terminal itself limits such a sequence to 250 relative segments, but whoever wrote the contouring was more conservative and set the limit at 100.    In version 5 development various terminals were modified to keep more precision, so probably this is less of an issue now than it used to be.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ethan Merritt</dc:creator><pubDate>Wed, 13 Aug 2025 06:23:42 -0000</pubDate><guid>https://sourceforge.net1fd133c9aedf4fedb0916d4a7cfeb17aad2e072d</guid></item><item><title>Handle split contour lines as one continuous curve</title><link>https://sourceforge.net/p/gnuplot/feature-requests/591/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;It is common practice to extract contour data using 'set table' with &lt;code&gt;splot&lt;/code&gt; and reuse it in another plot. &lt;/p&gt;
&lt;p&gt;If the generated contour is simple, it is output as a single continuous curve. However, in the case of more complex contours exceeding about 100 points, the output is split into several segmented curves.&lt;/p&gt;
&lt;p&gt;Here is a simple example:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;term&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;wxt&lt;/span&gt;

&lt;span class="k"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;

&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;xrange&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;-2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;yrange&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;-2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;zrange&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;isotropi&lt;/span&gt;&lt;span class="nb"&gt;c&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;xyplane&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;

&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;samples&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;85&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;isosamples&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;85&lt;/span&gt;

&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;table&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;contour&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;unset&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;surface&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;contour&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;surface&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cntrparam&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;discrete&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="k"&gt;splot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;lines&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;unset&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;contour&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;surface&lt;/span&gt;
&lt;span class="k"&gt;unset&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;table&lt;/span&gt;

&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;title&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"contour as line"&lt;/span&gt;
&lt;span class="k"&gt;splot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;notitle&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"#c0c0c0c0"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;\
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;contour&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;using&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;column&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;lc&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;lw&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;notitle&lt;/span&gt;
&lt;span class="k"&gt;pause&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"Hit &amp;lt;cr&amp;gt; to continue"&lt;/span&gt;

&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;title&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"contour as filled polygon"&lt;/span&gt;
&lt;span class="k"&gt;splot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;contour&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;with&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;polygons&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;fc&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;'pink'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;notitle&lt;/span&gt;
&lt;span class="k"&gt;pause&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"Hit &amp;lt;cr&amp;gt; to continue"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In this example, the contour line stored in the &lt;code&gt;$contour&lt;/code&gt; datablock consists of approximately 300 points but is split into three separate curves of up to 100 points each. The larger the &lt;code&gt;samples&lt;/code&gt; and &lt;code&gt;isosamples&lt;/code&gt; values, the more likely it is that curves will be divided. Additionally, applying smoothing methods such as &lt;code&gt;cubicspline&lt;/code&gt; can increase the number of segments, exacerbating the issue.&lt;/p&gt;
&lt;p&gt;Attached patch is a trial one to preserve the continuity of contour lines.  &lt;/p&gt;
&lt;p&gt;Specifically, in &lt;code&gt;end_crnt_cntr()&lt;/code&gt;, it checks whether the last curve in the &lt;code&gt;contour_list&lt;/code&gt; is continuous with the new curve to be added. If they are continuous, it merges them into a single curve; otherwise, it treats the new curve as a separate one.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hiroki Motoyoshi</dc:creator><pubDate>Sun, 10 Aug 2025 08:45:11 -0000</pubDate><guid>https://sourceforge.net253bc7a007d08341cc84237681ed7d4129410fee</guid></item><item><title>Handle split contour lines as one continuous curve</title><link>https://sourceforge.net/p/gnuplot/feature-requests/591/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Ticket 591 has been modified: Handle split contour lines as one continuous curve&lt;br/&gt;
Edited By: Ethan Merritt (sfeam)&lt;br/&gt;
Status updated: 'open' =&amp;gt; 'pending-accepted'&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hiroki Motoyoshi</dc:creator><pubDate>Sun, 10 Aug 2025 08:45:11 -0000</pubDate><guid>https://sourceforge.netc3cb3140e494e55d6be8809b810062d6d05a72c8</guid></item></channel></rss>