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?

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 2012-05-28 20:48 -0700
Organization gnuplot development team
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>

Followups directed to: comp.graphics.apps.gnuplot

Show all headers | 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