Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • graph bar add dot on right axis

    Dear all,

    In the following graph bar I want to add as a dot or dash the carg variable, and because of its relative small size I would like it to appear on the right axis.

    Is this possible with graph bar or I must follow a different alternative? I've tried unsuccessfully with twoway bar.

    Any suggestion is more than welcome.

    Regards,
    Nikos

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float group double(y11 y12 sort y21 y22) float cagr str2 geo
    4  130.47      .  156.99  156.99      .   3.770107 "AL"
    .       .      .       .       .      .          . "AT"
    3  1387.5      . 1501.82 1501.82      .  1.5960863 "BE"
    1  122.71      .  184.07  184.07      .   8.447766 "BG"
    .       .      .       .       .      .          . "CH"
    .       .      .       .       .      .          . "CY"
    1  302.19      .  331.71  331.71      .  1.8815856 "CZ"
    .       .      .    1440    1440      .          . "DE"
    .       .      .       .       .      .          . "DK"
    1  278.02      .     390     390      .   7.003434 "EE"
    2       . 862.82  683.76       . 683.76 -4.5454364 "EL"
    2  738.85      .   756.7   756.7      .   .4785806 "ES"
    .       .      .       .       .      .          . "FI"
    3 1343.77      . 1457.52 1457.52      .  1.6384226 "FR"
    1  385.48      .  395.61  395.61      .   .5201394 "HR"
    1   271.8      .  332.76  332.76      .   4.130111 "HU"
    3 1461.85      . 1461.85 1461.85      .          0 "IE"
    .       .      .       .       .      .          . "IS"
    .       .      .       .       .      .          . "IT"
    1   231.7      .     300     300      .   5.302588 "LT"
    3 1682.76      . 1922.96 1922.96      .   2.704533 "LU"
    1  253.77      .     360     360      .   7.243862 "LV"
    4       .      .  288.05  288.05      .          . "ME"
    4       .      .  213.72  213.72      .          . "MK"
    2  659.92      .  720.46  720.46      .  1.7709237 "MT"
    3  1407.6      .  1501.8  1501.8      .   1.303994 "NL"
    .       .      .       .       .      .          . "NO"
    1  320.87      .  409.53  409.53      .   5.000489 "PL"
    2  554.17      .  589.17  589.17      .  1.2323976 "PT"
    1  141.63      .   217.5   217.5      .   8.958421 "RO"
    4  222.37      .  235.04  235.04      .   1.114425 "RS"
    .       .      .       .       .      .          . "SE"
    2  597.43      .  790.73  790.73      .   5.766526 "SI"
    1   307.7      .     380     380      .   4.311267 "SK"
    4  338.33      .  424.26  424.26      .  4.6305037 "TR"
    4 1076.46      . 1378.87 1378.87      .   5.076376 "UK"
    4  872.32      . 1035.06 1035.06      .   3.480362 "US"
    end
    
    graph bar (mean) y11 (mean) y21 (mean) y12 (mean) y22 , ///
        over(geo,sort(sort) label(labsize(small) angle(90))) ///
        over(group, gap(*2) label(nolabel)) ///
        ylabel(,labsize(small) angle(hor)) ///
        ytitle("") ///
        bar(1,color(navy)) bar(2, color(maroon)) ///
        bar(3,color("forest_green")) bar(4, color("dkorange")) ///
        nofill legend(col(4) order(1 "2000" 2 "2020"))
Working...
X