AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() ![]() We’ll get them all out and then delve into the SVG code. The nice example above came from Stata 14, but now let’s compare how different software writes out the same chart as SVG. However, you can write those SVG instructions in many ways. ![]() Also, SVG can be trimmed back to the bare essentials, while PDFs are full of weird and wonderful things that are not relevant to your chart (like the ability to store bookmarks, highlight text or digitally sign forms). You can see immediately that SVG is plain text (which is to say, some kind of ASCII / UTF-8 / Unicode text that you can read and indeed edit), whereas PDF is squashed down to a binary format. ![]() This is the reason why open data activists get furious when PDFs are dumped on a webpage by a government agency claiming to have fulfilled its open data obligations. And now the corresponding iris-stata.svg file: Let’s open iris_stata.pdf in a text editor: PDF is a vector format (although it can have embedded rasters) but isn’t human-readable. If you re-scale it (and of course, web browsers on other people’s computers do that all the time no matter what you tell them to do) then you get fuzz where it has to combine or interpolate pixels.Īdvantage two: you can read it, and edit it. bmp, which tells the computer that this pixel is blue and that pixel is red and so on. The alternative is raster graphics, like. Vector graphics are a series of instructions to the computer: put a line here and a circle there, etc. I’m going to use scatterplots throughout of Ronald Fisher’s classic iris data, sepal width vs sepal length.Īdvantage one: it’s a vector format, so you can rescale it and it doesn’t get fuzzy or pixelated. But there’s good SVG and not so good SVG, and I want to explore that a little here, while also hopefully winning over some new SVG fans. If there could only be one file format to save your charts in, it should be SVG. ![]()
0 Comments
Read More
Leave a Reply. |