Hi Moritz, all,<br><br>In displaying this kind thematic vector data, how can I assign a transparent color to the value zero? (zero is Not the null value of the GRASS vector dataset)<br><br>Thanks,<br>Vishal<br><br><div class="gmail_quote">
On Wed, Apr 8, 2009 at 10:24 AM, Moritz Lennert <span dir="ltr">&lt;<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 08/04/09 18:48, Vishal Mehta wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Moritz,<br>
Regarding legends with d.graph, these are the main issues where I found I needed to do too much of trial and error, some of which I think could probably be avoided/improved in a future version...<br>
<br>
1. the legend ends up with some strange additions beyond just the range of data: like what are those numbers after each range<br>
e.g. in the example below where did | 0 and | 5 come from? It would be nice to not have this automatically displayed.<br>
60 - 80 | 0<br>
80-100 | 5<br>
</blockquote>
<br></div>
This comes from my scientific background which says that a legend should include information about the frequencies of observations in each class. This is what these numbers show. But I agree that this should probably be optional.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
2. there could be a flag on d.graph, which allows the output to have a &quot;&lt; minbreak&quot; and &quot;&gt; maxbreak&quot; option, so that for cases like the one we are discussing, the legend does not keep changing based on different data ranges.<br>

</blockquote>
<br></div>
d.graph is &quot;just&quot; a drawing module. Any such flags will have to go into d.thematic.area, or a specific d.thematic.legend module, but yes, sounds good.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
3. size and position<br>
Here, I wanted to get a legend file separately, and save a legend png. To do this I had to play with the size and other parameters extensively to make the symbols and associated text match up. It would be great to be able to do the following with some flags, for the case where the legend alone is displayed:<br>

(i) set the overall size of the display within which the legend will be displayed<br>
(ii) set the position of the legend within the display with options like lowerleft, upperright, center, etc<br>
</blockquote>
<br></div>
positioning in d.graph is in percentage, so the size of the display should not make a difference for the relative localisation.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
(iii) set the size of the legend as a fraction/percentage of the display.<br>
</blockquote>
<br></div>
Size of text is in percentage, but size of symbols aren&#39;t. But I guess you mean the legend as a whole. There should probably be some way to calculate the size of the different elements given a general value from the user. Again, this would have to be a parameter for d.thematic.*.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
(iv) make the background transparent (or not)<br>
</blockquote>
<br></div>
At this stage the background is transparent, but I could add a flag to allow non-transparent (you can do it yourself by just drawing a white rectangle underneath).<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
such that the above settings &#39;automatically&#39; set up the symbol and corresponding text all properly lined up..<br>
</blockquote>
<br></div>
d.graph does not have any &quot;alignment&quot; feature, you have to work with the percentage positioning, but one problem (I think) is that different fonts have different sizes, so a same size but different font will lead to different alignments.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I am aware that if I was just better at this I could do it quickly enough..but the above functionality would make it easier for less-than-expert people like myself, who try to use open-source as much as possible despite the handicap of having been groomed on Windows...<br>

</blockquote>
<br></div>
Cartography is currently one of the weak points of GRASS, although you can&#39;t beat it for automatic cartography as you are doing (well, gmt can do that, but don&#39;t know about thematic cartography in gmt).<br>
<br>
Thank you for the extensive feedback, though. I get the feeling that there should be some d.thematic.legend module which uses the output of the -l flag of d.thematic.area to then create a nice-looking legend.<br>
<br>
You might also want to have a look at ps.map which allows some more sophisticated cartography and offers an automatic legend.<br><font color="#888888">
<br>
Moritz<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Vishal K. Mehta, PhD<br>Scientist<br>Stockholm Environment Institute - US<br>133 D St Suite F<br>Davis CA 95616<br><a href="http://www.sei-us.org">www.sei-us.org</a><br>