{"id":16457255,"url":"https://github.com/briochemc/matlab_plotting_routines","last_synced_at":"2026-08-10T23:30:15.474Z","repository":{"id":96788499,"uuid":"108173195","full_name":"briochemc/MATLAB_plotting_routines","owner":"briochemc","description":"Some MATLAB plotting functions for OCIM-modelling-like research","archived":false,"fork":false,"pushed_at":"2021-05-21T03:57:45.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-09T23:38:35.251Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/briochemc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-24T19:24:34.000Z","updated_at":"2021-11-13T09:28:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"31854ef4-7bab-4273-bf43-71baa40b32d1","html_url":"https://github.com/briochemc/MATLAB_plotting_routines","commit_stats":{"total_commits":45,"total_committers":1,"mean_commits":45.0,"dds":0.0,"last_synced_commit":"bbf292aa2a6ebb40d527ae82cf55ccb6a3e5662f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/briochemc/MATLAB_plotting_routines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briochemc%2FMATLAB_plotting_routines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briochemc%2FMATLAB_plotting_routines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briochemc%2FMATLAB_plotting_routines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briochemc%2FMATLAB_plotting_routines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/briochemc","download_url":"https://codeload.github.com/briochemc/MATLAB_plotting_routines/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/briochemc%2FMATLAB_plotting_routines/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36500221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"online","status_checked_at":"2026-08-10T02:00:05.122Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T10:30:03.095Z","updated_at":"2026-08-10T23:30:15.222Z","avatar_url":"https://github.com/briochemc.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MATLAB plotting routines\n\n## Installation\n\nYou don't really need to install this for the functions to work, although some of them call on another, so it's probably best to follow these instructions to properly install this on your laptop.\n\n1. Clone this repository somewhere on your computer by typing:\n\n    ```bash\n    git clone https://github.com/briochemc/MATLAB_plotting_routines.git\n    ```\n\n    \u003e ***Note***: I suggest creating a directory at the root of your file system called `MATLAB_utilities`.\n    \u003e For example, this can be done from the command-line interface (CLI) by typing `mkdir ~/MATLAB_utilities`.\n    \u003e You can then fill this directory with all the functions that you regularly use in MATLAB.\n\n\n1. Then, you need to add the newly added functions of this repo to the MATLAB path.\n    This is done by typing, in MATLAB:\n\n    ```matlab\n    addpath(genpath('~/MATLAB_utilities'))\n    savepath\n    ```\n\n    After that, any function in your `~/MATLAB_utilities` directory should be available to you whenever you start MATLAB.\n\n## To Do\n\n- Update documentation for\n  - [ ] `yzplot_v4`\n- Add functions\n  - [x] `inpaint_nans3`\n\n## Examples\n\n### Latitude–depth plot:\n\n```matlab\n% load the ao MAT file (you might have to change that)\nload ~/Projects/AWESOME-OCIM/data/ao.mat\n\n% dummy tracer\ntracer_3d = (cosd(ao.LAT) + sind(ao.LON) + cos(ao.DEPTH / 1000)) ;\ntracer_3d(find(~ao.OCN)) = nan ;\ntracer_2d = squeeze(tracer_3d(:,100,:)) ;\n\n% plot options\n% Originally made for the origina OCIM grid,\n% but I could adapt it to the AO...\nopt.grid.yt = ao.lat ;\nopt.grid.zt = ao.depth ;\nopt.grid.dzt = ao.height ;\nopt.clevs = -2:0.1:2 ;\nopt.dash_clevs = -2:0.5:2 ;\nopt.black_clevs = 0:1:2 ;\nopt.white_clevs = -2:1:0 ;\nopt.yTicks = -6000:1000:0 ;\nopt.yTickLabels = cellstr(num2str((6:-1:0)')) ;\nopt.xTicks = -90:30:90 ;\nopt.xTickLabels = {'SP';'60S';'30S';'EQ';'30N';'60N';'NP'} ;\nopt.ylabel = 'Depth' ;\nopt.xlabel = 'Latitude' ;\nopt.grid.dyt = (ao.lat(2) - ao.lat(1)) * ones(1,length(ao.lat)) ;\nopt.grid.yv = ao.lat + opt.grid.dyt / 2 ;\nopt.grid.dzt = ao.height ;\nopt.grid.zw = ao.depth - ao.height / 2\n\n% nice plot\nyzplot(tracer_2d', opt) ;\ncolorbar\n```\n\n### joint PDF\n\n```matlab\nfigure(1)\nN = 2000 ; % number of data points / 2\nobs = 5 + 2 * randn(N, 1) ;             % fake observations data\nmodel = 1.1 * obs + 0.6 * randn(N, 1) ; % fake model data\nobs = obs + 0.2 * randn(N, 1) ;         % add noise to obs\nv = ones(N, 1) ;                        % fake volume boxes (can use AO volumes)\n\njpdf = subplot(1,2,2)\nclevs = 0:10:100\njointPDF(obs, model, v, 'clevs', clevs/100) ; % the plotting function\naxis square\nxlim([-2, 12])\nylim([-2, 12])\nxlabel('observations')\nylabel('model')\ntitle('jointPDF')\n% colorbar\nsubplot('position', [.93 .3 0.02 .4]) % Set the correct sizes\npercentiles = 0:0.1:100 ;\ncontourf([0 1], percentiles, kron([1 1], percentiles'), clevs(1:end-1), 'linestyle', 'none')\n%caxis([0 100]) ;\nset(gca, 'YAxisLocation', 'right')\nset(gca, 'xtick', [])\nset(gca, 'ytick', clevs)\nylabel('percentile')\ncAx = caxis ;\naxes(jpdf) ; caxis(cAx/100) ;\n\nsubplot(1,2,1)\nscatter(obs, model)\naxis square\nxlim([-2, 12])\nylim([-2, 12])\nxlabel('observations')\nylabel('model')\ntitle('scatter')\n```\n\nwhich should look like:\n\n![jointPDF_example](https://user-images.githubusercontent.com/4486578/119079865-5910a800-ba3c-11eb-9912-421824f689db.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriochemc%2Fmatlab_plotting_routines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbriochemc%2Fmatlab_plotting_routines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriochemc%2Fmatlab_plotting_routines/lists"}