enter image description here

I want to know the specific spatial pattern of certain variables. I have tried to set the listdensityplot as background and add some transparency, but it's not working very well.

How can I draw the densityplot/contourplot directly on just the coast lines to show the position of each value?

Thanks a lot for your attention.

  • 1
    $\begingroup$ How did you generate the image you show? Can you show us the data and code you have so far? $\endgroup$ – MarcoB Feb 14 '17 at 19:28
  • $\begingroup$ I was using a NetCDF plot tool named Panoply. $\endgroup$ – Baoxiang Pan Feb 14 '17 at 22:55

It seems that I got an ugly but working solution for this question.

Firstly, we have a 2D plot of some variables, like this:

(* Import data *)
data=Import["myfile.nc",{"Datasets","var name"}]
(* ArrayPlot or ListDensityPlot or any other 2D plot here *)
                 PlotRangePadding->None, (* Important *)

enter image description here

With the image as background, we can further add coastlines of Geo objects we need, using the following code:

With[{bounds = {{-90, 90}, {0, 360}}}, 
   {{GeoStyling[{"GeoImage", image[[1]]}, 
     GeoRange -> bounds], 
     GeoBoundsRegion[bounds]},  (* image background stretched within bound area *)
    {FaceForm[],EdgeForm[Black],Polygon[Entity["Country","New Zealand"]]}},
   GeoProjection -> "WinkelTripel", 
   GeoGridLines -> True, 
   ImageSize -> Medium], 

Then we have: enter image description here


Not the answer you're looking for? Browse other questions tagged or ask your own question.