Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: spmap to plot only points?
From
Thomas Speidel <[email protected]>
To
<[email protected]>
Subject
Re: st: spmap to plot only points?
Date
Wed, 04 Sep 2013 08:18:39 -0600
Thank you Maurizio. Very helpful the tip to create a dummy map.
Thomas
On 2013-09-04 0:27, Maurizio Pisati wrote:
Dear Thomas,
you have two basic option:
1. Without -spmap-: Plot the points using -graph twoway scatter-.
2. With -spmap-: You need to create a dummy basemap that contains all
the points, and then proceed as usual. Here's an example using the
point
dataset "Italy-Capitals.dta" distributed with -spmap-:
. * Open the point dataset of interest
. use "Italy-Capitals.dta", clear
. * Find the min and max values of the x- and y-coordinates of the
points
. summarize xcoord ycoord
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
xcoord | 103 758654.8 226063.8 368761.1 1279167
ycoord | 103 4761314 288410.5 4101939 5151970
. * Create a basemap dataset representing the (approximate) minimum
bounding
. * box for your set of points
. clear
. input _ID _X _Y
_ID _X _Y
1. 1 . .
2. 1 350000 4000000
3. 1 350000 5200000
4. 1 1300000 5200000
5. 1 1300000 4000000
6. end
. sort _ID, stable
. save "mbb.dta", replace
file mbb.dta saved
. * Create a temporary master dataset containing just one location
. clear
. input id
id
1. 1
2. end
. * Draw the map setting the basemap outline color to "none"
. spmap using "mbb.dta", id(id) ocolor(none)
point(data("Italy-Capitals.dta") x(xcoord) y(ycoord))
Best wishes,
Maurizio
Il giorno 03/set/2013, alle ore 22.21, Thomas Speidel ha scritto:
I'm using spmap (user written addon by Maurizio Pisati - 1.2.0) to
plot
location points by certain attributes. I'm wondering if it is
possible,
either with spmap or other spatial addons, to plot the points
without
a
boundary region since I'm interested in the location of the points
relative to each other. I do have a boundary shapefile which I was
able
to use. However, the boundary is too large compared to the distance
among the points, thus, it does not convey spatial distribution.
Thanks
-- Thomas Speidel
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/
--
Thomas Speidel
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/