CHLNDDEV / OceanMesh2D

A two-dimensional triangular mesh generator with pre- and post-processing utilities written in pure MATLAB (no toolboxes required) designed specifically to build models that solve shallow-water equations or wave equations in a coastal environment (ADCIRC, FVCOM, WaveWatch3, SWAN, SCHISM, Telemac, etc.).
https://github.com/sponsors/krober10nd
GNU General Public License v3.0
188 stars 68 forks source link

Plotting bathymetry for Example_8_AK #307

Closed aribal2018 closed 9 months ago

aribal2018 commented 9 months ago

Good morning,

I am trying to plot the bathymetry with proper axis for example_8_AK but was not successful.

The bathymetry can be plotted but I just could not fixed the axis. This should be very simple one but I just could not figure it out.

Any suggestion will be greatly appreciated. Thank you very much.

WPringle commented 9 months ago

@aribal2018 please provide working example showing the problem. Preferably this should be moved to the Slack channel. Sign up here

aribal2018 commented 9 months ago

When we run the example, we get a perfect figure for the mesh as follows: image

However, when I try to plot the bathymetry using command: plot(m,'type','bmesh'); % plot bathy on the mesh Then, I get the following errors: image

where the figure is as follows: image

I am expecting to obtain the figure as the mesh figure but for the bathymetry. Hope this makes sense.

WPringle commented 9 months ago

@aribal2018 This makes sense now. It is having trouble because of cmocean pivot issue since your bathymetry doesn't go to zero. This may be a bug that deserves fixing. I'll take a look. But you can just manually type 'm_grid;' to get the lat-lon axis and manually update colormap to your desired settings as well.

aribal2018 commented 9 months ago

Great.. Thanks

krober10nd commented 9 months ago

Check out the colormap kwarg argument in the plot method. The color limits aren't able to represent the range of colors in the subdomain you're plotting.

aribal2018 commented 9 months ago

Thanks. I will check it. This is still related to plot bathymetry.

Is the anyway to plot bathymetry based on the file fort.14? I have created my final mesh but I forgot to plot the bathymetry.

However, I have the files *.14 and mesh file. I believe the bathymetry can be plotted using those files but do not know how. Thanks again. Your help is very much appreciated.

WPringle commented 9 months ago

use msh() command to read in fort.14 file. please see Matlab help msh.msh / user guide.

aribal2018 commented 9 months ago

Thanks