charting trendlines together - excel

I need to display this kind of data in one chart:
Which means:
Function A: Y= X + 10 ;
Function B: Y= X * 2 ;
but what I got from excel is:
Actually what I want is (sorry for the drawing):
My real data is like:
If I format it like this:
I can still not get the correct charts.

Updated to account for change of question
Your data structure is wrong to achieve this in Excel, see for example:
On the left you want your x axis values, don't put a header in this column otherwise it will plotted on your graph as a series (extra line).
You can fill in gaps in your data with #N/A and excel will ignore these points, joining the line to the next available point.

Related

Excel Equation of line not correct

I'm hoping someone will be able to tell me why the equation that Excel generated is not giving the correct results as it is graphed correctly.
I have some X and Y points that I will list below. I plotted those points in Excel and then plotted the trend line, and had it show me the equation of the trendline. When I take the equation and then plug in the X values I get very different answers back.
X and Y Values
X Y
0 3
3 2
5 1.4
7 1
10 0.5
18 0.1
When I set the intercept to 3, the equation of the trendline is y = 0.0088x5 - 0.1457x4 + 0.8753x3 - 2.224x2 + 1.4798x + 3
Screenshot of Excel window with equation
Any help is greatly appreciated.
I suspect you didn't set up your graph correctly.
Select a single cell in your table
Insert/Scatter (and decide which you want with regard to markers, etc)
Select the line and add Trendline
Set you parameters for the trendline
If you want to get the formula for the trendline from the "show formula" option, be sure to format the trendline label to be numeric with 15 decimals. Otherwise the equation will certainly not work, even if it appears to be correct.
Note that you can obtain the formula directly using the LINEST worksheet function.
=LINEST(Y,X^{1,2,3,4,5}) returns the array:
{0.0000399230399230442,-0.00152188552188569,0.0192991822991846,-0.0840134680134806,-0.217128427128402,2.99999999999999}
The last value in the array is the y-intercept
The slight differences are due to the use of different algorithms for the two methods.

How to do an Arrhenius plot using excel-VBA? AKA: How to do a reciprocal x-axis in excel-VBA?

I want to write a program to transform temperature dependend data into an Arrhenius plot. An Arrhenius plot show the logarithm of a property that is thermally acitavted versus the reciprocal temperature aka 1/T. Now is 1/T something that most people are not used to. This is why most of the plot also contain the translation in temperature on a second axis. Usually on top of the graph. The output should look like this:
Picture Source
The second axis is only for better readability and is corresponds to the primary axis with the relation:
primary=1/secondary
secondary=1/primary
What I am not able to do in excel-VBA (excel 2010) is the reciprocal second x-axis. There is no predefined axis scaling like this. There is xlScaleLinear and xlScaleLogarithmic for the property ScaleType of an axis. Is there a way to do this?
A secondary problem is that this:
Dim CH As Chart
Set CH = Tabelle2.ChartObjects(1).Chart
CH.ChartType = xlXYScatterLinesNoMarkers
With CH
.HasAxis(xlCategory, xlSecondary) = True
End With
Does not seem to work. Which means that a xyScatterplot does not seem to have a secondaryXaxis enabled.
I could try to add the lables and ticks myself using forms but this seems a little to much pain, I cannot be the only one who has encountered this problem.
Problem 1: How to format an axis reciprocal (1/x)?
Problem 1b: How to properly add a second x axis in a XYscatterplot?
You can do this by creating a fake axis using a series with data labels (inspired by https://peltiertech.com/secondary-axes-that-work-proportional-scales/):
Columns A and B are your data. Column C matches the X-ticks of your primary X-axis. Column D is =1/C2 etc and column E is the y-axis maximum for your chart. Now simply create a new series of columns C and E, format it to have no line and in this case I chose the + marker but you can create your own vertical line marker if you want it to be exact. Then add data labels set to range column D.
I don't think you'll find another way to do it without this hack, but it's really not that hard and doesn't require VBA which is always a plus in terms of readability / audibility of your workbook.
Another alternative would be to use the data labels to write the actual temperature to the data points:
Column C has the temperature in Celsius.
Since the Arrhenius plot is only defined as ln(k) against 1/T, this would be a good option I think.

Excel - Line chart from date and time

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.

Excel scatter plot

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.

Importing XY coordinates from Excel to MatLab

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

Resources