MATLAB指定间距坐标代码-ternary_plots:用于创建三元图的MATLAB包

  • Z6_196894
    了解作者
  • 308.4KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-14 07:22
    上传日期
MATLAB指定坐标坐标代码三元图 用于创建三元图的 MATLAB 包。 这是对乌尔里希·特恩 (Ulrich Theune) 著作的重大修改。 它提供了许多新功能来改进绘图功能。 特征 三元网格支持- 提供支持函数以帮助在绘图之前生成三元数据。 这包括支持生成一致的轴范围和均匀间隔的 A、B、C 坐标向量(例如用于生成曲面图)。 自定义数据提示- 提供自定义数据提示,输出三元坐标而不是典型的 X/Y 坐标。 灵活的轴限制- 三元轴可以接受自定义范围,而不是简单的 0 到 1。A/B/C 坐标只需求和为一个常数值 自定义轴- 可以为每个变量自定义刻度线和网格线的间距。 包装函数- MATLAB 绘图函数的三元等效项(例如 surf、plot3、text 等)传递相同的可选参数,从而实现轻松定制。 对象组织和属性链接- 三元绘图对象组织在单个三元绘图句柄中,并具有链接属性,使手动编辑更加高效。 绘图分层- 三元绘图可以包括多层绘图元素,包括曲面、点、线、文本和形状的组合。 线条和文本会自动“堆叠”到表面或散点图上方。 对文本和形状的支持正在开发中,但可以轻松实现。 入门 建议将 repo
ternary_plots-main.zip
  • ternary_plots-main
  • axes_creation
  • ternary_tick_labels.m
    2.3KB
  • ternary_outlines.m
    1KB
  • ternary_grid_lines.m
    1.9KB
  • ternary_axes_titles.m
    1018B
  • ternary_axes.m
    8.3KB
  • problem_setup
  • ternary_arrays.m
    1.7KB
  • ternary_axes_limits.m
    5.8KB
  • LICENSE
    1KB
  • figure_tweaks
  • restack_dataplots.m
    2.4KB
  • ternary_datatip.m
    719B
  • ternary_shift_XY.m
    1.7KB
  • adjust_axis_color.m
    1.1KB
  • README.md
    8.2KB
  • add_ternary_paths.m
    342B
  • utilities
  • cart2tern.m
    545B
  • tern2cart.m
    2.9KB
  • identify_ternary_axis.m
    1.4KB
  • tern2base.m
    2.2KB
  • basic_example.m
    671B
  • advanced_example.m
    4.3KB
  • advanced_example.png
    294.1KB
  • data_plots
  • ternary_surf.m
    2.4KB
  • ternary_scatter3.m
    2.2KB
  • ternary_plot3.m
    1.6KB
