![]() |
![]() |
You have made a nice map in Matlab using M_Map by Rich Pawlowicz.
Now you're thinking of putting on some names of countries or other landmarks. Then maybe it strikes you that you've done this many times for this area, using text or gtext until your fingers get numb.
No more! :-)
M_Map now has an addition called M_Namebox, a toolbox
keeping and letting you keep a database of names and their positions
(it's going to be part of the "standard" distribution, but for
debugging purposes kept here on the author's site).
contents.m The matlab helpfile for the toolbox
The files
The help sections of the following files are better maintained than this html-page, so please refer to the Matlab online help (or look into this list) for updated and detailed instructions.
m_names.m Puts names of places on M_Maps
m_movetext.m Customization of text objects in figures
m_newname.m GTEXT-type function for adding names to an M_Map
m_savename.m Save names on an M_Map to a database
m_name_demo.m A demo of the m_name-toolbox
m_namebase.mat The main database of names and their positions
m_namebox.html HTML-documentation (this page)
Download and installation
The M_Namebox-specific site is
www.gfi.uib.no/~even/matlab/m_namebox/m_namebox.html (this page),
and the files on this site will be the regularly updated. The
"standard" distribution of M_Map will include
M_Namebox (in the future), but not as regularly updated
as here.
All files are packed into each of the file-alternatives m_namebox.zip and m_namebox.tar.gz, or you can download the files listed above, one by one (it's not that many).
The files can be put anywhere in your matlab-path since there are no references to specific directories in the code*. The best is to but them in a sub-directory since there is a contents.m-file, and this directory is best placed among the other M_Map files since this toolbox is a part of the M_Map package.
m_names;puts names from the database in their right place on the map. The names might not be placed perfectly, but now you can control the positioning, size and other aspects of the strings by simple keypress:
NUM-PAD arrows - move text Home,End,PgUp,PgDn - move in larger steps + - increase font-size - - decrease font-size / - rotate anticlockwise * - rotate clockwise 5 - toggle object (in)visible b - toggle bold i - toggle italic c - toggle case w - word case l - toggle listbox-visible (should be off when printing) n - add new name e - edit name s - save this name to mapname-base a - save all visible names on map h - helpThe keys work on the current text object, which in matlab is selected by mouse-clicking on it.
The function m_names also gives a listbox where you can choose names from all available names in the area, including the invisible ones (those too small for m_names' size-limit).
After running m_names, M_Namebox primarily works as a keypress controlled "suite", but the functions are stand alone functions and have more utilities than those accessed from keyboard. Please see the documentation (help) of the functions for details, and to fully understand this toolbox.
Although you can make several m_name-databases, it is recommended that you keep a well maintained default (main) database, since this is what you probably will be using every time you start putting names on a map. See m_savename for detailed instructions on building databases.