export of scatter3 is rough
Show older comments
Figures of plot and scatter3 look very different. I get very fine figures in a programm using plot, getting the best version via 'save as eps' and then outside matlab 'export eps to tiff 600 dpi'. Another version of the programm uses scatter3 and the same export method shows very pixelised pictures, no real eps! Results of both programms have to have the same scale and 'hold on' in both works. The dots made by scatter3 alos look very bad. I attach a picture of the quality difference (scatter3 left, plot right). Files for some reason are 4658x3500 pixels. How to get better quality out of scatter3? I cannot find the proper controls.
Answers (2)
Cam Salzberger
on 23 Oct 2017
Edited: Cam Salzberger
on 23 Oct 2017
Hello Weia,
There is a limit on the size and complexity of an image that MATLAB can export to a true vector graphics format. If the figure is too complex, the image will be export as an EPS containing raster data.
print filename.tif -dtiff -r600
Testing first on a figure you've exported successfully with the original workflow, do the TIFF files turn out with a similar appearance?
-Cam
10 Comments
Weia Reinboud
on 23 Oct 2017
Weia Reinboud
on 31 Oct 2017
Cam Salzberger
on 31 Oct 2017
I'm not sure I understand what you're asking? You are wondering where the "print" line of code goes?
Once you have fully created your figure with all plots and everything formatted, then you call print on it. This allows you more control than using File -> Save As, since "Save As" sets some default options (like using screen resolution - 96 or 72 dpi - for raster data).
-Cam
Weia Reinboud
on 13 Nov 2017
Weia Reinboud
on 13 Nov 2017
Jan
on 13 Nov 2017
'Print' sounds like printing on a printer
Maybe it sounds so, but instead of guessing you could either trust Cam or read the documentation:
doc print
You will see, that print can create files. No, "Save As" is not exactly the same as print.
The terms "screen" "small " "double" do not clarify, what you are doing. "Save as" is predictable, but it matters, what you did with the figure before.
Weia Reinboud
on 13 Nov 2017
Weia Reinboud
on 13 Nov 2017
Cam Salzberger
on 13 Nov 2017
The print command is something you can run in the Command Window. I assume that you either ran the scatter3 command in the Command Window, or you created a script (a ".m" file) and ran that. You can do the same with the print command, either running it in the Command Window after you run the scatter3 command, or putting it in the script after the scatter3 command.
When you call the print command, it will create a file, filename.tif, in the Current Directory. If you don't know what the current directory is, you can check the Current Directory Browser (usually to the left side of the MATLAB window) or enter pwd in the Command Window.
That said, I highly recommend trying out the MATLAB Onramp course here. It's a short, free, online course that will give you the basics of MATLAB's interface, scripts, and functions, among other things.
I am not sure what program or method you are using to convert the EPS file to a TIFF file, so I couldn't tell you whether the reason for the difference lies with MATLAB's creation of the EPS file, or the other program's translation to TIFF. That is one reason I was recommending doing the creation directly to TIFF file from MATLAB, since that is likely to be more controlled, consistent, or at least reproducible.
Weia Reinboud
on 13 Nov 2017
Weia Reinboud
on 27 Nov 2017
0 votes
1 Comment
Cam Salzberger
on 27 Nov 2017
The marker sizes are based on pixel size, not figure window size. So when you make the figure window larger, it won't enlarge the sizes of the markers unless you specifically setup a callback to do this. This behavior is desirable when you produce a very crowded plot, and you want to make the window larger to space out the points and see what is going on better.
If you need markers that take up an exact amount of size in "data" units, you can simply draw them onto the plot with fill. You'll need to calculate the vertices around the border of the marker yourself though.
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!