Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: 3D Surface Plot Interpolation

From   Sergiy Radyakin <>
To   "" <>
Subject   Re: st: 3D Surface Plot Interpolation
Date   Wed, 24 Jul 2013 13:43:32 -0400

Hi Joe,

Recently Stata added support for contour plots, I assume there is a
similar task there, to smooth the color transitions. Check them out
for bits and pieces. Perhaps you don't need a 3D plot after all, and
can simply produce a contour plot?

That said, smoothing and plotting are two separate tasks, though some
of the Stata commands like lowess do both.

for smoothing check Kolenikov's message:

Akima's algorithm is here:
the article seems to require a purchase, but the code was available
for download (Fortran).

After smoothing is done in Stata, plotting can be done with either the
user-written command you quoted, or by means of exporting to e.g.
Excel, which supports surface plots.

Best, Sergiy

On Wed, Jul 24, 2013 at 10:17 AM, Joe Canner <> wrote:
> At the recent Stata Conference "wishes and grumbles" session, several of us expressed interest in 3D Surface plots.  StataCorp did not give much reason for optimism in this area.  There is currently a user-written module "surface" which does an OK job of 3D surface plots, but does not have a feature for interpolating and smoothing.
> In SAS, for example, there is PROC G3GRID, which provides a data set with interpolated/smoothed points which can then be plotted with PROC G3D.  G3GRID uses, among other methods, an interpolation method by Akima (1978) which involves forming triangles with existing (x,y) points, fitting a quintic bivariate polynomial for the three vertices of the triangle, and using the resulting model to fill in additional interpolated points.
> There is a set of Fortran subroutines for this algorithm and I would like to try my hand at converting them to Mata, but before I spend a lot of time doing that, is anybody aware of existing Stata functions or commands (user-written or native) that are available for this?
> Thanks,
> Joe Canner
> Johns Hopkins University School of Medicine
> Department of Surgery
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index