multiple legends in excel chart - excel

Is there a way in Excel to have 2 legends for a single chart?
I have an excel chart with many series. Let's take the following structure.
X AY1 AY2 BY1 BY2 CY1 CY2
1 2 3 4 5 6 7
3 11 2 5 23 45 65
X column represents the horizontal scale the rest of the columns represent the vertical scales. A, B and C are something like a category, and Y1 and Y2 are series for each category. Now, Y1 and Y2 have the same line style, no matter what category, but the category gives the color.
So in this example Y1 is dashed and Y2 is dotted. A is blue, B is red and C is green. This leads to:
AY1 - blue dashed, AY2 - blue dotted,
BY1 - red dashed, BY2 - red dotted,
CY1 - green dashed,CY2 - green dotted.
Currently my legend is AY1, AY2 and so on, with the dash style and color.
Because I can have more than 10 categories with more than 2 series for each of them, I will end up with a legend of no. of categories * no. of series, which is not necessary.
Instead I would like a legend like: Y1 - dashed, Y2 - dotted(each series line type only once) and then a legend with the color for each category( A- red, B - blue, C - green).
Is this possible in Excel?
Thanks!

Excel only does one legend per chart. Each series will have an entry in the legend. You can manually select a legend entry and delete it.
You could manually construct a text box or similar, and place that on the chart to achieve the effect you describe.
So, if I understand correctly, I'd add two dummy series to the chart with 0 values and assign them dashed and dotted respectively, with a neutral gray color. Then delete every series but the gray ones from the legend.
Then create a drawing with the colors for the real data series and place it on top of the chart as a secondary legend.
Edit: thinking about this a bit more, here is another approach. Use dummy series purely for the purpose of showing in the legend. Consider this screenshot:
Your original data table has been charted and the series have been formatted as to your instructions above.
Then another set of data was added to the chart as new series.
Y1 and Y2 have been formatted with gray and dashed / dotted respectively
A, B and C have been added with their respective colors.
The next step is to click, select and delete the legend entries for AY1, AY2 etc., and keep only the legend entries for the helper series. Finally, edit the source data for the helper series and set all data to 0 or 1, so nothing gets plotted in the chart. The result looks like this:
You could even change the chart type for the colored helper series to a dot, so the legend will show a dot instead of a line:

Related

Select data within the area of a series in Excel

Ok, so I have two data series graphed, like so.
These are two scatter plots, based on x and y values, that are produced using a combo chart. The orange scatter plot is an ellipse whose calculation is based upon aspects relating to the purple scatter plot. I have made the orange ellipse in order to... well... select the part of the purple scatter plot that I want to do other things with. Problem is, I don't know how to actually select the data points this area refers to.
The data for this chart is based upon four columns: A,B (forming the purple plot) and C,D (forming the orange plot). Reordering the columns makes little difference.
Implementing Anger's proposed solution below, all instances seem to return true. Also, there happen to be more scatter plot rows than there are ellipse rows, so I'm not sure how to solve that for the sake of comparison.
If you specify the equation of the ellipse (center point and semi-major/minor axes), you can use the equation of the ellipse to flag points that are inside or outside.
if( ((Ex-x)/Lx)^2+((Ey-y)/Ly)^2 < 1, "INSIDE", "OUTSIDE")
Where Ex, Ey are the coordinates of the ellipse's center; x, y are your data point's coordinates, and Lx, Ly are the semi-major and semi-minor axes.
Just by eye, I would say Ex = 1.8, Ey = 1.21, Lx = 0.6, and Ly = 0.5.

Match order color and legend in stacked chart with negative values excel

[Problem]
In a very simple stacked bar graph in excel (example data below), the colors of the positive part of the chart match with the legend (i.e. yellow upper and grey lower in both stacked bars and legend). However, for the negative values the legend is inverse to the actual order of the stacked bar (i.e. blue upper and orange lower in the staked bar but the opposite in the legend).
[Unsuccessful tries]
This is regardless of the actual data in the cells (changing the data doesn't change the colors or the order).
I've tried both changing the last parameter of the formula, and changing the order of the legend manually in the menu desing > select data > move up/down. None of them works, since it changes both the order of the stacked bars and the legends at the same time, so the order keeps unmatched.
[Question]
My question is, how can I match the order of the colors of the staked bars and the legend also for the negative part of the chart?
Example data:
1 -5
2 -1
3 1
4 5

Data points are not moving on the X Axis Scatter Plot in Excel

I have an excel scatter plot which is working for the Y axis but not the X Axis. If I change the Y values the data point moves accordingly. However, the X axis seems to be fixed in positions. The closest thing I can identify to logic is that the first number in the series is the X axis as 1, the next is 2, 3, 4, and so on
I would like (5.6,3) to show up at (5.6,3) not (1,3) because it's the first in the series.
Example for X axis theory:
Series
X ------ Y ------ graph placement
.6 ----- 3 ------ (1,3)
1.2 ---- 3.4 ---- (2,3.4)
.8 ----- 5.2 ---- (3,5.2)
notice the X coordinates 1,2,3 are moving sequential with their placement in the series.
Example for Y axis working:
(1.333,1) is placed at (3,1) on the plot. If I change it to (1.333,2) then it goes to (3,2). The X Axis changes do not move the point.
I give up. On the right is a chart that I think represents what you are seeing, driven by the data as shown which includes a single inverted comma I prefixed 1.333 with. On the left I overlaid an image of the chart I see without that inverted comma - and I think represents what you want:

How to force the uniformly distributed numerical tick marks on the horizontal axis x in Excel graph

I have the table with 2 rows, for simplicity
1 (should define horizontal axis):
0 0.03217 0.04119 0.09613 0.14178 0.17035 0.18824
2 (should define vertical axis):
86 81 80.8 73.8 69 65 63
I need to build a graph (line chart) with row No. 1 as horizontal axis and row No. 2 as vertical axis. The tick marks on the horizontal axis should be 0, 0.02, 0.04 and so forth.
So I select the data for horizontal axis from row 1 and the data for vertical axis from row 2.
However, when I try to format the X axis I do not get the options for any numerical formatting. The options start from Interval between tick marks and so forth.
The options for the vertical axis are completely fine
What can I do?
I assume you want to plot a line that connects your points (0,86), (0.0321,81) .... You should try using a scatter plot graph instead of a line chart.

Y-value on bar graph in gnuplot?

Can I get gnuplot to display the exact y-value or height of a data point (plotted using "with boxes") over its bar? I would like the plot to be easy to read so nobody has to line up the top of a bar with the y-axis and guess what the value is.
You can use the labels style and combine it into the plot command with the boxes style. The labels style expects 3 columns of data - the x coordinate, the y coordinate, and the actual label text.
For example, with the following data
1 4
2 6
3 2
4 8
the command (we set the yrange to 0 - 10 and boxwidth to 0.9 and set a solid fill style)
plot datafile u 1:2 with boxes, "" u 1:2:2 with labels offset char 0,1
produces
Normally, the labels would be centered on the specified point (the top edge of the box). By specifying an offset, we can move them up to just above the box. Here we used no offset in the x direction, but a unit of 1 in the y direction. We used the character coordinate system, so this corresponds to moving up by one character unit.
I can only think of putting the values where you want them "manually" like this:
set label "value" at 12,34
The numbers are coordinates according to your x and y ranges.
An automatic way would use "with labels", see e.g.
http://gnuplot.sourceforge.net/demo_4.4/stringvar.html

Resources