[GRASS-user] d.mon and monitor frames

Damian M maddalena at nc.rr.com
Fri Sep 3 16:32:45 EDT 2010


I am experimenting with a very simple Python script that uses frames in a PNG
monitor.  Does d.barscale at=xy describe the xy from top-left in percent
distance from the monitor or the frame?  The verbiage in the documentation
uses "frame," but I can't seem to make it behave the way I would expect it
to given that.

Frames are as follows:

    # create a title frame
    grass.run_command("d.frame", frame="title", at="90,100,0,100",
flags="c")

 # create a map frame
    grass.run_command("d.frame", frame="map", at="7,90,0,100", flags="c")

  # create a legend frame
    grass.run_command("d.frame", frame="legend", at="0,7,0,100", flags="c")

I can place a barscale at the very bottom left of the map frame with

#110 works, but I thought it was only 1-100?!
grass.run_command("d.barscale", bcolor="white", tcolor="black", at="2,110")

but I cannot successfully place a barscale in the legend frame.

The complete script section is as follows:

-------------------------------------------------------------------
    # create a title frame
    grass.run_command("d.frame", frame="title", at="90,100,0,100",
flags="c")
    
##    grass.run_command("d.text", text=mapName, align="uc", size="60",
color="black",flags="b")
    grass.run_command("d.text", text=mapName, at="30,30", size="40",
color="black",flags="b")

    # create a map frame
    grass.run_command("d.frame", frame="map", at="7,90,0,100", flags="c")
    grass.run_command("d.vect", map="parcelBoundaries",
type="boundary",col="black", fcolor="gray", width="2")
    grass.run_command("d.vect", map="digitizedLagoons",
type="boundary,area",col="black", fcolor="gray", width="1")
    grass.run_command("d.vect", map="digitizedStructures",
type="boundary,area",col="black", fcolor="gray", width="1")
    grass.run_command("d.vect", map="trees_all",
type="point",icon="basic/triangle",color="black", fcolor="gray", size="10")
    grass.run_command("d.vect", map="seep",
type="point",icon="basic/cross2",color="black", fcolor="black", size="10")
    grass.run_command("d.vect", map="wells",
type="point",icon="basic/circle",color="black", fcolor="black", size="15")
    grass.run_command("d.vect", map="weatherStation",
type="point",icon="basic/box",color="black", fcolor="black", size="10")
 ##THIS WORKS
    grass.run_command("d.barscale", bcolor="white", tcolor="black",
at="2,110")
    
    # create a legend frame
    grass.run_command("d.frame", frame="legend", at="0,7,0,100", flags="c")
    grass.run_command("d.text", text="some text", size="20", at="85,50",
color="black")
    grass.run_command("d.text", text="some more text", size="20",
at="85,30", color="black")

   #THIS DOES NOT WORK..played with several "at=xy settings.
    grass.run_command("d.barscale", bcolor="white", tcolor="black",
at="2,10)


------------------------------------------------------------------------------------------


-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/d-mon-and-monitor-frames-tp5496890p5496890.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list