<div dir="ltr"><div>Hi Michael,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 20 Jul 2023 at 18:14, Michael Barton <<a href="mailto:Michael.Barton@asu.edu">Michael.Barton@asu.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>
According to the d.legend.vect manual, I should have a legend file somewhere for all vectors. Here is what it says in notes:
<div><br>
</div>
<div>"Module d.legend.vect draws vector legend based on legend file defined in shell environment variable GRASS_LEGEND_FILE. This file is automatically created and updated whenever d.vect command is used. User can create custom legend file and then use export
 GRASS_LEGEND_FILE=path/to/file in shell. GRASS GUI and MONITORS create the legend file automatically. By default the legend file is stored in grassdata/location/mapset/.tmp/user directory (in case of d.mon deeper in /monitor_name directory)."</div></div></blockquote><div><br></div><div>It seems the documentation is wrong. Perhaps documenting an earlier state.</div><div><br></div><div>GUI puts all these files in a subdirectory of /tmp/. `find /tmp/ -name "legend.txt"` reveals that.<br></div><div><br></div><div>The monitors (d.mon) put that indeed in the mapset .tmp directory, but it is a longer path than the documentation suggests, for wx0, I have:<br></div><div><br></div><div>~/grassdata/nc_spm_08_grass7/mapset_name/.tmp/node_name/MONITORS/wx0/leg</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div>
</div>
<div>As a test, I made a vector areas file out of the landclass96_28 raster in the North Carolina demo dataset. I set the vector color table to match the original raster. That works fine. Now I'd like to make a legend out of this. But I can't find the file
 that is supposed to be generated automatically to use or examine. </div></div></blockquote><div><br></div><div>If you just want to use it with d.legend.vect, there is actually nothing to do. d.legend.vect will pick it up automatically just like in the example in the documentation. On the other hand, if you want to modify it by hand, use input and output parameters of d.legend.vect.</div><div><br></div><div>The whole  GRASS_LEGEND_FILE part is hidden from the user and you use it (only?) if you are using the other environment variables for rendering. Perhaps this needs to be emphasized in the documentation. (?)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div>
</div>
<div>It is not in  grassdata/location/mapset/.tmp/user directory</div>
<div>/Users/cmbarton/Dropbox\ \(ASU\)/GRASS_dropbox/grassdata_dropbox/nc_spm_08_grass7/spatialtech2023/.tmp </div>
<div>This directory contains no files and only one empty folder ("OKED3863"). </div>
<div><br>
</div>
<div>The environmental variable GRASS_LEGEND_FILE appears to be empty</div></div></blockquote><div><br></div><div>The variable is set internally for the commands which do the rendering, so you cannot get to it otherwise. If you set up things yourself in the shell or in Python, then you would also set up the variable.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div>
</div>
<div>So can anyone help me find this missing file?</div></div></blockquote><div><br></div><div>I hope this clarifies that. Please suggest edits to the documentation.</div><div><br></div><div>BTW, grass.jupyter.Map is used in the same way, i.e., no direct handling of GRASS_LEGEND_FILE, just d.legend.vect (d_legend_vect). If you are interested, the implementation is easier to digest than the wxGUI code:</div><div><br></div><div><a href="https://github.com/OSGeo/grass/blob/main/python/grass/jupyter/map.py#L90">https://github.com/OSGeo/grass/blob/main/python/grass/jupyter/map.py#L90</a></div><div><br></div><div>Best,<br></div><div>Vaclav<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div><br>
</div>
<div>Michael</div>
<div><br>
</div>
<div><br>
<div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div style="text-align:start;text-indent:0px">
<div style="text-align:start;text-indent:0px">
<div style="text-align:start;text-indent:0px">
<div style="text-indent:0px">
<span style="border-collapse:separate;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<font>
<div style="letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal">
<font style="font-style:normal;font-size:11px" face="Calibri" color="#929292">_____________________________</font></div>
<div style="font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal">
<p style="margin-bottom:0in"><font style="font-style:normal;font-size:11px" face="Calibri" color="#929292"><font><span>C. Michael Barton<br>
Associate Director, School of Complex Adaptive Systems (</span></font><a href="https://scas.asu.edu/" target="_blank">https://scas.asu.edu</a><font><span>)<br>
Professor, School of Human Evolution & Social Change (<a href="https://shesc.asu.edu" target="_blank">https://shesc.asu.edu</a>)<br>
Director, Center for Social Dynamics & Complexity (<a href="https://complexity.asu.edu" target="_blank">https://complexity.asu.edu</a>)<br>
Arizona State University<br>
Tempe, AZ 85287-2701<br>
USA<br>
<br>
Executive Director, Open Modeling Foundation (</span></font><a href="https://openmodelingfoundation.github.io/" target="_blank">https://openmodelingfoundation.github.io</a><font><span>)<br>
Director, Network for Computational Modeling in Social & Ecological Sciences (<a href="https://comses.net" target="_blank">https://comses.net</a>)<br>
<br>
personal website: <a href="http://www.public.asu.edu/~cmbarton" target="_blank">http://www.public.asu.edu/~cmbarton</a> <br>
</span></font></font><br>
</p>
</div>
</font></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>

_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</blockquote></div></div>