[Therion] Change size of scalebar

Martin Sluka martinsluka at mac.com
Tue Jan 12 13:54:06 CET 2016


> 12. 1. 2016 v 13:21, Torsten Schnitter <torsten.schnitter at netcologne.de>:
> 
> Because I read the Therion book I already knew about how to change sizes from
> text like cavename, cavedepth etc.


There are folders in Therions directory (source code):

/mpost and /tex and there are pieces of code you may modify.

m.s.

BTW - there are samples of code from Tomas Holder in wiki. Your problem should be in modification of this code, where l is length of scalebar evidently. So try to change it to l:=2*l etc.

def s_scalebar (expr l, units, txt) =
    begingroup
      interim warningcheck:=0;
      tmpl:=l / Scale * cm * units / 2;
      tmpx:=l / Scale * cm * units / 5;
      tmph:=5bp; % bar height
    endgroup;
    pickup PenC;
    draw (-tmpl,0)--(tmpl,0)--(tmpl,-tmph)--(-tmpl,-tmph)--cycle;
    p:=(0,0)--(tmpx,0)--(tmpx,-tmph)--(0,-tmph)--cycle;
    for i:=-2.5 step 2 until 2:
      fill p shifted (i * tmpx,0);
    endfor;
    begingroup
      interim labeloffset:=3.5bp;
      for i:=0 step (l/5) until (l-1):
        tmpx:=tmpl * (i * 2 / l - 1);
        label.bot(thTEX(decimal (i)),(tmpx,-tmph));
      endfor;
      label.bot(thTEX(decimal (l) & "\thinspace" & txt),(tmpl,-tmph));
      label.top(thTEX("Massstab 1 : " & decimal round(Scale*100)),(0,0));
    endgroup;
  enddef;


More information about the Therion mailing list