Group Abstract Group Abstract

Message Boards Message Boards

3
|
4.4K Views
|
5 Replies
|
15 Total Likes
View groups...
Share
Share this post:

Issue using RegionFunction with ListContourPlot

POSTED BY: Ian Williams
5 Replies

Deleted

POSTED BY: Ian Williams
Posted 2 years ago

Crossposted here.

POSTED BY: Rohit Namjoshi
POSTED BY: Brett Champion

Thanks Brett,

That's really helpful. The workings of ListContourPlot are starting to become clearer. I also had an answer from Stack Exchange where it was suggested that I should set a largeish value for the optional argument MaxPlotPoints. This seems to be effective (see attached notebook). The only downside is that the selection of a suitable value for MaxPlotPoints is somewhat arbitrary and necessitates a trial-and-error process.

So I've been thinking about an alternative solution. One such possibility when contouring data over a triangulated irregular mesh would be to contour each triangular cell individually and then Show all the contoured cells. In principle this should work. And could potentially provide a fairly robust solution. However, in the attached notebook, I'm seeing some odd results. If you scroll down to the last cell and have a play with the Manipulate, you'll see that the contour colour bands align across some cells but don't align across others - see screenshot below.

enter image description here

I suspect there might be some kind of color function scaling effect going on as the contour lines all seem to align. Any further advice on how to resolve this issue would be much appreciated.

All the best,

Ian

POSTED BY: Ian Williams

Hi Brett,

I've figured out how to build the contour plot on a cell-by-cell basis. Just need to explicitly specify a ColorFunction and set ColorFunctionScaling -> False as per the attached notebook. This seems like a good approach for contouring irregularly spaced data without having to worry about the contours spilling out beyond the mesh boundary. Perhaps it could be built-in?

On another, not unrelated subject, I'm now noticing some unexpected behaviours when I specify values for InterpolationOrder & MaxPlotPoints. My understanding from the documentation is that, for irregularly spaced data, contours can only be derived by linear interpolation. And this does seem to be the case if I don't set a value for MaxPlotPoints. In which case the contours are derived explicitly from the raw point data by a process of linear interpolation on the triangulated mesh. And setting a value for InterpolationOrder has no effect on the contour plot.

So far, so good. But then I give a value for MaxPlotPoints and start to see some unexpected behaviours when also setting a value for InterpolationOrder. These behaviours are illustrated by the examples titled Cases 1-5 in the last section of the attached notebook. In summary, setting InterpolationOrder to Automatic or 1 seems to result in non-linear interpolation whereas setting InterpolationOrder to 3 seems to result in linear interpolation.

It feels like there may be two stages of interpolation happening when a value is given for MaxPlotPoints. However, the methodology isn't clear and the results of specifying a value for InterpolationOrder are the opposite of what I'd expect. Any clarification would be welcome.

Many thanks,

Ian

POSTED BY: Ian Williams
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard