SV: [GRASS-user] Ps.map vlegend

Hamish hamish_b at yahoo.com
Thu Mar 3 05:50:59 EST 2011


Martin Album Ytre-Eide wrote:
> I started making my own legend, but I
> can't seem to make one with pattern :( The rectangle
> function does not accept a pat command. Any workaround or
> ideas?

one idea: try adding clone vareas, but with smaller pwidth and
an impossible SQL where clause so nothing is ever drawn to the
map. Then use those mini-patterns in the vlegend. 
Use 'lpos 0' for the real areas so that they don't get added
to the legend.

if you are comfortable tweaking and recompiling C code there are
other options...

Index: ps/ps.map/ps_vlegend.c
===================================================================
--- ps/ps.map/ps_vlegend.c      (revision 45422)
+++ ps/ps.map/ps_vlegend.c      (working copy)
@@ -204,7 +204,7 @@
                            fprintf(PS.fp, "        %f %f scale\n", sc, sc);
                            set_ps_color(&(vector.layer[i].fcolor));
                            fprintf(PS.fp, "        %.8f W\n",
-                                   vector.layer[i].pwidth);
+                                   vector.layer[i].pwidth * 0.8);
                            fprintf(PS.fp, "        %s\n", pat);
                            fprintf(PS.fp, "        end\n");
                            fprintf(PS.fp, "      } bind\n>>\n");



Hamish



      


More information about the grass-user mailing list