Opened 16 years ago

Last modified 6 years 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 16 years ago.
new FP raster legend
rlegend2.jpg (12.1 KB ) - added by hamish 16 years ago.
new categorical legend
vlegend.jpg (20.2 KB ) - added by hamish 16 years ago.
new vector legend
ps_vlegend.c.diff (10.3 KB ) - added by hamish 16 years ago.
Jorge_legend_updates.diff (14.2 KB ) - added by hamish 16 years ago.
full patch in one file

Download all attachments as: .zip

Change History (15)

by hamish, 16 years ago

Attachment: rlegend.jpg added

new FP raster legend

by hamish, 16 years ago

Attachment: rlegend2.jpg added

new categorical legend

by hamish, 16 years ago

Attachment: vlegend.jpg added

new vector legend

by hamish, 16 years ago

Attachment: ps_vlegend.c.diff added

by hamish, 16 years ago

Attachment: Jorge_legend_updates.diff added

full patch in one file

comment:1 by hamish, 16 years ago

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 by hamish, 15 years ago

Cc: grass-dev@… added

comment:3 by martinl, 9 years ago

Milestone: 7.0.07.0.5

comment:4 by martinl, 8 years ago

Milestone: 7.0.57.3.0

comment:5 by martinl, 8 years ago

Milestone: 7.3.07.4.0

Milestone renamed

comment:6 by neteler, 7 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:7 by neteler, 7 years ago

Milestone: 7.4.17.4.2

comment:8 by martinl, 6 years ago

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:9 by martinl, 6 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:10 by martinl, 6 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.