How does anyone know how to add numbers to data points of a scatter graph in Illustrator? I can make the scatter graph but I have no idea how to add numbers to the data like in the screen shot?
-
Make your own script to build the graph. Its just a for loop. Good 0 level exercise.– joojaaJun 10, 2016 at 9:35
-
Hey thanks for your resposne! I have no experience in building scripts whatsoever. Is there anywhere I can learn this or do you know about this kind of thing ?– Courtney HobbsJun 10, 2016 at 9:42
-
1Theres no need to use a script, you can just create a new graph design: helpx.adobe.com/illustrator/using/…– CaiJun 10, 2016 at 9:47
-
Hey Cai - thanks for weighing in. I have created the graph no problem I need to have the numbers on each green circle though. It seems a bit tedious to do it manually?– Courtney HobbsJun 10, 2016 at 10:05
-
@Cai its one step out, thus time to bring in the arsenal ;)– joojaaJun 10, 2016 at 10:31
3 Answers
Making your own scatter chart is not hard. While its not nesseserily worth doing on your own in a porduction setting, its one of those things, that is conceptually easy to do that works as a foundation. A good thing to know how to do as a halfway between stuff that is worth doing and can not had without doing a lot of work. So a good exercise to bridge the gap between challenging charting design and not so challenging ones.
Ok lets get started, you might want to start with a simpler example as your first exersise if this seems daunting. So you might go read these asnwers on GD.SE first:
- How to create a vector curve programmatically? Gives you a good foundational overview of the relevant approaches.
- Import vector data into illustrator Another good overwiew that talks about the 3 methods you could use. Note the import in question is a scatter graph of sorts.
Ok lets get cracking. I will be using EPS as it has the lowest common demonimator and is perhaps easiest to develop by a illustrator user. An eps constist of 3 parts header that defines the size of your document the commands and the end.
Just start typing into a eps file and once you have the basic pieces there you can drop as a linked file into illustrator. Illustrator will notice the changes and update your image as you go, which is a very good feature when developing your graph.
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 500 500
%%Title: Scattergraph Demo for GD.SE
%%Creator: Janne Ojala
%%CreationDate: 2017-05-03
%%EndComments
%Lets define how to draw your symbol marker
/SYMBOL { 3 dict begin /t exch def /y exch def /x exch def
0 0 0 1 setcmykcolor
x y newpath 4 0 360 arc fill
0 0 0 0 setcmykcolor
x t stringwidth pop 2 div sub y 1.5 sub moveto t show
end
} def
%Define font to use
/str 10 string def
/Helvetica findfont 5 scalefont setfont
10 10 (10) SYMBOL
%%EOF
Ok so now your data goes in like this:
posx_1 posy_1 text_1 SYMBOL
posx_2 posy_2 text_2 SYMBOL
...
posx_n posy_n text_n SYMBOL
But thats slightly unpractical. Altough you can just copypaste the data from excel and do a find and replace. But we can put this data in a list:
[
24 5 (A)
56 45 (B)
66 38 (C)
77 56 (D)
88 90 (E)
]
So its easier to input stuff finally:
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 200 200
%%Title: Scattergraph Demo for GD.SE
%%Creator: Janne Ojala
%%CreationDate: 2017-05-03
%%EndComments
%Lets define how to draw your symbol marker
/SYMBOL { 3 dict begin /t exch def /y exch def /x exch def
0 0 0 1 setcmykcolor
x y newpath 4 0 360 arc fill
0 0 0 0 setcmykcolor
x t stringwidth pop 2 div sub y 1.5 sub moveto t show
end
} def
%Define font to use
/Raleway-Black findfont 5 scalefont setfont
/DATA [
24 5 (A)
56 45 (B)
66 38 (C)
77 56 (D)
88 90 (E)
120 87 (F)
140 90 (G)
112 82 (H)
146 33 (I)
112 100 (J)
170 180 (K)
] def
DATA length 3 div 1 sub -1 0 {DATA exch 3 mul cvi 3 getinterval aload pop SYMBOL} for
%%EOF
Now just copy your data in the data section and put parentheses around last row. And here is what it looks like, tune to your hearts liking.
Just create a graph in Illustrator and then set the type to scatter, my advice is to copy paste the data into the data dialogue from Excel, you may have to create a second column that duplicates some of the data to set them as labels of each point to numbers. The other option would be to export the graph in Excel as a vector file, all depends on what your user case is for this particular task.
You can make a marker that includes a data code to put the data inside the marker.
Create a new marker design and add text inside it. The text must be %02 if you want n numbers (represented by the zero) and 2 decimals after the point if your data has decimals (represented by the two).
I found this in a YouTube video in this link: https://youtu.be/uLvjHeSki6Q
Hope it helps.