# Plot A Cube Diagram Using Matlab

Here is a final effect displayed as following.

We use the function ‘patch’ to draw the cube.

‘Faces’ represents all faces defined by faceLevel that we want to draw, it is composed of the relationship of the points mapped in the vertices set cubeLevel.

‘Vertices’ is an array with the dimension of  $$m \times 3$$, where m is the number of vertices and each raw denote its coordinate [x,y,z].

For example, we have four points cubeLevel=[0 0 0; 1 0 0; 1 0 1; 0 0 1], we could draw a rectangle on x-z plain by setting faceLevel = [1 2 3 4] .

‘FaceVertexCData’ define the color we want to draw for the face. See more details in the Matlab official document.

# Plot a nice figure using Matlab (1)

From today I will present a series of examples to show how to plot nice figures using Matlab.

Today’s topic will address on sharing some skills on how to easily plot tight subplots and how to export nice figures with high-quality.

This is the example we want to obtain:

To plot a tight subplot, I recommend using the package tight_subplot.

To export a nice figure with a transparent background and edge-cut, I recommend using the package export_fig.

To use an alternative colormap except for defaults, I strongly recommend looking for your favorite colormaps from NCL website and download the .rgb file. After deleting the first few descriptive lines in the .rgb file, it could be loaded easily in Matlab:

To plot a nice contour map, first, plot pcolor and then hold on the figure and then plot contour for the same data with no line.

And here are some normal configurations to control axes.

The contents mainly refer to NASA’s official website here: https://disc.gsfc.nasa.gov/data-access.

First, please refer to the official website to apply an Earthdata account.  Here I describe an example to download multiple ocean data only.

Second, configure wget following instructions provided by formal website as well. Here is a short summary (for Linux/Mac only):

• Give permission to this file: chmod 0600 .netrc

Third, taking downloading “Aquarius Official Release Level 3 Rain-flagged Sea Surface Salinity Standard Mapped Image Descending Daily Data V5.0” data for the whole 2012 for example.

To start, find the “Data Access” section and go to ‘OPENDAP’ method to reach the data location. Select ‘2012’ and further go to ‘001’ directory, we’ll see several different files that in this folder, actually they are different data but have the same logical data structure, so they are arranged in the same directory. What we are looking for is “RAIN_MASK_SSS” data, so we click the corresponding link and reach the location of this file.

Just copy the content in DATA URL line and we will obtain the url for this file.

You can of course download this file directly via clicking “Get as NetCDF-4” button, but you can also use a cooler method to download it using this url in a command terminal by typing:

This cooler method makes it possible for us to download multiple files at once.

So the next question is how to obtain the multiple url for files we’re interested in. By observing the naming rules of the file, we can use a MATLAB script to make it. Here is a sample MATLAB script to make it.

Finally, it cannot be easier for us any more, just type following command in the terminal in your preferred directory:

Done.

# Data Visualization Using ParaView on Supercomputer

This article just shows a quick glance for what we can expect from ParaView for data visualization on Supercomputer.

Before beginning, you should have prepared your data well for visualization.

Let’s start now.

First, you need to have access to GPU resources in one supercomputer and login to set everthing to work fine.

Then, this is most basic things that you can expected from ParaView:

Of course, it is quite easy to obtain corresponding amazing animation effect!

Enjoy it!

# Draw an animation with NCL

Similarly to Matlab, to obtain an animation, first we need plot  time-series figures with all plot configuration the same except for the data. Then using convert command to convert these independent figures into an animation.

And then run following command in the terminal

Then we obtain the animation.

# Draw a 3D-animation with Matlab

This article tells how to draw a 3D figure from 3D data with Matlab, and by the way how to generate an animation for such 3D data with convert  command in Linux terminal.

The 3D figure may looks like this:

The Matlab code:

After running this Matlab script, we will obtain many figures with time going forward. Then we run following command in Linux terminal in figure directory:

Then we obtain the animation.

# ISDA2018纪实

09.03.2018更新

———————————————————-08.03.2018——————————————–

———————————————————-07.03.2018——————————————–

———————————————————-06.03.2018——————————————–

———————————————————-05.03.2018——————————————–

# Various fraction expression ways in LaTeX

I tried to input an alternative fraction number by $$\LaTeX$$ according to a literature today and finally I made it! Here is a conclusion for several fraction format in  $$\LaTeX$$.

The last expression is exactly the one I am looking for!

In the next article, I will talk about the degree symbol in $$\LaTeX$$.

Reference: