Hello and good day to all
I have question related to excel graph. I have some set of values like this
Now I want to plot these values as a scatter graph. I want to to draw in such a way that by keeping X values same and 4 different Y plots i.e. A, B, C, D in a single graph. Meaning I dont want to merge these Y values on a single X value. Is there any way to do that? I thank you for your time and help.
The data does not make much sense. All X values are exactly the same, so all data markers will be at exactly the same X position.
To create a scatter chart with multiple series:
- select the data from A1 to B11
- insert a scatter chart
- select the B, C, D ranges (C1 to E11) and copy
- select the chart and use Paste Special > insert as new series with series name in first row
Since all X values are the same, many data points overlap and are not distinguishable.
Edit after comment: if you do NOT want to plot the values at their true X position (i.e. the value 1.4), then use four pairs of X / Y coordinates. Use X values 1 to 4 with A to D. Then use text boxes to replace the X axis labels or hide the labels and show the legend instead.
Related
I have a 3 column table named 'A' from which I want to plot a heatmap or scatter plot where I can see a colour for the coordinates indicated by the first two columns. For example, at row 'A91552' and column 's_4_AAGCTA' I want to see a colour corresponding to 0.47619.
Example data:
'A91552' 's_4_AAGCTA' 0.476190000000000
'A91554' 's_4_CCTATT' 0.476190000000000
's_4_AAGCTA' 'A91552' 0.476190000000000
's_4_CCTATT' 'A91554' 0.476190000000000
Is there a way to do this directly using the strings as indices, or will I need to make a double matrix and change the axis labels on something like imagesc?
Found it:
I just needed to convert my lists of strings to categorical variables:
scatter(categorical(A.Var1), categorical(A.Var2), 125, A.Var3, 'filled')
How can I make line chart from this data?
Two lines
X values = time
Y valies = number
This is just small sample of data (I have more than 30 day).
(I use Excel 2016)
Thanks
Make sure your X-axis is the first column and your Y axis is your 2, 3, 4, etc column
Highlight you data that you want to work with, minimum two column.
Find your Insert Ribbon
Select Insert Chart about halfway across and and make sure you select the line one. (Personally I would use and XY scatter plot with lines)
In your case where you have X, Y , X, Y as the sequence of your column, I would edit your data series afterwards to eliminate the series which are really your second X values. Then go to your subsequent Y values, edit their series, and select a new X series for each.
Its usually much easier if you place all your X data in one column, and each Y series in its own column making sure it lines up with the appropriate X data.
I want to create an automated scatter plot. This is the first example table based on the step size I end up measuring A, B, C, D for a specific frequency. In this scatter plot I created manually you can see I want to plot C v/s A for a particular frequency.
But I need to do this automatically as based on the step size the number of row can change. Here, since the step size decreased the number of samples increased, and now the scatter plot needs to update number of A and C values it plots.
Is there a formula I can use without using any macros?
The relation between the step size and frequency is (number of samples of a single frequency = (360/step size)) so for a step size of 60 you will have in reality six entries of frequency 100 and six of 200 .
You can use formulas to define chart ranges if you hide the formulas in named ranges. Combine that with the fact that #N/A values are not plotted and you can get this to work without VBA.
For your example graph you could define two names ranges as follows:
Name: A_100
Refers To: =IF(Sheet1!$E$3:$E$100=100,OFFSET(Sheet1!$A$3,0,0,360/Sheet1!$B$1,1),NA())
and
Name: C_100
Refers To: =IF(Sheet1!$E$3:$E$100=100,OFFSET(Sheet1!$C$3,0,0,360/Sheet1!$B$1,1),NA())
Then set the X and Y axis of the chart to SheetName!A_100 and SheetName!C_100
The if statement filters out all the points not at frequency 100, if you have a formula for selecting the frequency replace "Sheet1!$E$3:$E$100=100" with that.
The offset function takes the first cell in the column and expands the number of rows according to your 360/step size formula.
I want to do something like this
I want to make a point x,y coordinate for one and x,y for another and show two points in a single scatter chart.
I am unable to figure out how to do this
x y x2 y2
1 1 1 8
From data above I need to show two points (1,1) and (1,8)
Depending on your data layout, the data points can be added as one series or as two series. Steps vary with your Excel version.
Try this: click an empty cell that has no data in neighbor cells. Click Insert > XY Scatter chart. This will create a blank XY chart. Now add the series.
Right-click the chart > Select Data > Add > select the range(s) for the X and Y values. Repeat for any other series.
If the data is in one contiguous table, you only need one series.
I have imported my XY data (in the same excel worksheet) to matlab with all the X and Y coordinates in separate columns ('FHC'), X is in column b and Y in c. I want to plot these using using k-means.
I got stuck cause I don't like to plot all the coordinates, I like to include the first 10, skip 2 cells and then include the next 10 ect.I tried to specify cells like this (b2:b12,1);(c2:c12,2), it exceeds matrix dimensions?
How can I tell matlab from what cell to what other cell that I want it to include, possibly tell it to skip some cells in between? My code looks like this at the moment (but now it plots all the X's and all the Y's);
X =['FHC',(:,1);(:,2)] %written differently
opts = statset('Display','final');
[idx,ctrs,sumd,D] = kmeans(X,1,...
plot(X(idx==1,1),X(idx==1,2),'r.','MarkerSize',12)
hold on
plot(ctrs(:,1),ctrs(:,2),'ko',...
legend('Cluster 1','Centroid',...
If X and Y are cells then try this:
%if X is a n by 2 cell array
hold on
for ii=1:2:length(X)
plot(X{ii,1}(1:10),X{ii,2}(1:10),'r.','MarkerSize',12);
end
hold off