which format to choose in 'save graphics as' in mathematica - graphics

I want to use mathematica to make plots for the book I'm writing. I want to make a plot in mathematica, save it as picture, then import it in quarkxpress, and finally export it as pdf.
My question is which format is best to use? When I go to 'save graphics as' in mathematica I have variety of formats to chose (.jpeg, .png, .jpeg2000, .gif, .bmp)

If Quark had imported PDF, that would have your best bet. But apparently it doesn't. It handles transparency and other such things.
So for vector graphics use either EPS or, on Windows try WMF. If you do use WMF, beware of issues around WMF with BarChart and friends. See the workaround in the edit to this answer.
For raster graphics eg with textures, use PNG. This is the lightest weight of the raster type graphic format that I am aware of.

Related

Opening an EPS file in Inkscape causes weird line artifacts

I'm trying to edit a vector graphics file from Freepik. The format is EPS and after installing both Inkscape and Ghostscript on Windows, I'm able to open the file with Inkscape. However, Inkscape introduces some weird artifacts (see lines and wrong colors in the picture below).
Side by side comparison, original vector (left) and SVG saved after opening the EPS file in Inkscape (right)
Is there a way to fix this issue?
It's a little difficult to tell, partly because this is a complex illustration and partly because the rendering is a little small. I'd suggest that the circular artefacts are caused by radial fills not being rendered completely.
This could simply be a rendering problem with Inkscape, or it could be that the radial fill has an Extend parameter which isn't being honoured. It could also be a problem calculating a clip.
It's not entirely obvious what you used to render the left hand image, is that Ghostscript ?
Generally I'd say this looks like an Inkscape bug and you should report it as such.
Edit
Reading through the Inkscape FAQ it seems that Inkscape uses SVG as its native format. That's going to mean that an awful lot of PostScript (and PDF) vector objects aren't going to be represented well. Shadings will either have to be rendered to an image or converted into a complex series of SVG primitives.
Following the link on 'How to open EPS files in Windows' from the FAQ suggests to me that EPS files are either rendered to an image or converted to PDF.
You could use Ghostscript to convert the EPS to PDF yourself, and then try loading the PDF into Inkscape to see if you get a better result. You can also open the PDF in, say, Acrobat to see if it looks OK there.
If the PDF looks fine in Acrobat, but not so good in Inkscape, then I'd say that's an Inkscape problem. If the PDF looks poor in Acrobat then that's a Ghostscript problem.
You can then report the problem as a bug to the appropriate site.
It seems that EPS has more capabilities than SVG and that's why some stuff looks weird when converted to PDF/SVG. Specifically, highlights in an EPS file are not properly rendered in an SVG file.
I checked the conversion from EPS to PDF via Ghostscript and the lines are already there, i.e. it's not an Inkscape bug.
Here's the original file to reproduce the problem:
https://www.freepik.com/free-vector/data-processing-factory-isometric-technology_8625296.htm
And here's what it looks like after converting it to PDF: The artifacts are not as noticeable on the PDF file, possibly because Ghostscript converts it with a higher DPI by default
My workaround to be able to edit the file (remove the background) was to:
open the EPS with Inkscape, ungroup the items
delete the background
export it as PNG
then use the PNG as a "mask" on GIMP to edit the JPG file that came together with the EPS.

PNG images to SVG

I want to make a responsive website. Part of that is to enhance my graphics. I have a few PNG flat icons that I would like to convert to SVG but I have no knowledge about Illustrator or any other SVG editor. I've tried an online service called vector magic, but the results are not what I need.
What is the best way to convert my images to SVG?
You should try Illustrator to vectorize your images (there is a function to do this). There will never be a perfect result, so you'll have to correct imperfections.
Here is a link that explains how to do this. You'll have then to save your image in "save as" and change the ai filename (for illustrator) to svg.

Visio - Convert ".svg" to ".emf" format

