[GRASS-user] d.legend using png driver

Hi,

i'm using d.legend to save on a png file a raster legend.
this the code i'm using :

export GRASS_RENDER_IMMEDIATE=TRUE
export GRASS_TRUECOLOR=TRUE
export GRASS_TRANSPARENT=TRUE
d.mon start=PNG
d.legend map=geology@PERMANENT color=red

this code saves a file "map.png" in the working directory,
my question :

- it is possible to specify where to save the file and using a custom name ?
- exists an example to learn how can i change the font size used int the legend ?

thanks to All,

Massimo.

Massimo wrote:

- it is possible to specify where to save the file
and using a custom name ?

yes, see "g.manual variables" under PNG driver.

- exists an example to learn how can i change the font size
used int the legend ?

currently it is automatic based on legend height. change the actual font
(eg to a TrueType font) with the d.font module.

if you like you can hack the d.legend source code, see the bit in main.c
that does R_text_size(), and the multiplier in the lines immediately like
it.

It's a problem with d.out.file (a nice & easy frontend to the PNG driver)
if you make the image size really big (eg for a poster graphic). The
d.legend module is optimized for use on a computer monitor.

there is an earlier thread about this with more info if you like, and I
think a patch to make it a bit bigger. There was talk about adding a
fontsize= option to the module, (perhaps d.grid too?) but I forget the
details- you'll have to read the thread.

Hamish

Il giorno 25/ott/09, alle ore 20:47, Massimo Di Stefano ha scritto:

  • it is possible to specify where to save the file and using a custom name ?

my mistake …
i missed it :

GRASS_PNGFILE=filename

reading the help page

  • exists an example to learn how can i change the font size used int the legend ?

looking for d.font, to see if it can help