[Therion] Change size of scalebar

Torsten Schnitter torsten.schnitter at netcologne.de
Tue Jan 12 08:56:19 CET 2016


Hi Henry

Again many thanks for your help. :-)

I changed your stuff just a little and have inserted a variable for the scale.
So I don't have to change many parts when changing the scale.
And I don't have to search for all the parts. Now it is just the top to change.

    def s_scalebar (expr l, units, txt) =
      # scale for the scalebar
      tmpscale:=3;
      begingroup
        interim warningcheck:=0;
        tmpl:=l / Scale * cm * units / 2;
        tmpx:=l / Scale * cm * units / 5;
        tmph:=5bp*tmpscale; % 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.top(thTEX(decimal (i)) scaled tmpscale, (tmpx,0));
        endfor;
        label.top(thTEX(decimal (l) & "\thinspace" & txt) scaled
tmpscale,(tmpl,0));
        label.bot(thTEX("Original Scale = 1 : " & decimal round(Scale*100))
scaled tmpscale, (0,0)) transformed T;
      endgroup;
    enddef;

cheers,
Torsten

> Henry_Bennett at Dell.com hat am 12. Januar 2016 um 00:06 geschrieben:
> 
> 
> Seems that you are producing a large format survey which is what I've done.
> 
> Try this
> 
>     def s_scalebar (expr l, units, txt) =
>       begingroup
>         interim warningcheck:=0;
>         tmpl:=l / Scale * cm * units / 2;
>         tmpx:=l / Scale * cm * units / 5;
>         tmph:=25bp; % 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.top(thTEX(decimal (i)) scaled 3.6, (tmpx,0));
>         endfor;
>         label.top(thTEX(decimal (l) & "\thinspace" & txt) scaled
> 3.6,(tmpl,0));
>         label.bot(thTEX("Original Scale = 1 : " & decimal round(Scale*100))
> scaled 5.6, (.6cm,-1.6cm)) transformed T;
>       endgroup;
>     enddef;
> 
> I never found a way of making this stuff bigger so that you can print it out
> on a large banner.  Each element has to be tweaked.
> 
> Henry
> 
> -----Original Message-----
> From: therion-bounces at speleo.sk [mailto:therion-bounces at speleo.sk] On Behalf
> Of Torsten Schnitter
> Sent: 11 January 2016 11:01
> To: therion at speleo.sk
> Subject: [Therion] Change size of scalebar
> 
> Hello again
> 
> Recently I asked how to change size of legendsymbols.
> Henry helped on this. Thanks again Henry.
> 
> Now my question is how to resize scalebar.
> I'm using "Scalebar 2" from this metapost code
> http://therion.speleo.sk/wiki/doku.php/metapost?s[]=scalebar
> As I'm no pro in Metapost or Texcode I don't see how to resize it.
> Any help is appreciated.
> 
> Btw:
> Is there any easy way to resize parts like scalebar, northarrow,
> legendsymbols, legendcontent?
> I'm using all this parts in seperate legendboxes (within layout part in config
> file) to position it on seperate places on the map.
> Depending on the size of the map it's recomended to make all this single parts
> bigger to have a nice view of the map.
> 
> Thanks,
> Torsten
> _______________________________________________
> Therion mailing list
> Therion at speleo.sk
> http://mailman.speleo.sk/mailman/listinfo/therion
> Dell Corporation Limited is authorised and regulated in the UK by the
> Financial Conduct Authority for consumer credit brokerage. 
> Registered in England and Wales. Company Registration Number: 2081369
> Registered address: Dell House, The Boulevard, Cain Road, Bracknell,
>  Berkshire, RG12 1LF, UK.
> Company details for other Dell UK entities can be found on  www.dell.co.uk.
> _______________________________________________
> Therion mailing list
> Therion at speleo.sk
> http://mailman.speleo.sk/mailman/listinfo/therion



More information about the Therion mailing list