Moving Points/Labels on a Graph

carpoto

New Member
Joined
Jun 8, 2009
Messages
43
I need to be able to declutter this graph (first one below). Ideally I would find a macro that would declutter it in one swoop, but I am not sure if this can be done easily. One way that if might be able to work is by checking each point against all other points, and if it is within .05 of another one, then bump every other point away from the origin so that there is space to see the point/label.

For example, in the bottom left of the graph you can see "Cairo" and "Camelia" are overlapping. I want them to be separated slightly as in the second image below. Note that I only fixed Cairo and Camelia, but I need a way to do this automatically for all the points on this graph and on other large graphs.) Also note, that I need the relative positions between each point generally preserved, although I don't need them anywhere near perfect, since that would be almost impossible.

Please help with your thoughts and/or code. Thanks a lot for taking the time to read this!


2888ob4.jpg


262xibk.jpg


Here is the list of data (I see that it doesn't format the columns properly, but you can get the idea):

Code:
		x	y
Cailin		-1.45	-0.30
Cacilia		-1.26	-0.55
Cadbury		-1.12	-0.24
C3P0		-1.05	-0.42
Cairo		-0.91	-0.92
Caprice		-0.86	-0.50
Calvina		-0.82	-0.38
Camelia		-0.71	-0.95
Captain		-0.64	-0.36
Calico		-0.60	-0.74
Caboodle	-0.55	-0.75
Cabo		-0.42	-1.13
Caesar		-0.37	1.30
Caramelo	-0.35	-0.49
Calypso		-0.34	0.01
Calloway	-0.23	-0.13
Carina		-0.19	0.11
Calrlino	-0.11	-0.46
Camille		-0.10	0.23
Camilla		-0.10	0.06
Cadence		-0.08	0.37
Caramba		-0.07	-0.32
Calamity		-0.06	-0.37
Carissa		-0.03	0.01
Cahil		-0.03	-0.44
Cagney		-0.03	-0.52
Callum		-0.02	0.05
California		-0.01	0.14
Cajun		-0.01	-0.37
Capo		0.03	0.18
Candy		0.04	-0.09
Callie		0.05	0.07
Caramel		0.07	0.04
Capricorn		0.07	0.10
Cammi		0.09	0.01
Cari		0.10	0.09
Caboose		0.10	1.01
Calvin		0.15	-0.05
Cain		0.15	0.34
Calvert		0.22	0.31
Caitlin		0.22	0.48
Cargo		0.26	0.11
Caddy		0.35	0.49
Camillo		0.36	0.28
Capone		0.38	0.02
Cap		0.40	-0.52
Camelot		0.43	-0.22
Cameo		0.50	-0.01
Cadet		0.50	0.00
Camus		0.53	1.26
Cadillac		0.55	0.26
Caribou		0.55	0.59
Calestina		0.56	1.09
Caper		0.70	0.13
Cambell		0.75	-0.13
Caliber		0.84	0.02
Cabaret		1.03	0.60
Canis		1.11	-0.01
Camembert		1.23	0.25
 
Last edited:

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top