内容介绍
# Ternary Plots ![advanced_example.png](https://github.com/lynch4815/ternary_plots/blob/main/advanced_example.png) MATLAB package for creating ternary plots. It is a major overhaul of the [Ternary software](https://www.mathworks.com/matlabcentral/fileexchange/7210-ternary-plots) written by Ulrich Theune. It provides a host of new features to improve plotting capabilities. ## Features 1. **Ternary Grid Support** - Support functions are provided to help generate ternary data prior to plotting. This includes support for generating consistent axes ranges and A, B, C coordinate vectors that are uniformly spaced (e.g. for generating surface plots). 2. **Custom Data Tip** - A custom Datatip is provided that outputs ternary coordinates rather than the typical X/Y coordinates. 3. **Flexible Axes Limits** - Ternary axes can accept customized ranges, rather than simply 0 to 1. A/B/C coordinates need only sum to a constant value 4. **Customized Axes** - Spacing of ticks and grid lines can be customized for each variable. 5. **Wrapped Functions** - Ternary equivalents of MATLAB plot functions (e.g. surf, plot3, text, etc) pass the same optional arguments, enabling easy customization. 6. **Object Organization & Property Linking** - Ternary plot objects are organized in a single ternary plot handle, and have linked properties, making edits by hand more efficient. 7. **Plot Layering** - Ternary plots can include multiple layers of plot elements, including combinations of surfaces, points, lines, text, and shapes. Lines and text are automatically "stacked" to be above surface or scatter plot. Support for text and shapes is in development, but can be implemented easily. ## Getting Started 1. It is recommended to clone the repo to your MATLAB *userpath* folder, then add *ternary_plots/* to your *startup.m* file (e.g. *addpath([userpath,'/ternary_plots/'])* ). This will enable running ternary plotting routines from any working directory. 2. *basic_example.m* shows a minimalist example. *advanced_example.m* includes numerous customized axes. 3. To make changes or to investigate the code, it is recommended to start by exploring the *ternary_axes.m* file, which does most of the heavy lifting. *ternary_surf.m* then shows how the data is used to generate a surface plot. The *problem_setup/* folder is also useful as it shows how the axes limits are obtained and A,B,C coordinates generated. ## File Tree File tree for Ternary Plots, organized roughly by order of use: ```bash Ternary_Plots/ │ ├── README.md ├── basic_example.m ├── advanced_example.m ├── add_ternary_paths.m Adds sub-folders to the MATLAB path │ ├── problem_setup/ Tools for creating ternary data │ ├── ternary_axes_limits.m - Determines the 6 limits the A/B/C axis given │ │ any 3, selecting a ternary sub-region or "zooming in". │ │ Allows for non-zero sum of A+B+C. │ └── ternary_arrays.m - Creates uniformly-spaced A,B,C ternary coordinates. │ (Not required, but provides uniformly spaced plot data) │ ├── axes_creation/ Functions for creating the empty ternary figure │   ├── ternary_axes.m - Driver for creating ternary axes │ ├── ternary_outlines.m - Plots frame of the ternary triangle │ ├── ternary_grid_lines.m - Plots A/B/C grid lines │ ├── ternary_tick_labels.m - Plots text labels on the grid lines │   └── ternary_axes_titles.m - Plots A/B/C Titles │ ├── utilities/ Misc. helper functions │ ├── cart2tern.m - Converts Cartesian X/Y to Ternary A/B/C │ ├── identify_ternary_axis.m - Map 'left'/'bottom'/'center' to 1/2/3 axis indices │ ├── tern2base.m - Determines coordinates for the edges given an interior A/B/C │ └── tern2cart.m - Convert A/B/C coordinates to X/Y plotting coordinates │ ├── data_plots/ Basic commands for plotting ternary data │   ├── ternary_plot3.m │ ├── ternary_surf.m │   └── ternary_scatter3.m │ └── figure_tweaks/ Helper functions for adjusting ternary plots ├── adjust_axis_color.m - Changes the color of an entire axis    ├── restack_dataplots.m - Reorders plots in handle.dataplots to ensure proper order    ├── ternary_datatip.m - Custom datatip to show A/B/C coordinates    └── ternary_shift_XY.m - Shift plot elements by a custom dX/dY ``` ## Ternary Plot Handle The ternary handle contains all the plot objects and data used to generate the ternary figure. It is organized in the hierarchy below. See *ternary_axes.m* and *ternary_surf.m* for typical usage. Currently, only modifications to fields containing primitive plot handles (lines, patch, etc) will automatically update the figure, but future versions will enable automatic updates when any field is altered. ```bash handle │ ├── ax - Parent axes ├── ternaryshift(1:2) - X/Y shifts applied to the ternary axis as a whole (in X/Y) ├── link_color{1:N} - Cell Array of N strings. Elements that are linked for each A/B/C axis ├── axes_color_links - Link Objects for each A/B/C axes; │ ├── title - A/B/C title text │ ├── text(1:3) - Array of text() objects │ ├── titlelabels{1:3} - Cell array of A/B/C title strings │ ├── shift(1:2,1:3) - Matrix of dX/dY shifts for A/B/C title │ └── rotation(1:3) - Vector of degrees rotation for each A/B/C title │ ├── grid - A/B/C grid lines │ ├── lines(:,3) - Array of line() objects │ ├── usegridspace - Boolean for using "gridspaceunit" as an increment rather than count │ ├── gridspaceunit - Number of grid lines per A/B/C axis, unless gridspaceunit=true │ ├── wlimits(1:2,1:3) - Lower and upper bounds for A/B/C coordinates │ ├── grid_pnts(1:3).values(:) - Locations(0->1) of grid lines/labels along A/B/C axes │ ├── link_lines(1:3) - Linkprop object linking properties in each A/B/C axis (e.g. color) │ └── link_axes - Linkprop object linking properties in all lines (ZData) │ ├── tick - A/B/C tick labels │ ├── text(:,3) - Array of text() objects │ ├── tick_fmt - String for formatting tick labels │ ├── shift(1:2,1:3) - Matrix of dX/dY shifts for each tick label │ ├── ticklinelength - length of gridline extending past frame, creating tick marks │ └── link_text(1:3) - Linkprop object linking tick labels together │ ├── outline - A/B/C triangular outline │ ├── lines(:,3) - Array of line() objects │ └── link_lines(1:3) - Linkprop object linking outline lines together │ └── dataplots(1:n_plots) - Array of structures containing data plot information (e.g. plot3/surf) ├── object - graphical objects (e.g. 'patch' or 'scatter' objects) └── colorbar - If using scatter3 or surf, colorbar is created with handle in dataplots ``` ## Features In Development 1. Alternate "Restacking" that is simpler & allows for user to control plot stacking manually. 1. Wrapper functions for patch() and text() defined using ternary coordinates 2. Custom Datatip that plots lines of constant A/B/C at the specified point. 3. Functions to automatically plot spe
评论
    相关推荐
    • matlab 课件
      matlab 功能很强大,本课件详细的介绍了matlab在科学计算中的应用。
    • Matlab教程
      MatlaB经典ppt,主要讲解了MatlaB的入门知识,图形编程以及仿真。
    • matlab入门
      matlab的入门教程,很值得仔细看看,对提高matlab能力有帮助
    • matlab编译器
      matlab编译为exe文件所需要的文件; 使用时解压,将解压后文件拖入至matlab命令行即可
    • matlab
      matlab的基础知识进行介绍
    • MatLab
      “#MatLab
    • MATLAB编译器
      基于MATLAB 2018b版本介绍MATLAB编译器。介绍如何利用编译器将MATLAB代码编译为独立应用程序或组件,并在没有安装MATLAB的计算机上进行部署。
    • MATLAB 论文
      基于MATLAB的论文撰写!可以为你指明一条写作MATLAB论文的道路!
    • matlab
      matlab经典课堂讲义
    • matlab
      matlab