Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
examples [2018/01/06 21:57] – [Colour Scales - Lookups] edits part 2 colour legend, map-level brucemutton | examples [2023/12/03 07:41] (current) – Document select map -colour behaviour brucemutton | ||
---|---|---|---|
Line 105: | Line 105: | ||
code metapost | code metapost | ||
| | ||
- | | + | |
- | draw p withpen PenD withcolor (0.1, | + | |
- | enddef; | + | pair zz[]; |
+ | pickup PenC; | ||
+ | for t = 0 upto length P - 1: | ||
+ | zz1 := point t of P; | ||
+ | zz2 := point t+1 of P; | ||
+ | | ||
+ | | ||
+ | | ||
[[: | [[: | ||
Line 143: | Line 150: | ||
statistics topo-length off #on | statistics topo-length off #on | ||
statistics explo-length off #on | statistics explo-length off #on | ||
- | + | | |
- | #code metapost | + | |
- | #def l_survey_cave (expr p) = | + | |
- | #draw p withpen PenD withcolor (0.5, | + | |
- | #enddef; | + | |
- | | + | |
endlayout | endlayout | ||
| | ||
Line 173: | Line 175: | ||
code metapost | code metapost | ||
| | ||
- | def l_survey_cave (expr p) = | + | def l_survey_cave (expr P) = |
- | draw p withpen PenD withcolor (0.5, | + | |
+ | pair zz[]; | ||
+ | pickup PenC; | ||
+ | for t = 0 upto length P - 1: | ||
+ | zz1 := point t of P; | ||
+ | zz2 := point t+1 of P; | ||
+ | | ||
+ | endfor; | ||
enddef; | enddef; | ||
| | ||
Line 197: | Line 206: | ||
code metapost | code metapost | ||
| | ||
- | | + | |
- | draw p withpen PenD withcolor (0.5, | + | T: |
- | enddef; | + | pair zz[]; |
+ | pickup PenC; | ||
+ | for t = 0 upto length P - 1: | ||
+ | zz1 := point t of P; | ||
+ | zz2 := point t+1 of P; | ||
+ | draw zz1 -- zz2 withcolor (0.5, | ||
+ | | ||
+ | | ||
| | ||
endlayout | endlayout | ||
Line 230: | Line 246: | ||
code metapost | code metapost | ||
| | ||
- | def l_survey_cave (expr p) = | + | def l_survey_cave (expr P) = |
- | draw p withpen PenD withcolor (0,0,1); | + | |
+ | pair zz[]; | ||
+ | pickup PenC; | ||
+ | for t = 0 upto length P - 1: | ||
+ | zz1 := point t of P; | ||
+ | zz2 := point t+1 of P; | ||
+ | | ||
+ | endfor; | ||
enddef; | enddef; | ||
| | ||
Line 272: | Line 295: | ||
code metapost | code metapost | ||
| | ||
- | | + | |
- | draw p withpen PenD withcolor (0,0,1); | + | |
- | enddef; | + | pair zz[]; |
+ | pickup PenC; | ||
+ | for t = 0 upto length P - 1: | ||
+ | zz1 := point t of P; | ||
+ | zz2 := point t+1 of P; | ||
+ | | ||
+ | | ||
+ | | ||
| | ||
endlayout | endlayout | ||
Line 353: | Line 383: | ||
[[http:// | [[http:// | ||
---- | ---- | ||
- | =====Colour Scales - Lookups===== | + | =====Colour |
- | Therion | + | Therion 5.4.2 (8 Jan 2019) introduced a new concept, lookups, to create and control |
- | [[https:// | + | [[https:// |
Whether or not you use lookups, you can specify the parameter that is depicted in colouring of 2D outputs. | Whether or not you use lookups, you can specify the parameter that is depicted in colouring of 2D outputs. | ||
You specify this in a layout. | You specify this in a layout. | ||
+ | colour map-fg [100 0 0] # hard writes a single colour to entire output | ||
colour map-fg altitude | colour map-fg altitude | ||
colour map-fg explo-date | colour map-fg explo-date | ||
Line 370: | Line 401: | ||
ie | ie | ||
colour map-fg altitude: | colour map-fg altitude: | ||
- | | ||
To see the colour legend in your map header, you will need to turn it on; | To see the colour legend in your map header, you will need to turn it on; | ||
colour-legend on | colour-legend on | ||
+ | You can also specify the colouring in an export statement directly, without defining a layout. | ||
+ | export map -layout-color map-fg topo-date | ||
If you do not specify a lookup, for altitude or dates, the range of values in the output is divided into 7 legend entries. | If you do not specify a lookup, for altitude or dates, the range of values in the output is divided into 7 legend entries. | ||
Line 389: | Line 420: | ||
They take the form... | They take the form... | ||
- | lookup [altitude | explo-date | topo-date | map | scrap][: | + | lookup [altitude | explo-date | topo-date | map | scrap][: |
- | # now list parameters, optional colours, optional text overides to appear in each legend entry, as in the examples below | + | |
+ | # | ||
+ | |||
+ | < | ||
+ | |||
+ | # do not specify any colours if you want Therion to use it's default colour palette, just use | ||
+ | # empty brackets, [], in place of a colour specification, | ||
+ | |||
+ | endlookup | ||
**lookup altitude examples** | **lookup altitude examples** | ||
+ | |||
+ | The default automatic altitude colour bands take their highest and lowest values from the highest and lowest survey stations for the parts of the survey that are used in the rendering. It takes all the survey stations within the " | ||
+ | |||
+ | The legend will then be divided up into 7 numbers; the highest station, the lowest station, and 5 equally spaced values in between. These values are then rounded to the nearest integer when rendering (this rounding will also happen when displaying legend lookup values). This makes it quite possible that no scrap will ever be the colour of the highest and lowest stations, since scraps normally have more than one station in them, and the scrap altitude and colour will be taken from the average of those. The colour, as with lookup colours, will be faded the appropriate distance between the nearest colour values on either side. | ||
+ | |||
+ | This also means that for a cave with very little vertical range, the default legend may show "10, 10, 11, 11, 11, 12, 12", when in actual fact, the numbers are all part way between 10 and 12. | ||
+ | |||
+ | Using a lookup table allows you to take much more control, giving neater colour intervals (like one colour every 10 metres), or allowing the highest and lowest scraps to actually be the top and bottom colours. | ||
lookup altitude -title " | lookup altitude -title " | ||
Line 403: | Line 450: | ||
endlookup | endlookup | ||
- | It should generate red -> blue scale with desired values. | + | It should generate red -> blue scale with desired values. |
- | Also explo-date, topo-date should now work with addition to map, scrap. E.g. | + | |
- | export map -layout-color map-fg topo-date | + | You may specify multiple lookup tables for same criterion using an index, ie |
- | + | ||
- | and for example: | + | |
- | + | ||
- | lookup topo-date | + | |
- | | + | |
- | | + | |
- | | + | |
- | - [] "2013 and later" | + | |
- | endlookup | + | |
- | + | ||
- | You may specify multiple lookup tables for same criterion using ":" | + | |
lookup altitude: | lookup altitude: | ||
Line 437: | Line 472: | ||
color map-fg altitude: | color map-fg altitude: | ||
- | You may use also: | + | Also intervals, or bands, should work: |
+ | |||
+ | lookup altitude: | ||
+ | [1500 1600] [] "cave floor 1" #If the text is omitted, then the default will display the range, ie 1600 m - 1500 m | ||
+ | [1800 1900] [] "cave floor 2" | ||
+ | endlookup | ||
+ | This will produce a single colour for passage between 1500 and 1600 m and between 1800 and 1900 m, and leave all other passage, above, in between, and below, uncoloured. | ||
+ | |||
+ | The default altitude rainbow is not made with a continuous range of colour hues. Instead, it is made with 7 discrete colours, with altitudes between them fading between the discrete colours. This means that you can use a lookup table to exactly replicate this colour behaviour, using the following colour values which match the default ones used by Therion (shown here within the range of altitudes from 4 to 96 metres): | ||
+ | |||
+ | lookup altitude:manualrainbow | ||
+ | 96 [100 25 25] | ||
+ | 81 [100 87.25 25] | ||
+ | 65 [49.75 100 25] | ||
+ | 50 [25 100 61.75] | ||
+ | 35 [25 74.5 100] | ||
+ | 20 [37 25 100] | ||
+ | 4 [99.25 25 100] | ||
+ | endlookup | ||
+ | |||
+ | **lookup date examples** | ||
+ | |||
+ | lookup topo-date | ||
+ | | ||
+ | | ||
+ | | ||
+ | - [] "2013 and later" | ||
+ | endlookup | ||
+ | |||
+ | |||
+ | **lookup map and scrap examples** | ||
lookup map | lookup map | ||
Line 447: | Line 512: | ||
Same should work with scraps. | Same should work with scraps. | ||
- | With maps, also more simple way should work - you may specify color of a particular | + | **Specifying individual |
- | select map1 -color [100 0 0] | + | With maps you may specify colour of a particular map when selecting it in your thconfig, overriding or without the need for any layout or lookup statements |
- | Also intervals should work: | + | select map1 -colour [100 0 0] |
+ | |||
+ | The Therion Book 6.1.7 suggests that map command-like options include colour, however this seems to be incorrect. | ||
+ | |||
+ | **‘select’** | ||
+ | |||
+ | Description: selects objects (surveys and maps) for export… | ||
+ | |||
+ | Options: | ||
+ | … | ||
+ | |||
+ | • colo[u]r < | ||
+ | |||
+ | In summary: | ||
+ | |||
+ | Select map -colour overrides layout or lookup colour map-fg statements when… | ||
+ | |||
+ | * colour map-fg [r g b] | ||
+ | * colour map-fg scrap | ||
+ | * colour map-fg map | ||
+ | |||
+ | Select map -colour does not override layout or lookup colour map-fg statements when… | ||
+ | |||
+ | * colour map-fg altitude | ||
+ | * colour map-fg topo-date, unless the map has no date | ||
+ | * colour map-fg explo-date, unless the map has no date | ||
- | lookup altitude | ||
- | [1500 1600] [] "cave floor 1" | ||
- | [1800 1900] [] "cave floor 2" | ||
- | endlookup | ||
======Models====== | ======Models====== |