0
$\begingroup$

Say I have the following data set.

enter image description here

I need to plot both in one graph and when I tried to do so this is what I got.

enter image description here

The data of A are not connected by a line so this is not what I want. How do I get the graph with both data sets connected by lines?Thanks

$\endgroup$
1
$\begingroup$

You need to change a setting in Excel's "Show empty cells as" options as follows:

1) Choose Select Data item (Click on the chart, then select Design tab in Chart Tools);

2) In the Select Data Source pop-up window, click on Hidden and Empty Cells button below;

3) In the Hidden and Empty Cell Settings pop-up window, select Connect data points with line (instead of the default Gaps).

Voilà! Enjoy the nice plot!

$\endgroup$
1
$\begingroup$

You can also use R for this:

ddf
  Grp X1 X2 X3 X4 X5
1   A  5 NA  6 NA  2
2   B  6  4  5  7  3

mm = melt(ddf, id='Grp')
mm
   Grp variable value
1    A       X1     5
2    B       X1     6
3    A       X2    NA
4    B       X2     4
...

ggplot(mm[!is.na(mm$value),], aes(x=variable, y=value, group=Grp, color=Grp))+geom_point()+geom_line()

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.