Opened 11 years ago

Last modified 8 months ago

#487 new enhancement

ps.map: legend

Reported by: hamish Owned by: hamish
Priority: minor Milestone: 7.6.2
Component: Ps.map Version: svn-trunk
Keywords: legend Cc: ejtizado@…, grass-dev@…
CPU: All Platform: All

Description

Jorge wrote to grass-dev on 7 Feb 2009:

http://thread.gmane.org/gmane.comp.gis.grass.devel/31538 http://thread.gmane.org/gmane.comp.gis.grass.devel/31577


> vlegend
>     where -100 0              --> future  100% 0%
>     ref right lower
>     font Monaco
>     fontsize 8
>     border 1
>     color black
>     fcolor white
>     end

The main change of my custom ps.map is to add a legend.h and legend.c to manage the cosmetic rules of legend (vlegend and rlegend, it is colortable [float or not]) with the rules: where, ref, offset, border, color, fcolor, font, fontsize, fontcolor, cols (and span), margin and width (of the symbol).

Span is included with cols and negative values permit extend the legend over the width of the map (-1 same width that the map, -0.5 the 50% of the width and so)

Moreover, I want traslate more responsabilities of drawing to postscript (the C code is reduced and the relative size of ps file); and to exploit the resources of postscript drawing. Then re-write many part of vlegend, and new rlegend as substitute of the files ps_clrtbl and ps_fclrtbl (but with same parts of code as nice step and ordination of vectors to mantain same final aspect of the map).

Also I try to all 'color' rules use named, RGB or none.

Well, three images with my custom ps.map in action:

vlegend.jpg is obtained with ...

vlegend
    where 0% 0%        -> now use percent (or absolute inches, of course)
    ref left upper    -> reference point
    offset 0 -2        -> x and y offset in points
    font Monaco
    fontsize 8
    fontcolor black    -> new
    margin 4        -> inner margin
    border 2        -> width of outer border (<0 no border)
    color black        -> color of border (named, RGB or none)
    fcolor 240:240:240    -> background color of vlegend (named, RGB or none)
    cols 2 -0.5        -> cols and span in inches (<0 auto, here 50% width of map)
    end

rlegend.jpg is obtained with ...

rlegend y
    raster $RASTER
    where 0% 100%    -> use percent or...
    ref left upper    -> reference point
    offset 0 0    -> x and y offset
    border 2   
    color indigo
    fcolor white
    font Monaco
    fontsize 8
    fontcolor black
    width 0.25
    height 3
    tickbar y
    end

rlegend2.jpg is a not float colortable :)

thanks, Jorge

--

  1. Jorge Tizado

Attachments (5)

rlegend.jpg (14.7 KB) - added by hamish 11 years ago.
new FP raster legend
rlegend2.jpg (12.1 KB) - added by hamish 11 years ago.
new categorical legend
vlegend.jpg (20.2 KB) - added by hamish 11 years ago.
new vector legend
ps_vlegend.c.diff (10.3 KB) - added by hamish 11 years ago.
Jorge_legend_updates.diff (14.2 KB) - added by hamish 11 years ago.
full patch in one file

Download all attachments as: .zip

Change History (15)

Changed 11 years ago by hamish

Attachment: rlegend.jpg added

new FP raster legend

Changed 11 years ago by hamish

Attachment: rlegend2.jpg added

new categorical legend

Changed 11 years ago by hamish

Attachment: vlegend.jpg added

new vector legend

Changed 11 years ago by hamish

Attachment: ps_vlegend.c.diff added

Changed 11 years ago by hamish

Attachment: Jorge_legend_updates.diff added

full patch in one file

comment:1 Changed 11 years ago by hamish

Cc: ejtizado@… added

Hi,

just a reminder -- patches need to fully conform to the SUBMITTING rules in the source code before they can be considered.

also, bite sized chunks are easier for us to digest. (ie 1 new feature set per patch please)

thanks, Hamish

comment:2 Changed 10 years ago by hamish

Cc: grass-dev@… added

comment:3 Changed 4 years ago by martinl

Milestone: 7.0.07.0.5

comment:4 Changed 3 years ago by martinl

Milestone: 7.0.57.3.0

comment:5 Changed 3 years ago by martinl

Milestone: 7.3.07.4.0

Milestone renamed

comment:6 Changed 23 months ago by neteler

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:7 Changed 18 months ago by neteler

Milestone: 7.4.17.4.2

comment:8 Changed 15 months ago by martinl

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:9 Changed 10 months ago by martinl

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:10 Changed 8 months ago by martinl

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.