Publication quality graphics in MATLAB

A Java based graphics package - "Project Waterloo" - is presently being developed to provide good quality anti-aliased graphics in any environment with a Java Virtual Machine available. It is open-source LGPL code that includes MATLAB OOP wrappers providing convenient support for MATLAB programmers.
This question is to ask for feedback from potential users: are there features missing that would make this package more attractive?
For example use in MATLAB, see
The project website with zipped builds and a GIT repo is at
Here are a few screenshots:

댓글 수: 3

H.A. Camp
H.A. Camp 2012년 12월 20일
I like the new shift-drag feature allowing selectable ROIs to be created. It currently appears that when you are shift-click dragging, you can only make the ROI larger. (In other words, if you try and make your ROI smaller before releasing the mouse, the rectangle remains at the largest dimensions that your mouse traversed.)
Is this intended, or will this eventually be made such that the final ROI will match the size designated by the initial shift-click point and the final mouse release position?
GUI-resizeable ROIs like Matlab's native imrect() would, of course, also be nice. :)
Malcolm Lidierth
Malcolm Lidierth 2012년 12월 21일
@HAC I see your point. I think that can be implemented.
Malcolm Lidierth
Malcolm Lidierth 2012년 12월 30일
@HAC - now implemented in the Git repo.
Regions of interest can be added using enter+left mouse (to highlight and area), shift+right mouse (to select and display a region) or by adding a GJRoi object to a graph. The GJRoi class provides imrect-style behaviour allowing the ROI to be moved/resized.
All ROIs are fully serialisable so will be restored when loading from a file saved with them in place on the original.

댓글을 달려면 로그인하십시오.

답변 (2개)

Image Analyst
Image Analyst 2012년 12월 30일

0 개 추천

  1. Can you give some advantages and disadvantages of using this over export_fig?
  2. When would you use Waterloo, and when would you use export_fig?
  3. Can you make bitmapped output images with arbitrarily large dimensions that you specify (i.e. more pixels than on your screen)?

댓글 수: 6

Malcolm Lidierth
Malcolm Lidierth 2012년 12월 30일
@IA
I have used, but not dug into export_fig in any detail. As I understand it, export_fig works by improving the quality of MATLAB generated graphics. Waterloo is not using MATLAB graphics at all, but painting using Java2D graphics with anti-aliasing etc activated from the start. Export to a vector format is done using Apache Batik - painting to e.g. an SVGCanvas instead of standard screen/print Graphics2D canvas. For clipboard export, (which supports SVG, PDF, PS and EPS) this is done in memory - and on a background thread so it's non-blocking.
While I have emphasised the GXFigure here and on Yair's blog, the GXFrame which is a JFrame under the hood, lets you draw without a MATLAB figure. Better liveliness then - but of course no way to include standard MATLAB graphics as in GXFigure.
Waterloo graphs can be fully serialised to a file and opened with the Graph Explorer bundled in Waterloo (no need for MATLAB - it's a standalone Java executable). They can be loaded in Java, Groovy, Scala, R, MATLAB and SciLab.
Bitmaps with arbitrarily large dimensions could be supported - but do you see a need for that with the vector outputs already available? Incidentally, while rendering speed has been a focus in writing this code, that has not been done at the expense of grouping lines/markers logically - they appear within logical groups/clipping masks in Illustrator or InkScape so the vector graphics can easily be edited.
ML
Image Analyst
Image Analyst 2012년 12월 30일
Personally I have not had a need for bitmaps larger than the screen, but I have seen it asked here many times and that is a shortcoming of export_fig.
Can you create your plot in MATLAB and then pass the axes handle or figure handle to Waterloo to save it as a file? Or do you have to pass it all your data and have Waterloo do both the plotting and saving?
@IA
Waterloo includes a MATLAB function:
SaveAsSVG(hFig,filename)
BUT - that just converts the Java2D primitive calls to SVG and it seems MATLAB is not using Java2D, except to paste in an offscreen bitmap so there is no gain in quality (except maybe for rendering of fonts - or GUIs that are rendered via Swing as Java2D graphics).
Matt J
Matt J 2012년 12월 30일
Personally I have not had a need for bitmaps larger than the screen, but I have seen it asked here many times and that is a shortcoming of export_fig.
Book publishers ask for 300 dpi images and 600 dpi line art which I've found to be a real pain to generate. This sounds like it would help
Malcolm Lidierth
Malcolm Lidierth 2012년 12월 31일
@Matt
Fixed dpi can be added to Waterloo. For MATLAB graphics an image processing tool would be probably be more appropriate as MATLAB is supplying the bitmap.
The GXFigure methods let you insert a function handle that exports the MATLAB graphics in the format of your choice (using e.g. export_fig) along with a MATLAB fig file and the Waterloo XML file. Java code like the Graph Explorer in Waterloo can load the exported MATLAB graphics when deserializing the XML file.
Malcolm Lidierth
Malcolm Lidierth 2013년 5월 19일
편집: Malcolm Lidierth 2013년 5월 19일
The Beta version of Waterloo now also supports output of vector graphics using the Processing visual language and also automatically generates HTML files allowing those graphics to be shown on an HTML canvas using ProcessingJS.
MATLAB graphics will still be bitmapped, but the HTML files might still be useful to some uses as they can be annotated using HTML5 or Processing. Details and a download of the relevant Java code are available without the rest of Waterloo: see http://waterloo.sourceforge.net/PDEGraphics2D/.
Use within MATLAB is pretty simple, e,g. to embed a MATLAB figure:
h=get(gcc, 'JavaFrame');
jhandle=h.getFigurePanelContainer();
s=kcl.waterloo.deploy.pde.PDEGraphics2D.paint(jhandle);
s.write('myFile');
An s.append() method allows animations to be created fairly simply e.g. if the figure is changed s.append(jhandle, 1000); will update the graphics on a website after a delay of 1s.
Using the default options, as here, the output will be in a folder named '/myFile' with the following contents:
  • myFile.pde: a Processing script file
  • myFile.html: a "plain" HTML5 file
  • index.html: a styled HTML5 file
  • PDEGraphics2D.css: the stylesheet
  • processing.js: copy of the required Javascript
  • httpd.py: a Python 2.7 script (only needed if the system browser will not allow direct viewing of files from the local file system)
  • /data: a folder with required images etc. (as PNG)

댓글을 달려면 로그인하십시오.

Rookshana Trollope
Rookshana Trollope 2014년 1월 17일

0 개 추천

Unfortunately this does not help me much. I have produced a Matlab scatter plot in 3D. I should see 7500 points X 2 (X,Y) and (X,Z). But the graphics looks like it has 200 points. I know there are multiple populations in my data and I want to high light this by the plot. But it looks real bad and one cannot see the multiple populations at all, let alone trying to fit regression lines to them. I can see the multiple populations on my other software in 2D only and I got Matlab to be able to see them in 3D.
Is there a Matlab graphics user that I can e-mail results to - To see what I mean and maybe can help ?

댓글 수: 2

Image Analyst
Image Analyst 2014년 1월 17일
Malcolm is your man. Did you click on his name and try to contact him that way?
Thanks IA. I have updated the broken image links above.
@Rookshana - the first of these is a cloud plot - code in the Git repo but not yet in the zip build. Waterloo is 2D only and this may not do what you need.Cloud is a minimalist scatter plot designed to be fast with lots of data points. I am not entirely sure what you are trying - would using transparency with a set of overlaid 2D plots achieve what you need (is the data 3D?)?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

질문:

2012년 12월 18일

댓글:

2014년 1월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by