Undocumented Matlab
  • SERVICES
    • Consulting
    • Development
    • Training
    • Gallery
    • Testimonials
  • PRODUCTS
    • IQML: IQFeed-Matlab connector
    • IB-Matlab: InteractiveBrokers-Matlab connector
    • EODML: EODHistoricalData-Matlab connector
    • Webinars
  • BOOKS
    • Secrets of MATLAB-Java Programming
    • Accelerating MATLAB Performance
    • MATLAB Succinctly
  • ARTICLES
  • ABOUT
    • Policies
  • CONTACT
  • SERVICES
    • Consulting
    • Development
    • Training
    • Gallery
    • Testimonials
  • PRODUCTS
    • IQML: IQFeed-Matlab connector
    • IB-Matlab: InteractiveBrokers-Matlab connector
    • EODML: EODHistoricalData-Matlab connector
    • Webinars
  • BOOKS
    • Secrets of MATLAB-Java Programming
    • Accelerating MATLAB Performance
    • MATLAB Succinctly
  • ARTICLES
  • ABOUT
    • Policies
  • CONTACT

Specialized Matlab plots

April 11, 2012 5 Comments

A few weeks ago, MathWorks has added a new section on its website called the “Plot Gallery“. 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.
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, or on their semi-official blog announcement page.
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 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 last year. Sven Körner has used this to provide 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:

MATLAB-integrated dial gauge chart
MATLAB-integrated dial gauge chart

MATLAB-integrated multi-axes chart
MATLAB-integrated multi-axes chart

Related posts:

  1. Customizing contour plots – Contour labels, lines and fill patches can easily be customized in Matlab HG2. ...
  2. Customizing histogram plots – Basic bar charts and histogram plots can be customized in important aspects. ...
  3. Customizing contour plots part 2 – Matlab contour labels' color and font can easily be customized. ...
  4. Customizing contour plots part 2 – The contour lines of 3D Matlab plot can be customized in many different ways. This is the 2nd article on this issue. ...
  5. Customizing axes tick labels – Multiple customizations can be applied to tick labels. ...
  6. Waterloo graphics examples – Some Matlab usage examples for the open-source Waterloo graphics package. ...
File Exchange GUI JFreeChart
Print Print
« Previous
Next »
5 Responses
  1. Malcolm Lidierth April 13, 2012 at 12:26 Reply

    As 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 undocumented javacomponent function (or derivatives like uicomponent and jcontrol from the FEX – see this blog for details from Yair (link)
    You will of course need to put the JavaFX runtime from Oracle on the MATLAB javaclasspath (http://javafx.com/).

  2. Patrick April 16, 2012 at 13:13 Reply

    Hey 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:

    size = 100000;
    points(size,1) = org.jzy3d.maths.Coord3d;
    for k=1:size
        x = rand(1) * 1000;
        y = rand(1) * 1000;
        z = rand(1) * 1000;
        points(k) = org.jzy3d.maths.Coord3d(x,y,z);
    end
    colormapper = org.jzy3d.colors.ColorMapper(org.jzy3d.colors.colormaps.ColorMapRainbow(),0,100);
    scatter = org.jzy3d.plot3d.primitives.MultiColorScatter(points,colormapper);
    chart = org.jzy3d.chart.Chart;

    size = 100000; points(size,1) = org.jzy3d.maths.Coord3d; for k=1:size x = rand(1) * 1000; y = rand(1) * 1000; z = rand(1) * 1000; points(k) = org.jzy3d.maths.Coord3d(x,y,z); end colormapper = org.jzy3d.colors.ColorMapper(org.jzy3d.colors.colormaps.ColorMapRainbow(),0,100); scatter = org.jzy3d.plot3d.primitives.MultiColorScatter(points,colormapper); chart = org.jzy3d.chart.Chart;

    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,

    • Yair Altman April 16, 2012 at 14:59 Reply

      @Patrick – I’m not exactly sure, but you can look at Malcolm Lidierth’s recent FEX submission 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.

    • Malcolm Lidierth April 16, 2012 at 17:57 Reply

      @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.

      • Patrick April 17, 2012 at 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.

Leave a Reply
HTML tags such as <b> or <i> are accepted.
Wrap code fragments inside <pre lang="matlab"> tags, like this:
<pre lang="matlab">
a = magic(3);
disp(sum(a))
</pre>
I reserve the right to edit/delete comments (read the site policies).
Not all comments will be answered. You can always email me (altmany at gmail) for private consulting.

Click here to cancel reply.

Useful links
  •  Email Yair Altman
  •  Subscribe to new posts (feed)
  •  Subscribe to new posts (reader)
  •  Subscribe to comments (feed)
 
Accelerating MATLAB Performance book
Recent Posts

Speeding-up builtin Matlab functions – part 3

Improving graphics interactivity

Interesting Matlab puzzle – analysis

Interesting Matlab puzzle

Undocumented plot marker types

Matlab toolstrip – part 9 (popup figures)

Matlab toolstrip – part 8 (galleries)

Matlab toolstrip – part 7 (selection controls)

Matlab toolstrip – part 6 (complex controls)

Matlab toolstrip – part 5 (icons)

Matlab toolstrip – part 4 (control customization)

Reverting axes controls in figure toolbar

Matlab toolstrip – part 3 (basic customization)

Matlab toolstrip – part 2 (ToolGroup App)

Matlab toolstrip – part 1

Categories
  • Desktop (45)
  • Figure window (59)
  • Guest bloggers (65)
  • GUI (165)
  • Handle graphics (84)
  • Hidden property (42)
  • Icons (15)
  • Java (174)
  • Listeners (22)
  • Memory (16)
  • Mex (13)
  • Presumed future risk (394)
    • High risk of breaking in future versions (100)
    • Low risk of breaking in future versions (160)
    • Medium risk of breaking in future versions (136)
  • Public presentation (6)
  • Semi-documented feature (10)
  • Semi-documented function (35)
  • Stock Matlab function (140)
  • Toolbox (10)
  • UI controls (52)
  • Uncategorized (13)
  • Undocumented feature (217)
  • Undocumented function (37)
Tags
AppDesigner (9) Callbacks (31) Compiler (10) Desktop (38) Donn Shull (10) Editor (8) Figure (19) FindJObj (27) GUI (141) GUIDE (8) Handle graphics (78) HG2 (34) Hidden property (51) HTML (26) Icons (9) Internal component (39) Java (178) JavaFrame (20) JIDE (19) JMI (8) Listener (17) Malcolm Lidierth (8) MCOS (11) Memory (13) Menubar (9) Mex (14) Optical illusion (11) Performance (78) Profiler (9) Pure Matlab (187) schema (7) schema.class (8) schema.prop (18) Semi-documented feature (6) Semi-documented function (33) Toolbar (14) Toolstrip (13) uicontrol (37) uifigure (8) UIInspect (12) uitable (6) uitools (20) Undocumented feature (187) Undocumented function (37) Undocumented property (20)
Recent Comments
Contact us
Captcha image for Custom Contact Forms plugin. You must type the numbers shown in the image
Undocumented Matlab © 2009 - Yair Altman
This website and Octahedron Ltd. are not affiliated with The MathWorks Inc.; MATLAB® is a registered trademark of The MathWorks Inc.
Scroll to top