Stata graphs can be exported to scalable vector graphics (SVG) format
SVG is used on webpages and in EPUB ebook documents
SVG is a modern alternative to EPS
Compatible with all major modern web browsers, including mobile browsers
Supports transparency
Specify width and height of image
Editable with vector graphics applications and text editors
Support for compact and verbose SVG
Options for rendering as closely to what Stata displays (albeit at possible expense of compatibility)
In Stata, graphs can be exported to scalable vector graphics (SVG) format.
All modern web browsers support SVG. Vector graphics editors such as Adobe Illustrator and Inkscape also support SVG.
SVG images are popular because they can be scaled without loss of image quality, unlike PNG and JPEG files. Thus, SVG images are popular when the same image will be displayed at different sizes and resolutions, such as on webpages or ebooks.
Stata also supports encapsulated PostScript (EPS)—another scalable vector graphics format—but EPS files are not suitable for use on webpages or ebooks, nor do they support transparency.
SVG images can be imported by other applications such as Microsoft Word, but the PDF format works just as well (and does support transparency).
Stata exports compact SVG files by default and optionally exports verbose SVG files that are easier to edit with a text editor.
Exporting to .svg format is easy. Draw a graph by typing
. sysuse uslifeexp2, clear . twoway connected le year
To export the image, type
. graph export uslifeexp.svg (file uslifeexp.svg written in SVG format)
The graph we showed you on this page is in SVG format. The SVG format is XML-based, which makes it editable by a text editor. Take a look.
Learn more about Stata's publication-quality graphics features.
See [G-2] graph export in the Graphics Reference Manual.
Learn
Free webinars
NetCourses
Classroom and web training
Organizational training
Video tutorials
Third-party courses
Web resources
Teaching with Stata
© Copyright 1996–2024 StataCorp LLC. All rights reserved.
×
We use cookies to ensure that we give you the best experience on our website—to enhance site navigation, to analyze usage, and to assist in our marketing efforts. By continuing to use our site, you consent to the storing of cookies on your device and agree to delivery of content, including web fonts and JavaScript, from third party web services.
Cookie Settings
Last updated: 16 November 2022
StataCorp LLC (StataCorp) strives to provide our users with exceptional products and services. To do so, we must collect personal information from you. This information is necessary to conduct business with our existing and potential customers. We collect and use this information only where we may legally do so. This policy explains what personal information we collect, how we use it, and what rights you have to that information.
These cookies are essential for our website to function and do not store any personally identifiable information. These cookies cannot be disabled.
This website uses cookies to provide you with a better user experience. A cookie is a small piece of data our website stores on a site visitor's hard drive and accesses each time you visit so we can improve your access to our site, better understand how you use our site, and serve you content that may be of interest to you. For instance, we store a cookie when you log in to our shopping cart so that we can maintain your shopping cart should you not complete checkout. These cookies do not directly store your personal information, but they do support the ability to uniquely identify your internet browser and device.
Please note: Clearing your browser cookies at any time will undo preferences saved here. The option selected here will apply only to the device you are currently using.