Create a graph in Excel - y variable is binary? - excel

I am trying to create a graph where:
X1 5 10 15 20
X2 10 20 25 30
Y 0 1 1 0
X1 is a minimum value of something, X2 the maximum, and Y the binary outcome--was my event true or not. In my head I picture it as a scatter plot where the horizontal axis is my min, the vertical my max, and there is a color coded dot that shows whether the event is true or not. I can't seem to create this.

I am not aware of a way to do this directly in Excel. As a workaround, you could sort your data by column Y. Then make a scatter plot of the the data where Y=0. Then you manually add the data where Y=1 as a second "series", i.e. right click the chart and click on Select Data, then on Add (Excel 2007).

Related

Data brushing in MS excel

I'm using MS Excel 2019 and I'm trying to copy only coordinates of specific selected data points in a scatter plot. Does anyone know whether this is possible. Any possible workaround if possible? My input to the Excel scatter plot are basically x and y coordinates in all 4 quadrants.
Data used:
x
y
-2
-10
39
-8
56
10
34
8
-89
-8
43
5
-9
4
45
3
67
-16
-87
-19
Scatter plot:
What I need is basically select specific points in the first quadrant as mentioned in the red circle from the Excel plot itself and export the selected data points value to separate table. The mouse pointer hover on each point shows its value, but I can't capture multiple data points value using mouse.
What about creating a helper column, which only allows coordinates in the first quadrant? You can achieve this, using following formulas:
in C2 : =IF(AND(A2>=0;B2>=0);A2;0)
in D2 : =IF(AND(A2>=0;B2>=0);B2;0)

Add horizontal axis per series in excel

How frustrating is Excel.. working on this for half an hour now.
I simply try to make a frequency plot of two groups, with different colours. On the x-axis I would like to display the subject.ids per bar.
However, if I select a different range for the horizontal x axis per series (series 1 = blue, series 2 = orange) with the subject id, it changes the x-axis in the other series to the same. What in hell am i doing wrong?
3007 1
23121 1
3009 1
3005 1
3011 2
23171 2
3207 2
3102 3
3207 6
13302 7
2411 11
23191 11
3008 11
3106 12
110031 1
110031 1
110030 1
110017 1
110014 1
110008 1
110004 1
110007 2
110035 4
110020 4
110003 4
110036 10
110019 11
110015 21
AFAIK, you cannot put 2 series onto the x axis.
You have 2 alternate ways to solve your problem:
Concatenate each positional pair into a new column and use this as the x-axis label series. It will look like this:
You could use data labels for each series. However, this will add the data to the columns themselves and not the axis (you could put it at the base of the column). To do so, you will need to right click on the graph, select 'Add Data Labels'. By default it adds the value as the label, but you can select the labels, right click to format the data labels and use the 'values from cells' option. Once you do this and play around with the orientation and location of the labels, it will look like this:
For simplicity, I'd go with the first method
Adding a 3rd option; simply put the columns for the axis labels beside each other and when selecting the Data for the Axis Labels, just select both columns instead of the usual 1. It will look like this:

I want to change the Y axis of a graphic (excel)

I want to modify to y axis in "image1" so that the values range from 0 to 7 rather than from 0 to 18.
I attach my example (image1) and an original example (image3)
thank you for your help
Image 1
Image 3
click on your graph. Select the Y axis. Set you min and max values to what you want instead of automatic.

Plotting Different values in a line in Excel

Scenario: I am trying to plot values in a line: I have Max, Min, lower bound 1, upper bound 1, median value and my "Ret" value (which will change at each row, and each row would have its own line "graph").Each of these data point (max, min, bounds...) do have a numerical value.
Problem: I already tried all the graphing options in excel, but can't seem to find any way to get the wanted outcome.
Question: Is there a direct way to do that in excel?
This is what I am trying to achieve (each row will have one of these graphs, once I find out how to do it, I will write a VBA macro to automate this):
Apparently, the best way to do this is to assign a second value to all the rows and instead of plotting as a single column of values, plot each row as a coordinate. This answer came as an advice from a user in another forum, to the same question posted here (goo.gl/icL38d).
For a sample data:
Value X Y
min -5 0
max 5 0
median 0 0
lowb1 -2 0
lowb2min -4 0
upb1 2 0
upb2 4 0
Target 3 0
I plotted this as a scatterplot with the coordinates, and configured the target data point to stand out. The result was very close to the originally intended one.

How to plot two scatter-plots on the same chart?

I have two series that overlay pretty close in time but not exactly. So I need to plot each series with the corresponding time component to get the match. Also the number of points is different, by a factor of 10.
How to plot two scatter-plots on the same plot using the time domain as the x-axis? eg
t1: 0.1 0.3 0.5 ...
y1: 3 7 9 ...
t2: 0.18 0.21 0.34 0.41 0.56 ...
y2: 32 55 4 7 1 ...
As you can see I can't just highlight all because the series don't match up so well in time.
If output something like this is what you want:
then it may be simplest to plot one series (say y1), select the Plot Area, Select Data... and add your second (y2) series.
It's also pretty easy to make the chart using the first range, then copy the X and Y values for the second series (hopefully it's in adjacent columns, but you can use Ctrl+Select to select multiple areas). Then select the chart, and use Paste Special to add the copied data as a new series, in columns, X values in first column.

Resources