[Therion] Change size of scalebar
Martin Sluka
martinsluka at mac.com
Tue Jan 12 14:27:21 CET 2016
Try to play with this code. Check 5. line and line begins label.top .
original code:
def s_scalebar_SKBB (expr l, units, txt) =
begingroup
interim warningcheck:=0;
tmpl:=l / Scale * cm * units / 2;
endgroup;
pickup PenC;
draw (-tmpl,0)--(tmpl,0);
draw (-tmpl,0)--(-tmpl,2bp);
draw (tmpl,0)--(tmpl,2bp);
begingroup
interim labeloffset:=2bp;
label.top(thTEX(decimal (l) & "\thinspace" & txt),origin);
endgroup
enddef;
There is another important file in mpost folder - thTrans.mp - in which are definitions of which name of code from -for example thSpecial.mp will by used by variable used in therion.
For example:
let s_scalebar = s_scalebar_SKBB;
modified code - two times wider scale-bar
code metapost
def s_scalebar (expr l, units, txt) =
begingroup
interim warningcheck:=0;
tmpl:=l / Scale * cm * units ;
endgroup;
pickup PenC;
draw (-tmpl,0)--(tmpl,0);
draw (-tmpl,0)--(-tmpl,2bp);
draw (tmpl,0)--(tmpl,2bp);
begingroup
interim labeloffset:=2bp;
label.top(thTEX(decimal (l*2) & "\thinspace" & txt),origin);
endgroup
enddef;
endcode
More information about the Therion
mailing list