My goal is to convert pictures from .svg format into .emf, remaining the size, resolution, etc!!
The best solution that I found was using Visio, because of the quality after conversion and also if I need to resize the pictures, they don’t lose quality.
Please check the picture that I am sending on the link.
This picture shows the appearance when I open a .svg file in Visio 2010. As you can see, the image is very clear and the limits well defined!
(picture. 1)
I have already fit the drawing to the page using this tip
(picture. 2)
To get the emf format I save this file as .emf format:
(picture. 3)
The quality is good when it is opened with Microsoft Picture Manager, but the problem is detectable when this picture is inserted on the software that I want to use. The .emf file looks well, but when I convert from svg to .emf, Visio inserts an invisible frame around the image, if I open this emf file with paint it looks like it is inserted 1 pixel size for all borders!
(picture. 4)
As you can see here, the size image from Visio should looks like this (Inkscape) but it’s inserted a frame like this:
(picture. 5)
(picture. 6)
Does anybody know how to get a solution to this, using either Visio or other software?
Please do the download of the files.
(Link is no longer valid.)
I appreciate all feedback.
Thank you for preparing so much for this question and providing the ZIP. It was a very thorough job.
I don't have definitive knowledge here but my experience is this is very common EMF which - as I understand it always require a bounding box to be stored in the file.
The only option I can think of is using another format for example EPS - but it depends on what the final program you are using supports. Exporting to a bitmap format works better for some applications - though it may not be desirable for your needs.
One solution would be to use inkscape to convert from svg to emf.
In the Inkscape GUI: Menu File -> Save As -> Select emf as Target
Or in the command line mode: inkscape -z src.svg -M target.emf

How to read a map into octave

This is a follow up to my post three weeks ago here How do I use m_map in octave, without really being a nuissance to kind and busy people. My problem is simply how does one overlay a basemap on an octave contour plot. After interpolating my irregularly spaced data (works for both contour lines and filled contours) I plot with the code:
contour(xi, yi, obsi, cstart:cstep:cend)
colorbar;
xlabel('Longitude'),ylabel('Latitude')
title('Mean Rain Onset')
saveas(gcf,'rainzam.pdf')
And I get
I have downloaded several map formats: ne_50m_admin_0_countries.zip, the apparently obsolete m_map (with associated tbase.Z, gshhg-bin-2.3.2.zip), soa.7z, world-bounds.7z, gshhg-gmt-2.3.2.tar.gz, dcw-gmt-1.1.1.tar.gz.
My question is has anyone used any of these maps in octave or gnuplot, and how to? I would appreciate any assistance.
Basically you have to load those maps in octave, they represent borders or coastlines with two variables (x,y) which you can then add to your plot with
hold on
plot(x,y)
That's the easy part, the hard part is to load the maps. All of them have different formats, which means it is a completely different story how to load them. For instance, the ne_50m_admin_0_countries.zip has a dbf format. Either you convert it first to ascii text and load it easily with the load function of octave or you need the OI package (http://wiki.octave.org/IO_package), which in turn demands java (http://wiki.octave.org/Java_package). I don't think this is the easy way for a newbie, so I suggest to convert the maps individually to text: google for "convert dbf to csv", "convert dbf to text", "convert dbf to ascii", etc... Perhaps some of those maps can be even loaded with excel and then saved as text (csv), the important issue is to convert them to text!
If you want to draw physical coastlines, you may download them from this link
https://www.naturalearthdata.com/downloads/
Then, after the drawing of a contour map of your own datas, you may add the coastlines using the following commands:
pkg load mapping
hold on
h = shapedraw ('FileName.shp','r','linewidth',1)

Extend Zedgraph to produce SVG

Is there any charting component that produce SVG chart?
I had work with Zedgraph, any idea how to extend Zedgraph to produce SVG/xml output?
ZedGraph by default does not produce vector formats. Even files saved in EPS format (there is such option in ZG) are in fact "fake EPS" - EPS file without vector information and with raster preview.
But you can overcome it by drawing on Metafile and then maybe you will be able to save it as SVG.

Resources