File Exchange

image thumbnail

Creating Specialized Charts with MATLAB OOP

version 1.1 (11.1 MB) by Ken Deeley
Catalog of custom task-specific charts comprising a chart gallery and a documentation browser.

22 Downloads

Updated 18 Oct 2019

View License

This submission contains the MATLAB code for the technical article "Creating Specialized Charts with MATLAB Object-Oriented Programming". These examples were developed by Ken Deeley, David Sampson, Michele Facchinelli, Davide Fantin and Bruno Rodriguez Esteban at MathWorks. This File Exchange entry contains all code and examples used in the article.

A chart provides a task-specific application programming interface (API) for creating custom visualizations. Designing and implementing a chart not only provides a convenient API for end users, but simultaneously removes the need for the user to manipulate low-level graphics objects.

The code comprises several examples of custom MATLAB charts, together with a catalog app for browsing the available charts. Install and run the app to launch the chart catalog.

You can inspect the source code used for each chart, explore the features and functionality of each chart, and run Live Script examples demonstrating the use of each chart. The app features several diverse examples of custom charts, together with documentation and resources to help you get started with developing your own charts.

Cite As

Ken Deeley (2019). Creating Specialized Charts with MATLAB OOP (https://www.mathworks.com/matlabcentral/fileexchange/65857-creating-specialized-charts-with-matlab-oop), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Ken Deeley

Hi Paul,

Thanks very much for the feedback. Creating a heatmap chart is a great example. You can associate a colormap with an axes as follows.

% Create a figure and an axes.
f1 = figure;
ax = axes(f1);

% Associate a specific colormap to the axes.
colormap(ax, jet(64))
% Visualise this by adding a colorbar.
colorbar(ax)

% Next, create a new figure equipped with a different colormap.
f2 = figure('Colormap', summer(64));

% Move the axes to the new figure, then check that the colormaps are preserved.
ax.Parent = f2;

% Check:
isequal(f2.Colormap, summer(64))
isequal(ax.Colormap, jet(64))

Many thanks,
Ken

Hi,
Thank you for this code, it gave me what I needed to get started with some well programmed charts. One comment:

I made a heat-map chart as a way of getting started. I used an Image to present the matrix of numbers and the colormap to set the color representation. However, the colormap is associated with the Figure in Matlab and not an Axes. Consequently, when I change the parent, it take on the colormap of the new figure window. Maybe it would be helpful to make the "parent" property observable, so if it changes I can trigger an "update". It is, however, also possible that I missed something.
Thanks Paul

Ken Deeley

Hi Matthew,
Thank you for providing feedback. Further updates to this File Exchange entry are planned. I would be interested to investigate items (1)-(3) with you in more detail. Please email me at <first name> dot <last name> at mathworks dot com with a brief description of the reproduction steps. (4) is fixed for the next release. (5) is a good idea if we release this entry as a toolbox at some point.
Thanks,
Ken

Matthew

A nice ambitious project. It would make me happy to think that this "Chart" object would be continued to be developed.

I have some small issues:
1. The detection of the "GUI Layout Toolbox" does not necessarily work (for me) even though it is installed.
2. The GalleryLauncher misaligns the chart with the image associated with that chart
3. Do you really want to pollute the users name space with your +Data and +Exercise packages (?)
4. Cylinder.mlx contains a saved error
5. Should (or can) this project have the proper MATLAB toolbox parts: help, contents file etc.

Updates

1.1

This update contains further examples of custom charts, and the catalog now has an integral browser for the chart documentation.

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: GUI Layout Toolbox