0

Given a pic figure:

.PS
circle "Foo"
arrow
box "Bar"
arrow
box dashed "Foo" "Dashed"
.PE

Is it possible to scale the whole diagram element's widths and heights?

I have tried scale = 2 without success.

4
  • 2
    Note, if you are looking for a simple gui that can output pic files, there is xfig. It can also export to Encapsulated PostScript. Commented May 8, 2021 at 15:22
  • I have used xfig in the past, but I did not recall it could output pic files. It is good to know. I am however trying to see if plain PIC commands can speed up drawing flow charts. Commented May 8, 2021 at 15:23
  • 1
    Another language for flowcharts is graphviz. It looks harder than it is. Commented May 8, 2021 at 16:03
  • Looks interesting Commented May 9, 2021 at 2:01

2 Answers 2

1

Scaling a pic-picture does not really work. The scale variable seems mainly used when drawables are specified with a size.

You could try setting a maximum height, like in

.PS 1.5
<your picture>

but that will result in large texts in the boxes.

Reducing the font size too gives a more acceptable picture:

.ps -5
.PS 1.5
circle "Foo"
arrow
box "Bar"
arrow
box dashed "Foo" "Dashed"
.PE
.ps +5

In the end, I resorted to drawing the pic-drawings separately and embedding them as eps. This has the advantage that you can not only scale them, but also use them in-line.

2
  • How do you generate the EPS from the pic code? I have seen that sometimes the EPS includes the image as raster instead of vector. Commented May 8, 2021 at 15:11
  • 2
    I use a self-written pre-processor (in3xml; if you're interested it's on github), but basically the commands are pic $blk.pic | groff $blk.groff |eps2eps -B1 > $blk.eps, so it won't be rasterized. Commented May 8, 2021 at 15:39
1

You can set the width and height of the whole picture by providing them as arguments to the .PS macro, in inches. Try

.PS 6

scale only affect items that have been given an explicit size, for example circle radius 1, and also works as a divisor, not a multiplier. Eg scale=2.54 is suggested as a way to have numbers interpreted in centimetres, so radius 1 is of 1cm instead of 1inch, i.e. a lot smaller.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.