**- Undocumented Matlab - https://undocumentedmatlab.com -**

Specialized Matlab plots

Posted By Yair Altman On April 11, 2012 | __5 Comments__

A few weeks ago, MathWorks has added a new section on its website called the “Plot Gallery ^{[1]}“. This section highlights specialized Matlab plots that were posted on the Matlab File Exchange (FEX) and can be used by Matlab users in their GUIs. Unfortunately, for the moment this list only includes some 20 customized plots posted by MathWorks employees, in addition to some 50 examples of using the standard Matlab plots. I have a suspicion that one day, if this proves popular, we will find the gallery integrated in the main Matlab Desktop, possibly next to the current plot selector component ^{[2]}.

Since the Plot Gallery section is a new effort at reducing plotting complexity to Matlab users, I think that it should be encouraged by user feedback. Please feel free to leave them a comment with your feedback, either on this page ^{[3]}, or on their semi-official blog announcement page ^{[4]}.

My personal beef with the new Plot Gallery is the fact that it does not currently include user submissions. FEX actually contains numerous user-submitted specialized plotting utilities, answering a wide variety of needs in multiple discipline fields. These can easily be found using FEX’s search functionality or tags. For example, the FEX “plot” tag ^{[5]} currently has 440 separate submissions. Perhaps one day these user submissions will be added to the Plot Gallery in some searchable structured manner.

One set of specialized plots that I’d like to highlight today is based on the open-source JFreeChart, that I have described here ^{[6]} last year. Sven Körner has used this to provide ^{[7]} a dozen different customized Matlab plots, a few of which can be seen below, showing the power of integrating external code in Matlab GUI. JFreeChart contains many more customizable chart, plot and gauge types so Sven’s examples should merely be considered as appetizers:

Categories: GUI, Low risk of breaking in future versions

5 Comments (Open | Close)

Article printed from Undocumented Matlab: **https://undocumentedmatlab.com**

URL to article: **https://undocumentedmatlab.com/articles/specialized-matlab-plots**

URLs in this post:

[1] Plot Gallery: **http://www.mathworks.com/discovery/gallery.html**

[2] plot selector component: **http://undocumentedmatlab.com/blog/plot-type-selection-components/**

[3] on this page: **http://undocumentedmatlab.com/blog/specialized-matlab-plots/#respond**

[4] announcement page: **http://blogs.mathworks.com/pick/2012/03/23/matlab-plot-gallery/**

[5] the FEX “plot” tag: **http://www.mathworks.com/matlabcentral/fileexchange/?term=tag%3A%22plot%22**

[6] described here: **http://undocumentedmatlab.com/blog/jfreechart-graphs-and-gauges/**

[7] provide: **http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A92825+JFreeChart**

[8] Customizing contour plots : **https://undocumentedmatlab.com/articles/customizing-contour-plots**

[9] Customizing histogram plots : **https://undocumentedmatlab.com/articles/customizing-histogram-plots**

[10] Customizing contour plots part 2 : **https://undocumentedmatlab.com/articles/customizing-contour-plots-part2**

[11] Customizing contour plots part 2 : **https://undocumentedmatlab.com/articles/customizing-contour-plots-part-2**

[12] Customizing axes tick labels : **https://undocumentedmatlab.com/articles/customizing-axes-tick-labels**

[13] Waterloo graphics examples : **https://undocumentedmatlab.com/articles/waterloo-graphics-examples**

[14] : **http://www.mathworks.com/matlabcentral/fileexchange/14583-UIComponent**

[15] : **http://www.mathworks.com/matlabcentral/fileexchange/15580-JControl**

[16] : **https://undocumentedmatlab.com/blog/javacomponent/**

[17] : **http://javafx.com/**

[18] : **http://www.mathworks.com/matlabcentral/fileexchange/35026**

Click here to print.

Copyright © Yair Altman - Undocumented Matlab. All rights reserved.

5 Comments To "Specialized Matlab plots"

#1 CommentByMalcolm LidierthOn April 13, 2012 @ 12:26As well as

`JFreeChart`

, JavaFX 2.0 Charts can also be added to MATLAB figures using a`JFXPanel`

. Those can be added to MATLAB containers in the same way as a`JPanel`

using the undocumentedfunction (or derivatives likejavacomponent^{[14]}and^{[15]}from the FEX – see this blog for details from Yair (^{[16]})You will of course need to put the JavaFX runtime from Oracle on the MATLAB javaclasspath (

^{[17]}).#2 CommentByPatrickOn April 16, 2012 @ 13:13Hey Yair,

Amazing blog I read it all the time; I have a quick question about using the jzy3d library (Supposedly a good library for charts that are bit more complicated than those in JFreeChart, which I have gotten working with no problems). I have just been testing it and I am having difficulty getting a piece of code working. I added the following files to the static path:

org.jzy3d-0.9.jar

org.jzy3d-0.9-dependencies.zip

And ran the following code:

When I create the ‘chart’ object I get the following error:

Undefined variable “org” or function “org.jzy3d.chart.Chart”.

I have checked to ensure that the fully qualified name is correct and the constructor accepts no arguments.

Any help will be appreciated.

Thanks,

#3 CommentByYair AltmanOn April 16, 2012 @ 14:59@Patrick – I’m not exactly sure, but you can look at Malcolm Lidierth’s recent

^{[18]}that demonstrates using jzy3d in Matlab. If you drill down in this submission’s internal m-code (which shouldn’t be too difficult), I’m pretty sure you’ll find the answer.#4 CommentByMalcolm LidierthOn April 16, 2012 @ 17:57@Patrick

Some of the jzy3d dependencies (e.g. JOGL) are part of the standard MATLAB distribution and on the static javaclasspath – but not in the right version for jzy3d 0.9. Try using jzy3d 0.8.4 which worked for me – or update the dependent jars loaded by MATLAB.

#5 CommentByPatrickOn April 17, 2012 @ 07:25@Malcolm

I tired using your submission on the FEX and I am able to create my example above, I’ll see what I can do about using 0.8.4. Thanks for your suggestions.