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
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@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Torsten Schnitter Sent: 11 January 2016 11:01 To: therion@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@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.
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@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@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Torsten Schnitter Sent: 11 January 2016 11:01 To: therion@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@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@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
12. 1. 2016 v 8:56, Torsten Schnitter <torsten.schnitter@netcologne.de>:
def s_scalebar
Please, RTFTBF (read that f… TherionBook first). There is section: "Page layout in the map mode“ There are the answers to your question. MetaPost is responsible for the objects drawing. TeX is responsible of how these objects will be placed on the document. Add this part of the code to your layout and play with it. code tex-map \legendwidth=20cm \legendtextcolor={\color[0 0 100]} \legendtextsize={\size[20]} \legendtextheadersize={\size[60]} \legendcontent={% \hsize=\legendwidth \color[0 0 0]\the\legendtextcolor \ifnortharrow\vbox to 0pt{\line{\hfil\northarrow}\vss}\fi \edef\tmp{\the\cavename} \ifx\tmp\empty \else {\the\legendtextheadersize\the\cavename}\vskip1cm \fi \ifscalebar\scalebar\vskip1cm\fi {\rightskip=0pt plus 3em\parskip=3bp \edef\tmp{\the\comment} \ifx\tmp\empty \else {\the\legendtextsize\the\comment} \par\medskip \fi \everypar{\hangindent=2em\hangafter=1} \edef\tmp{\the\cavelength} \ifx\tmp\empty \else {\the\legendtextsize\si\the\cavelengthtitle: \ss\the\cavelength\par} \fi \edef\tmp{\the\cavedepth} \ifx\tmp\empty \else {\the\legendtextsize\si\the\cavedepthtitle: \ss\the\cavedepth\par} \fi \edef\tmp{\the\exploteam} \ifx\tmp\empty \else {\the\legendtextsize\si\the\explotitle: \ss\the\exploteam\quad\si\the\explodate\par} \fi \edef\tmp{\the\topoteam} \ifx\tmp\empty \else {\the\legendtextsize\si\the\topotitle: \ss\the\topoteam\quad\si\the\topodate\par} \fi \edef\tmp{\the\cartoteam} \ifx\tmp\empty \else {\the\legendtextsize\si\the\cartotitle: \ss\the\cartoteam\quad\si\the\cartodate\par} \fi \edef\tmp{\the\copyrights} \ifx\tmp\empty \else {\the\legendtextsize\ss\the\copyrights\par} \fi } \formattedlegend \color[0 0 0] } endcode
Hi Martin Changing \legendwidth=20cm \legendtextcolor={\color[0 0 100]} \legendtextsize={\size[20]} \legendtextheadersize={\size[60]} doesn't change the size of your scalebar nor the size of your northarrow and also does not change the size of symbols from legendsymbols... If I'm right it also doesn't change the size of the text from legendsymbols. But may be I'm wrong on this... My questions were going to know about these changes and Henry showed up with a possible solution for it. Because I read the Therion book I already knew about how to change sizes from text like cavename, cavedepth etc. But thanks for your advice on that. ;-) cheers, Torsten
Martin Sluka <martinsluka@mac.com> hat am 12. Januar 2016 um 10:19 geschrieben:
12. 1. 2016 v 8:56, Torsten Schnitter <torsten.schnitter@netcologne.de>:
def s_scalebar
Please, RTFTBF (read that f… TherionBook first). There is section: "Page layout in the map mode“
There are the answers to your question.
MetaPost is responsible for the objects drawing.
TeX is responsible of how these objects will be placed on the document.
Add this part of the code to your layout and play with it.
code tex-map
\legendwidth=20cm \legendtextcolor={\color[0 0 100]} \legendtextsize={\size[20]} \legendtextheadersize={\size[60]}
\legendcontent={% \hsize=\legendwidth \color[0 0 0]\the\legendtextcolor \ifnortharrow\vbox to 0pt{\line{\hfil\northarrow}\vss}\fi \edef\tmp{\the\cavename} \ifx\tmp\empty \else {\the\legendtextheadersize\the\cavename}\vskip1cm \fi \ifscalebar\scalebar\vskip1cm\fi {\rightskip=0pt plus 3em\parskip=3bp \edef\tmp{\the\comment} \ifx\tmp\empty \else {\the\legendtextsize\the\comment} \par\medskip \fi \everypar{\hangindent=2em\hangafter=1} \edef\tmp{\the\cavelength} \ifx\tmp\empty \else {\the\legendtextsize\si\the\cavelengthtitle: \ss\the\cavelength\par} \fi \edef\tmp{\the\cavedepth} \ifx\tmp\empty \else {\the\legendtextsize\si\the\cavedepthtitle: \ss\the\cavedepth\par} \fi \edef\tmp{\the\exploteam} \ifx\tmp\empty \else {\the\legendtextsize\si\the\explotitle: \ss\the\exploteam\quad\si\the\explodate\par} \fi \edef\tmp{\the\topoteam} \ifx\tmp\empty \else {\the\legendtextsize\si\the\topotitle: \ss\the\topoteam\quad\si\the\topodate\par} \fi \edef\tmp{\the\cartoteam} \ifx\tmp\empty \else {\the\legendtextsize\si\the\cartotitle: \ss\the\cartoteam\quad\si\the\cartodate\par} \fi \edef\tmp{\the\copyrights} \ifx\tmp\empty \else {\the\legendtextsize\ss\the\copyrights\par} \fi } \formattedlegend \color[0 0 0] }
endcode _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
12. 1. 2016 v 13:21, Torsten Schnitter <torsten.schnitter@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;
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
participants (3)
-
Henry_Bennett@Dell.com -
Martin Sluka -
Torsten Schnitter