# Re: [ferret_users] vertical profile,section and TS plot

```Hi Ansley et al.,

```
It is often desirable to overlay density contours on a T-S plot. So here is my code snippet just in case Mahesh or others might find it useful.
```
define axis/x=32:37:0.1/edges sax
define axis/y=0:32:0.2/edges tax

let ss = x[gx=sax]
let tt = y[gy=tax]
let dd = rho_un(ss,tt,0)-1000

contour/nolab/lev=(20,30,0.5,1)/set dd
ppl xlab "Salinity"; ppl ylab "Potential Temperature"
ppl contour

plot/vs/over sal_pts, temp_pts

David

Ansley Manke wrote:
```
```Hi -
```
First, welcome to Ferret. You may find that some of the demo scripts will help you as you get started learning Ferret. Follow the "tutorials" link on the Ferret Documentation web page.
```http://ferret.pmel.noaa.gov/Ferret/documentation/ferret-tutorials

```
Are your data in a NetCDF file? If so, then if you have opened your dataset, perhaps it looks something like this.
```    yes? use my_data.nc
yes? show data
currently SET data sets:
1> /home/porter/tmap/my_data.nc  (default)
name     title               I         J         K         L
TEMP     TEMPERATURE        1:360     1:180     1:20      1:100
SALT     SALINITY           1:360     1:180     1:20      1:100

```
The commands below show a vertical profile, vertical section and t-s plot; where of course you will choose the locations and time ranges that are correct for your dataset.
```
To make a vertical profile of temperature,

yes? plot/x=300/y=20/L=1 temp

or perhaps

yes? plot/x=45w/y=15s/t="15-jan-2002" temp

To make a vertical section at fixed latitude,

yes? plot/y=20s/t="15-jan-2002" temp

```
And last, you may have something different in mind for a T-S plot, but here is a way to show temperature as a function of salinity. The command PLOT/VS makes a plot where two variables are plotted as symbols, one on the vertical and the other on the horizontal axis. So define new variables that make TEMP and SALT into simple lists of data. I will choose subsets of the data, just to show how that goes. The \ character is a line-continuation mark; to put a long command on two lines for easier reading.
```
yes? let/units="deg C"/title="temperature" temp_pts = \
```
XSEQUENCE(temp[x=300:330,y=10:25,z=0:200,t="1-jan=2002":"30-jun-2002"])
```
yes? let/units="ppt"/title="salinity" sal_pts = \
```
XSEQUENCE(salt[x=300:330,y=10:25,z=0:200,t="1-jan=2002":"30-jun-2002"])
```
yes? plot/vs sal_pts, temp_pts

Mahesh Shinde wrote:
```
```Dear frds.

I am very new to ferret. i want to plot
vertical profile of temperature, vertical section and T-S plot.....

mahesh

--
---------------------------------------------------------------------------------------------------------------------
(Current Affiliation)
Mahesh Shinde
Climate Research Lab(IC3),
Barcelona Science Park,
University of Barcelona,
Barcelona-08028,Spain
email: mshinde@xxxxxxx <mailto:mshinde@xxxxxxx>
----------------------------------------------------------------------------------------------------------------------
(Permanent Affiliation)
Mahesh Shinde
Climate and Global Modeling Division,
Indian Institute of Tropical Meteorology,
(Under the Ministry of Earth Sciences, Govt. Of India)
NCL POST, Dr. Homi Bhabha Road,
```
Pashan,Pune-411008, INDIA email: samurai@xxxxxxxxxxxxxx <mailto:samurai@xxxxxxxxxxxxxx>
```cell: +91-9822050959
----------------------------------------------------------------------------------------------------------------------

```
```
--
Daiwei Wang
Department of Earth and Environmental Sciences and
Lamont-Doherty Earth Observatory
Columbia University

```