6.8.7 Contour plot in Sphere Surface Projections

Summary

When you import global NetCDF data, for example global temperature data, you can create a Contour plot in a Sphere Surface Projection.

NetCDF on Sphere Surface Projections 01.png


Minimum Origin Version Required: 2021b SR0

Steps

Create NetCDF data-based plot on a Sphere Surface Projection

  1. Open this project file with a NetCDF data matrix.
  2. Activate the matrix and add four new matrix objects in the same MatrixSheet.
    NetCDF on Sphere Surface Projections 02.png
  3. Double click on the Image Selector to rename these matrix object to: Lon, Lat, x and y.
    NetCDF on Sphere Surface Projections 03.png
  4. Activate each matrix, click on the Properties button on the pop-up mini toolbar, and select Set Value. In the Set Value dialog, enter the following formulas respectively:
    //Lon object
    x*pi/180
    //Lat object
    y*pi/180
    //x object
    3*Mat(2)/2 * sqrt(1.0/3 - (Mat(3)/pi)^2)
    //y object 
    Mat(3)

    NetCDF on Sphere Surface Projections 04.png

  5. Select the first matrix in MBook1 and choose Plot > Contour : Contour - Color Fill from the main menu.
    NetCDF on Sphere Surface Projections 05.png
  6. Double-click on the graph to open the Plot Details dialog. Navigate to the Contouring Info tab, select [MBook1]air!4"x"] and [MBook1]air!5"y"] in the X Coordinates and y Coordinates drop-down list.
    NetCDF on Sphere Surface Projections 06.png
  7. Select Layer1 in the left panel, and go to Display/Speed tab. Uncheck X Axes and Y Axes check boxes under Show Elements section. Click OK to save the settings.
    NetCDF on Sphere Surface Projections 07.png
  8. Click the Rescale button
  9. Delete the Axes Title and Color Scale Title. Then you will have the graph as displayed below:
    NetCDF on Sphere Surface Projections 08.png

Customize Levels, Lines and Color Map

  1. Click on the Contour plot, and then click on the Contour Style button on the pop-up Mini Toolbars, select Color Scale without Contour Line
    NetCDF on Sphere Surface Projections 09.png
  2. Click on the Set Levels button on the pop-up mini toolbar. In the Set Levels dialog, set Major Levels to 16 and Minor Levels to 16. Click the OK button.
    NetCDF on Sphere Surface Projections 10.png
  3. Click on the Contour plot, and then click on the Palettes button on the pop-up mini toolbar. Then select the Surface palette from the drop-down.
    NetCDF on Sphere Surface Projections 11.png
    Then you will get the contour plot similar to the graph below:
    NetCDF on Sphere Surface Projections 12.png


Add Map Lines and Grid line

There is longitude and latitude data as well as grid lines data in the workbook. First, we need to convert them to Spherical Surface.

  1. Insert two columns as Column C and D, then in the formula column label row F(x) enter 3 * A * pi / 180 / 2 * sqrt(1/3 - (B / 180)^2) for Col(C), and then enter B * pi / 180 for Col(D).
  2. Add two columns as Column G and H, then in in the formula column label row F(x) enter 3 * E * pi / 180 / 2 * sqrt(1/3 - (F / 180)^2) for Col(G), and then enter F * pi / 180 for Col(H).
  3. Set Col(C) and Col(G) to X.
    NetCDF on Sphere Surface Projections 13.png
  4. Highlight Col(D) and Col(H), and drag and drop into contour plot. Double click on the graph to open the Plot Details dialog and set the Style of Grid lines to Dash.
    NetCDF on Sphere Surface Projections 14.png
  5. Remove the legend for the lines. Then you will get the contour plot similar to the graph below:
    NetCDF on Sphere Surface Projections 01.png