Adjust isopycnal line in tsdiagram

4 views (last 30 days)
주희 박
주희 박 on 8 Jul 2022
Answered: sai charan sampara on 20 Oct 2023
Hi I want to adjust isopycnal line of ts diagram. I draw below tsdiagram using theta_sdiag(I got it on web).
I want to show specific values like 27.0, 27.1,27.2,27.3 .. not 26.9626 and 27.0552 like below picuture.
Thanks in advance.

Answers (1)

sai charan sampara
sai charan sampara on 20 Oct 2023
Hello 주희 ,
I understand that you are trying to use “tsdiagram” file from file exchange to plot TS diagram.
You want to adjust “isopycnal” lines that are plotted by the “theta_sdiag” function. These lines are being generated by the line 21 which is:
[c,h]=contour(si,thetai,dens,'k');
In this line of code, contour plots of x data “si” and y data “thetai” are being plotted at levels decided by z that is “dens”. This variable “dens” denotes the levels at which the lines are plotted. To get lines at more rounded values the variables “dens” can be rounded to one decimal place. It can be done by changing line 17 in “theta_sdig” as follows:
dens(j,i)=round(sw_dens(si(i),thetai(j),0),1)
This will give lines at values with only one number after decimal point.
You can refer to the below documentation to learn more about contour plot:
Hope this helps.
Thanks,
Charan.

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!