Lately I've been working on how to make my MATLAB figures article-quality, since normal output plots don't look that nice. The function export_fig from the File Exchange has done a lot of pretty things for me, but now I've come to a new challenge: making a high-quality 3-D plot.
I figured the best place to start looking is here, so my question is: how to make a good-looking 3-D plot using only MATLAB? And don't get me wrong, I know how to make a 3D plot, I just want my figures to be looking article-quality!
Any suggestions?
If you are satisfied with the figure's quality on screen, you can just save the figure in .eps fully-vectorized format. Then open it - on OSX I use the standard preview software - and save it as a light .jpg for the initial submission, and as .tiff, png or pdf depending on the journal requirements. preview can export an .eps at 600/1200 pixels per inch, compressed or not, and cropping is easily done with a mouse. A minor point: vectorized exported figures do not render unfamiliar fonts.
Here is an example from matlab, exported as .eps and saved as .png 400 ppi.
try enabling handle graphics 2 if you are on one of the later versions of Matlab. Use
-hgVersion 2 startup switch in your Matlab command-line.
Related
I wonder why I have a very bad rendering when I use the Painters custom renderer in figure Export Setup?
Look at this image which has used OpenGL:
and this one, which has used Painters.
What the hell is going on here?
There's a bug in 2014b-2015a. The easiest way to fix this is to upgrade to 2015b or newer.
I had a workaround where I used matlab2tikz but that took a bit of work for my application.
I don't believe there to be a workaround that can create .png files from Matlab that works on those versions of Matlab (even export_fig has the same problem).
I have plotted a 3-dimension figure which is the 3-D cloud water content from a Cloud Resolving Model. I would like to save it and preserve the image information that I can rotate it along different direction after I have saved it. I know it's possible to save it as format fig in Matlab and do what I want only using Matlab to open it. Is any other format of image that can do the same thing with open Matlab?
Actually I am not familiar with this part and not sure what's key word is more about this question.
Export figure to 3D interactive PDF
using this plugin it is possible to save a 3d figure as a U3D file and embed it into a pdf
I'm creating a table to put in an image. when I save a pdf. file (or png for that matter), the plots have nice quality but the table is supper bad (see image 1, a close up). It looks fine on matlab (image2)
How can I overcome this?
I wrote some code at home to plot some 3D-data. It worked fine. Now I ran the same code at the office and I got some weird bug. It seems that there is a label for each data point inserted.
But this only happens on half of the plots. The left plot shows the real data and the right one is just a smoothed fit of this data. The left one gets the error and the right one doesn't.
I ran the code on the machine of a colleague and it worked fine too. So I saved the clean figure files on his machine and tried to open them on my PC. Still the same bug. So it's not the code but seems to be some weird displaying bug.
Did anyone see this before?
figure(1);
s1=gca;
surf(t_matrix,f_matrix,alpha_matrix)
colorbar
figure(2);
s2=gca;
surf(t_matrix2,f_matrix2,alpha_matrix2)
colorbar
It's just this code. And if I debug, the numbers appear after the first call to colorbar. But not in the second case. My Matlab version at home is 2013a, but at the office and that from my colleague are both 2012b.
This seems to be a bug. There is a thread on MATLAB Answers.
The accepted answer there by Jan Simon is
This could be cause by the OpenGL driver. Did you install the newest
drivers of your graphics cards?
Workaround might be:
set(gcf, 'renderer', 'zbuffer');
or if OpenGL looks nicer:
opengl software
or perhaps:
opengl hardware
Look for "OpenGL" in the documentation to find a bunch of switches to
consider a bunch of driver bugs.
Actually the zbuffer renderer works fine but is not enough in some cases.
I often use to work with transparent surface plot using the gca property facealpha set to 0.5 in order to superpose a contour plot to it. Face or edge alpha settings (maybe some other plot properties) are only correctly displayed with the Opengl renderer. The zbuffer cannot picture transparent surface plot.
The main issue first came to my attention when I recently switched to Win8. Bloody $Bill 'HamsterWhy' Gate.
A patch from Mathworks would be greatly appreciated.
I want to draw different 2D objects in OpenGL for example a path/Road ,is there any program i could draw them using a GUI then transfer them to points so i could use them in my program ?
I have personally used Inkscape to do this. If you save your data as SVG, then any standard XML parsing library should make it relatively easy to extract your data. Even better, you might even find an SVG parsing library that will make it even easier. I created one in Python, based on the work of Martin O'Leary of supereffective:
http://pypi.python.org/pypi/svgbatch
It's very fragile and incomplete (it barfs on svg elements it doesn't recognise) but if you stick to the SVG elements it recognises (closed polygon paths, no curves) then it works, and it might help you put together one of your own.
Somewhat heavy handed, but you could use Inkscape to create SVG files, and then just parse out the path vertexes.