Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing colour and shapes together in legend
    primarykey
    data
    text
    <p>What I am trying to do is plot a line chart that displays the comparative values amongst a few countries. The chart I get is:</p> <p><img src="https://i.stack.imgur.com/inkNu.jpg" alt="enter image description here"></p> <p>The problem here is that both shapes and colours are listed in the legend. I want the legend to be just a combination of the group(using shape) and colour for that country. I am using this bit:</p> <pre><code>ggplot(data=Data,aes(x=Indicator,y=Numeric,group=Country,shape=group,colour=Country))+geom_point()+geom_line() </code></pre> <p>The data is like this</p> <pre><code> Indicator Year Country Numeric data group 1 All causes 2008 Afghanistan 1663 3.22 Very Low 2 All causes 2008 Albania 518 8.53 Low 3 All causes 2008 Algeria 591 8.64 Low 4 All causes 2008 Andorra 310 21.25 High 5 All causes 2008 Angola 1685 10.08 Low 6 All causes 2008 Antigua and Barbuda 682 9.07 Low 7 All causes 2008 Argentina 553 14.38 Medium 8 All causes 2008 Armenia 864 6.62 Very Low 9 All causes 2008 Australia 278 16.76 Medium 10 All causes 2008 Austria 335 16.17 Medium 11 All causes 2008 Azerbaijan 918 4.54 Very Low 12 All causes 2008 Bahamas 629 16.80 Medium 13 All causes 2008 Bahrain 408 11.41 Low 14 All causes 2008 Belgium 369 15.10 Medium 15 All causes 2008 Brazil 667 5.86 Very Low 16 All causes 2008 Costa Rica 400 30.61 Very High 17 All causes 2008 Ivory Coast 2567 6.82 Very Low 18 All causes 2008 Marshall Islands 2681 19.46 High 19 All causes 2008 Netherlands 323 19.69 High 20 All causes 2008 New Zealand 312 19.56 High </code></pre> <p>Could someone point me to what could be done to achieve this? I can't really break this down even though I spent quite a long time on this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload