How to label scatter point plots from data column in excel - excel

I have an Excel spreadsheet and I want to plot data from three columns: X, Y and L. The X and Y represent points I want to plot as a scatter plot, and L represents the label (point color, point symbol) that I want applied to each X, Y point. I see that How to plot points using their class labels? reports a solution for R, but I'd like one for Excel, if possible, preferably using UI rather than VBA. Thanks!

With Excel 2013 and later you can add data labels with the option "Value from Cells".
In earlier versions, you need to add each individual data label and give it the cell reference to the cell with the label (edit the label, type a = character, then click the cell with the label text).
This is tedious for charts with many values and can be sped up significantly with a free add-in by Rob Bovey, called the XY Chart Labeler, download here. The tool gives you a UI to insert and place labels.
Once the labels are in place, the file can be distributed to people who don't have the tool. It simply speeds up a manual process.

Related

Excel data representation, Axis labelling non-numeric

I wanted to display my data from my Excel spreadsheet graphically, in the form of a scatter chart.
I know that Excel can do this, but there is one "special feature" about my coordinate system of my graphic, and that is that one of the axes should be labeled with "words" (instead of numbers) to match my table similar to the picture. But I am not sure if Excel can process this at all, I guess that Excel can only work with numbers on the axes.
I would be very grateful for any help and tips and also alternatives!
By definition, the axes in an XY Scatter plot are numeric. But your desired chart can easily be created by adding a helper series to the plot. Assuming the current Y values for the other series are the numbers 1 to 6 for even positioning, you can use a range with Y values 1 to 6 and X values of zero and add that data range as a new series to the plot.
The plot points will sit right on the Y axis. Remove the Y axis labels in the Axis formatting options. You can then use data labels from the worksheet and position them to the left of the plot points of the helper series. Finally, format the markers of the helper series to have no fil and no line to make them invisible.

Use text as horizontal labels in Excel scatter plot

I am trying to make a scatter plot in Excel with text as horizontal axis labels.
I have the data
and I want a chart like this
The way I produced this chart was to have a scatter plot with numeric X values and numeric Y values, so instead of Poland I have X=1 and Y=10, Y=11, Y=12, and Y=9. For Germany I chose X=2 and Y=8 and Y=7. I just added some text boxes with the names to hide the numeric X values.
But I want this to be dynamic, so I tried to set the X value labels here:
but I am not able to change the horizontal values.
How can I solve this problem?
You need a helper series. Consider the following screenshot:
The blue dots are plotted from the data in the table on the left. The orange dots are plotted from the helper table. Each orange dot then has a data label assigned. Edit each data label individually, type a = character and click the cell that has the corresponding text.
This process can be automated with the free XY Chart Labeler add-in. Excel 2013 and newer has the option to include "Value from cells" in the data label dialog.
Format the data labels to your preferences and hide the original x axis labels.

How to draw line X=1?

I know how to draw a line with scatter plot options where X is the independent and Y the dependent variable.
In the scatter plot of that data I need to add another line: X=2. I have the following data:
But how to draw a line X=1 ?
Maybe you want something like this:
I hear that charting is more different than many other aspects of Excel between versions and that perhaps my version (Excel 2007) is one of the least ‘friendly’ hence some of the reason for “not very easy” but the principle is as #Bill the Lizard has described. In view of some weird behaviour with (my?) Excel 2007 however I recommend being careful about the sequence in which the lines are drawn.
First I suggest getting your chart right for all aspects but the green line. Then add another series with X values of 1 and 1 and Y=2 values of 10 and -2 (or whatever the limits are of your chosen y-axis as displayed). Select and copy that array (four cells) select your chart and Paste Special…, and Add cells as New Series, Columns, Categories (X Values) in First Column, OK.
This should add a vertical line of the same chart type as the existing (ie XY (Scatter) Scatter with Straight Lines and Markers). The colour can be changed, by selecting that series (click on it and Format Data Series…, Line Color etc) and presumably you would want the markers removed. It was these that for me at first refused to disappear to order – but persistence paid off. Click on either of the data points, and under Marker Options choose none for Marker Type. If necessary, repeat for the other data point – and keep repeating if required!
Also, I selected what was showing as Series3 (text) in the legend and deleted that.
Forgot to mention that for anything to do with Excel charts Jon Peltier is the ultimate authority (eg) and that an alternative approach is to use an error bar and a secondary vertical axis.

Multiple axis line chart in excel

I'm looking for a multiple axis line chart similar to the one in the image below, (which is a javascript chart made by amcharts).
Does excel have an option to draw charts line these? Note there are 3 Y axes, and 3 line charts allowing you to compare data.
Is it possible to get more than 3 data points, each with unique axis on one chart ?
It is possible to get both the primary and secondary axes on one side of the chart by designating the secondary axis for one of the series.
To get the primary axis on the right side with the secondary axis, you need to set to "High" the Axis Labels option in the Format Axis dialog box for the primary axis.
To get the secondary axis on the left side with the primary axis, you need to set to "Low" the Axis Labels option in the Format Axis dialog box for the secondary axis.
I know of no way to get a third set of axis labels on a single chart. You could fake in axis labels & ticks with text boxes and lines, but it would be hard to get everything aligned correctly.
The more feasible route is that suggested by zx8754: Create a second chart, turning off titles, left axes, etc. and lay it over the first chart. See my very crude mockup which hasn't been fine-tuned yet.
The picture you showd in the question is actually a chart made using JavaScript. It is actually very easy to plot multi-axis chart using JavaScript with the help of 3rd party libraries like HighChart.js or D3.js. Here I propose to use the Funfun Excel add-in which allows you to use JavaScript directly in Excel so you could plot chart like you've showed easily in Excel. Here I made an example using Funfun in Excel.
You could see in this chart you have one axis of Rainfall at the left side while two axis of Temperature and Sea-pressure level at the right side. This is also a combination of line chart and bar chart for different datasets. In this example, with the help of the Funfun add-in, I used HighChart.js to plot this chart.
Funfun also has an online editor in which you could test your JavaScript code with you data. You could check the detailed code of this example on the link below.
https://www.funfun.io/1/#/edit/5a43b416b848f771fbcdee2c
Edit: The content on the previous link has been changed so I posted a
new link here. The link below is the original link
https://www.funfun.io/1/#/edit/5a55dc978dfd67466879eb24
If you are satisfied with the result you achieved in the online editor, you could easily load the result into you Excel using the URL above. Of couse first you need to insert the Funfun add-in from Insert - My add-ins. Here are some screenshots showing how you could do this.
Disclosure: I'm a developer of Funfun
There is a way of displaying 3 Y axis see here.
Excel supports Secondary Axis, i.e. only 2 Y axis. Other way would be to chart the 3rd one separately, and overlay on top of the main chart.
An alternative is to normalize the data. Below are three sets of data with widely varying ranges. In the top chart you can see the variation in one series clearly, in another not so clearly, and the third not at all.
In the second range, I have adjusted the series names to include the data range, using this formula in cell C15 and copying it to D15:E15
=C2&" ("&MIN(C3:C9)&" to "&MAX(C3:C9)&")"
I have normalized the values in the data range using this formula in C15 and copying it to the entire range C16:E22
=100*(C3-MIN(C$3:C$9))/(MAX(C$3:C$9)-MIN(C$3:C$9))
In the second chart, you can see a pattern: all series have a low in January, rising to a high in March, and dropping to medium-low value in June or July.
You can modify the normalizing formula however you need:
=100*C3/MAX(C$3:C$9)
=C3/MAX(C$3:C$9)
=(C3-AVERAGE(C$3:C$9))/STDEV(C$3:C$9)
etc.
Taking the answer above as guidance;
I made an extra graph for "hours worked by month", then copy/special-pasted it as a 'linked picture' for use under my other graphs. in other words, I copy pasted my existing graphs over the linked picture made from my new graph with the new axis.. And because it is a linked picture it always updates.
Make it easy on yourself though, make sure you copy an existing graph to build your 'picture' graph - then delete the series or change the data source to what you need as an extra axis. That way you won't have to mess around resizing.
The results were not too bad considering what I wanted to achieve; basically a list of incident frequency bar graph, with a performance tread line, and then a solid 'backdrop' of hours worked.
Thanks to the guy above for the idea!
Best and Free ( maybe only) solution for this is google sheets.
i don't know whether it plots as u expected or not but certainly you can draw multiple axes.
Regards
keerthan

Excel - self adjusting chart marker

I have a series of line graphs in excel that is data over time.
There are several date milestones in the chart (I.E. Nov 24th: Black Friday)
On the chart I'm trying to put in an arrow on the chart with the label over the chart near the date. (See attached, below)
The problem is that these are manually added and as I expand the data in the chart (add another month of data) the chart compresses and my milestone markers have to all be hand repositioned.
How can I do these milestone markers so that I don't have to hand edit the table every time I expand the chart? A sample chart with a column for the desired labels can be found at this link.
As an added note, I'm using Office (Excel) 11 for Mac.
is it possible to use data labels for the milestones? There is a nice article about using a formula to make a custom data label:
http://chandoo.org/wp/2010/05/05/change-data-labels-in-charts/
Make your arrow and label outside the chart. Plot a new series with one point, with X corresponding to the date and Y determined appropriately (as I'll describe in a moment).
Copy the shapes you want to use as a milestone, select the point you added above, and paste (Ctrl+V).
Now adjust the Y value for this point so the milestone is where you want it.
This tutorial shows a similar approach:
Use an Arrow to Indicate Special Points

Resources