Path: csiph.com!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= Newsgroups: comp.graphics.apps.gnuplot Subject: Re: space between sign and digit Date: Wed, 11 Jul 2018 20:06:07 +0200 Lines: 19 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.dfncis.de 8QJizN3+Vr02LZUmRYKTuQjnR2nTglKz56P63QFXkaB01exV0so4fhy8DK Cancel-Lock: sha1:bN7LwQ/CSaqNSgyO+ATjc+hqwjI= User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.0 In-Reply-To: Content-Language: de-DE Xref: csiph.com comp.graphics.apps.gnuplot:4000 Am 11.07.2018 um 08:52 schrieb Jörg Buchholz: > I would like to print a function in the key like this: > > f11(x) = -2.56·x - 103.63 > > I use the following code in the plot command for that: > > f11(x) lt 2 lw 4 dt 4 t sprintf("f11(x) =%6.2f·x%+7.2f",a,b11) > > That means, that I use the sign from the format specifier as plus sign > or minus sing in the printed function. But than I don't have a space in > front of the second number. The second number can be positive or negative. So what's so wrong with the simple sprintf("f11(x) = %6.2f·x + % 7.2f",a,b11) ? Yes, that means for negative bl1 you'll get "+ -103.63", but is that really such a problem?