Path: csiph.com!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Karl Ratzsch Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Piecewise function in gnuplot? Date: Thu, 9 Nov 2017 08:13:21 +0100 Organization: solani.org Lines: 34 Message-ID: References: <16c3d30b-38eb-4028-9a9a-4a30b869be1a@googlegroups.com> <9ee6918b-c4e2-45a0-8f35-d069da4290e7@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1510211602 8605 eJwNyMEBwCAIA8CVKBCQcVTI/iPYex4svrjpgXAQVAVaju6VMoXpXtPqkbTNKC1B5x0i/zrGBxlsEUs= (9 Nov 2017 07:13:22 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 9 Nov 2017 07:13:22 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 In-Reply-To: <9ee6918b-c4e2-45a0-8f35-d069da4290e7@googlegroups.com> X-User-ID: eJwFwYEBwCAIA7CXBNrizlGQ/09YwpCpEqLA4VSq1/ZcR89QukPqa0S+gvXxh4gdjQnwOn4UABCh Content-Language: en-GB X-NNTP-Posting-Host: eJwNx8kNwDAMA7CV6kNSPI6b1PuP0AD8EEHjVhJMDMZVAD0z9vM6caJb3zmXVH27vOQDLMuy+QEOfhCz Cancel-Lock: sha1:tJ2jvn9rqPQ/ofhak+hXZ2rjyfc= Xref: csiph.com comp.graphics.apps.gnuplot:3816 Am 08.11.2017 um 20:58 schrieb Lawrence Bottorff: > No, actually, I need the lines depicting the individual sections to be disjoint (not connected like in the gnuplot examples) and showing the filled or empty dots on the ends of the disjoint lines. > Ah. You need to plot the points and lines individually. ------------- $full << EOD -5 5 EOD $empty << EOD 0 EOD plot sample [-5:0] x-1 lc 8, \ [0:5] x+1 lc 8,\ $full pt 7 lc 8,\ $empty pt 6 lc 8 ---------- There's no automagic for that in gnuplot, except that gnuplot only connects consecutive datapoints by a line IF there is no invalid datapoint in between (see "help datapoint missing" for complete description). If you carefully control the sampling and do set xr [-10:10] set sample 21 # !!!! plot x<0 ? -1 : x>0 ? 1 : NaN gnuplot notices that zero is undefined and breaks the line.