Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1156

Re: How to print floats with leading blanks instead of leading zeros using sprintf?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From sfeam <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: How to print floats with leading blanks instead of leading zeros using sprintf?
Followup-To comp.graphics.apps.gnuplot
Date Mon, 28 May 2012 20:48:45 -0700
Organization gnuplot development team
Lines 26
Message-ID <jq1guv$adu$1@dont-email.me> (permalink)
References <3d97629a-6d13-4e42-bb08-9a1d05a569d9@vy7g2000pbc.googlegroups.com> <jq0fds$lrn$1@dont-email.me> <be36fac7-6d84-4a74-a650-1d56856bb959@wp3g2000pbc.googlegroups.com>
Reply-To sfeam@users.sourceforge.net
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
Injection-Date Tue, 29 May 2012 03:48:48 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="3mhAfh4CeAIeL3OKnPexDA"; logging-data="10686"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18TIF0Pndkeft9sYVmqzIXP"
User-Agent KNode/4.4.9
Cancel-Lock sha1:sY6GpyTml/fzv0l12nXAZX3L5iU=
Xref csiph.com comp.graphics.apps.gnuplot:1156

Followups directed to: comp.graphics.apps.gnuplot

Show key headers only | View raw


Валерий Симонов wrote:

> #!/bin/sh
> gnuplot << EOF
> set terminal postscript eps enhanced

Since you have not specified a font, the program will use Helvetica 
by default.  But Helvetica is a proportionally-spaced font, 
which means that adding a fixed number of spaces will never line 
things up the way you want.
You would have to use Courier or some other fixed-width font.

> plot "sprintf.txt" using (\$1):(\$2) w l ls 1 \
>                    t sprintf('T > %03.0f abc',$1)

That command makes no sense.
First problem:
   'using (\$1)'
will cause an error "illegal character". I guess you just mean
   'using 1:2'
Second problem:
You cannot give a title that depends on $1, because the title
is not something that is re-calculated for every line of data.
The program will complain "undefined value".  I don't know
what you are trying to do, but this command will not work.

	Ethan

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to print floats with leading blanks instead of leading zeros using sprintf? Валерий Симонов <valerasimonov@gmail.com> - 2012-05-28 08:09 -0700
  Re: How to print floats with leading blanks instead of leading zeros using sprintf? sfeam <sfeam@users.sourceforge.net> - 2012-05-28 11:16 -0700
    Re: How to print floats with leading blanks instead of leading zeros using sprintf? Валерий Симонов <valerasimonov@gmail.com> - 2012-05-28 19:33 -0700
      Re: How to print floats with leading blanks instead of leading zeros using sprintf? sfeam <sfeam@users.sourceforge.net> - 2012-05-28 20:48 -0700
        Re: How to print floats with leading blanks instead of leading zeros using sprintf? valerasimonov@gmail.com - 2012-05-29 06:18 -0700
    Re: How to print floats with leading blanks instead of leading zeros using sprintf? valerasimonov@gmail.com - 2012-05-28 20:19 -0700
  Re: How to print floats with leading blanks instead of leading zeros   using sprintf? Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-05-28 23:32 +0200
    Re: How to print floats with leading blanks instead of leading zeros using sprintf? valerasimonov@gmail.com - 2012-05-28 19:56 -0700
      Re: How to print floats with leading blanks instead of leading zeros   using sprintf? Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-05-29 18:33 +0200
        Re: How to print floats with leading blanks instead of leading zeros using sprintf? valerasimonov@gmail.com - 2012-05-31 05:43 -0700
  Re: How to print floats with leading blanks instead of leading zeros using sprintf? Christoph Bersch <usenet@bersch.net> - 2012-05-29 09:51 +0200
    Re: How to print floats with leading blanks instead of leading zeros using sprintf? valerasimonov@gmail.com - 2012-05-29 06:19 -0700

csiph-web