Announcement

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

  • #16
    Dear Nick Cox ,

    This helped a lot. Thank you so much,

    Best,

    Comment


    • #17
      Dear Nick Cox,

      It really helped a lot.
      Thank you so much,

      Best,

      Comment


      • #18
        Dear Nick Cox,

        Is there any option for creating a palette for tabplot? I open the graph editor and change colors manually, but there might be an option for creating a palette automatically. I mean some alternative options like adding a phrase "palette (grey)", or "palette(blue)". I provided an example of tabplot. Columns are the share of LDCs aid for different donors.

        Thank you so much,

        palette.gph

        Best,

        Code:
        * Example generated by -dataex-. For more info, type help dataex
        clear
        input float(year LDCs) str14 Countries float order
        2000 30.232893 "Germany"        6
        2001 25.917334 "Germany"        6
        2002 28.469126 "Germany"        6
        2003  43.58406 "Germany"        6
        2004  30.15125 "Germany"        6
        2005 15.118473 "Germany"        6
        2006  20.68371 "Germany"        6
        2007 18.648623 "Germany"        6
        2008 23.767405 "Germany"        6
        2009 32.217255 "Germany"        6
        2010 33.625183 "Germany"        6
        2011  30.40704 "Germany"        6
        2012  40.28268 "Germany"        6
        2013 28.564846 "Germany"        6
        2014   28.1714 "Germany"        6
        2015 20.390823 "Germany"        6
        2016 21.849823 "Germany"        6
        2017  22.81828 "Germany"        6
        2018   23.7907 "Germany"        6
        2019  26.16715 "Germany"        6
        2020  27.31757 "Germany"        6
        2000  42.83992 "Sweden"         2
        2001  45.58241 "Sweden"         2
        2002  49.30732 "Sweden"         2
        2003  57.90004 "Sweden"         2
        2004  51.52776 "Sweden"         2
        2005  50.12654 "Sweden"         2
        2006  43.23513 "Sweden"         2
        2007  49.68056 "Sweden"         2
        2008  56.08988 "Sweden"         2
        2009  54.51183 "Sweden"         2
        2010  57.03756 "Sweden"         2
        2011  62.12764 "Sweden"         2
        2012  57.97434 "Sweden"         2
        2013  59.06275 "Sweden"         2
        2014  57.54663 "Sweden"         2
        2015  61.02678 "Sweden"         2
        2016  58.35527 "Sweden"         2
        2017  60.51909 "Sweden"         2
        2018  61.78416 "Sweden"         2
        2019  60.79265 "Sweden"         2
        2020  59.94068 "Sweden"         2
        2000  51.36977 "United Kingdom" 3
        2001  55.43752 "United Kingdom" 3
        2002  33.34108 "United Kingdom" 3
        2003  48.53104 "United Kingdom" 3
        2004  52.88842 "United Kingdom" 3
        2005  25.37643 "United Kingdom" 3
        2006 29.219923 "United Kingdom" 3
        2007  52.69433 "United Kingdom" 3
        2008  47.48095 "United Kingdom" 3
        2009  52.48061 "United Kingdom" 3
        2010  51.18636 "United Kingdom" 3
        2011  60.50794 "United Kingdom" 3
        2012  53.78049 "United Kingdom" 3
        2013  52.19427 "United Kingdom" 3
        2014  54.24137 "United Kingdom" 3
        2015  52.36971 "United Kingdom" 3
        2016  45.98543 "United Kingdom" 3
        2017  48.58173 "United Kingdom" 3
        2018  49.53138 "United Kingdom" 3
        2019  49.18954 "United Kingdom" 3
        2020  48.97427 "United Kingdom" 3
        2000 36.415016 "France"         5
        2001 32.986443 "France"         5
        2002  35.58469 "France"         5
        2003  52.20604 "France"         5
        2004  53.00074 "France"         5
        2005 16.833872 "France"         5
        2006  18.77561 "France"         5
        2007  25.97499 "France"         5
        2008   25.3309 "France"         5
        2009  19.99389 "France"         5
        2010 23.538923 "France"         5
        2011 33.041714 "France"         5
        2012  20.27051 "France"         5
        2013 32.322308 "France"         5
        2014   25.2365 "France"         5
        2015 28.771784 "France"         5
        2016  22.85074 "France"         5
        2017  22.45409 "France"         5
        2018  24.62164 "France"         5
        2019  29.09955 "France"         5
        2020   28.5767 "France"         5
        2000  42.43555 "Netherlands"    1
        2001  39.98439 "Netherlands"    1
        2002  48.09439 "Netherlands"    1
        2003  52.93964 "Netherlands"    1
        2004  50.13655 "Netherlands"    1
        2005  41.65446 "Netherlands"    1
        2006  46.61037 "Netherlands"    1
        2007  50.45172 "Netherlands"    1
        2008   57.9992 "Netherlands"    1
        2009  54.92713 "Netherlands"    1
        2010  67.77497 "Netherlands"    1
        2011  59.83043 "Netherlands"    1
        2012  65.90963 "Netherlands"    1
        2013 70.436356 "Netherlands"    1
        2014  70.38336 "Netherlands"    1
        2015   58.5201 "Netherlands"    1
        end
        label values order order
        label def order 1 "Netherlands", modify
        label def order 2 "Sweden", modify
        label def order 3 "United Kingdom", modify
        label def order 5 "France", modify
        label def order 6 "Germany", modify
        ------------------ copy up to and including the previous line ------------------

        Listed 100 out of 126 observations
        Use the count() option to list more

        Code:
        myaxis order=Countries, sort(sum LDCs) descending
        local xopts xla(2002(4)2020) xtitle("")
        local xopts2 xla(2002(4)2020, format(%tyYY)) xtitle("")
        tabplot order year [iw=LDCs], showval(format(%1.0f)) xasis `xopts' ytitle("") separate(Countries) barw(0.9) name(percent3, replace)
        Attached Files
        Last edited by Nihat Mugurtay; 13 Jul 2022, 13:21.

        Comment


        • #19
          #19 Sorry, but I don't understand this question

          There isn't an option in tabplot (Stata Journal) called palette() and I don't follow what your putative option would do in any case. The example graph shows several colours, not one. If you want several colours, and default colours are no good, you need to spell out what they should be.

          For a better answer, please post explaining what you want in more detail. Graphics attachments should be in .png as explained at https://www.statalist.org/forums/help#stata 12.4 and 12.5.

          Comment


          • #20
            Dear Nick Cox,

            Stata throws an error while using Fabplot. The error code is "r(498)", telling that "value labels order already exist; specify new name?". Here, I provide some of my data and the error that I get.

            Code:
            * Example generated by -dataex-. For more info, type help dataex
            clear
            input str10 newregion float year double chnodalilike
            "Asia"       2000        1113800.692
            "Asia"       2001       2446247.1429
            "Asia"       2002 15609533.865999999
            "Asia"       2003 14994850.207600001
            "Asia"       2004 63438647.712000005
            "Asia"       2005 48972181.274000004
            "Asia"       2006 23126810.726999998
            "Asia"       2007    21895556.600806
            "Asia"       2008 29639952.508500002
            "Asia"       2009       8707406.3421
            "Asia"       2010       7221741.0809
            "Asia"       2011       17174933.482
            "Asia"       2012         694219.011
            "Asia"       2013                  0
            "Asia"       2014       2568094.9339
            "Asia"       2015 28730809.968900003
            "Asia"       2016  45765568.90857001
            "Asia"       2017      88572699.2669
            "Asia"       2018                  .
            "Asia"       2019                  .
            "Asia"       2020                  .
            "Europe"     2000        2673121.661
            "Europe"     2001                  .
            "Europe"     2002                  .
            "Europe"     2003        1374388.096
            "Europe"     2004  5955134.265000001
            "Europe"     2005 2324775.1299900003
            "Europe"     2006                  .
            "Europe"     2007                  0
            "Europe"     2008                  .
            "Europe"     2009                  0
            "Europe"     2010      1232805.81811
            "Europe"     2011        1652099.381
            "Europe"     2012        80723.14082
            "Europe"     2013                  .
            "Europe"     2014                  .
            "Europe"     2015        1564194.278
            "Europe"     2016       1691729.0647
            "Europe"     2017 5154237.1197999995
            "Europe"     2018                  .
            "Europe"     2019                  .
            "Europe"     2020                  .
            "MENA"       2000                  0
            "MENA"       2001                  .
            "MENA"       2002                  0
            "MENA"       2003        1277285.299
            "MENA"       2004       61697346.447
            "MENA"       2005                  0
            "MENA"       2006                  .
            "MENA"       2007  801245.9588199999
            "MENA"       2008                  0
            "MENA"       2009         1811110.22
            "MENA"       2010        57136569.95
            "MENA"       2011                  .
            "MENA"       2012                  0
            "MENA"       2013                  0
            "MENA"       2014                  0
            "MENA"       2015                  0
            "MENA"       2016       17897466.925
            "MENA"       2017        29596978.97
            "MENA"       2018                  .
            "MENA"       2019                  .
            "MENA"       2020                  .
            "Subsaharan" 2000                  0
            "Subsaharan" 2001       14404908.672
            "Subsaharan" 2002       3913893.4504
            "Subsaharan" 2003        23258875.47
            "Subsaharan" 2004                  0
            "Subsaharan" 2005        1884110.497
            "Subsaharan" 2006       1016265.5141
            "Subsaharan" 2007      10674772.2744
            "Subsaharan" 2008                  .
            "Subsaharan" 2009        3316775.011
            "Subsaharan" 2010      54190465.5538
            "Subsaharan" 2011     331232.4291684
            "Subsaharan" 2012        16144628.16
            "Subsaharan" 2013        31605509.54
            "Subsaharan" 2014        54745.19135
            "Subsaharan" 2015        31283.88557
            "Subsaharan" 2016     12858679.58482
            "Subsaharan" 2017              30000
            "Subsaharan" 2018                  .
            "Subsaharan" 2019                  .
            "Subsaharan" 2020                  .
            "Americas"   2000                  .
            "Americas"   2001                  0
            "Americas"   2002                  .
            "Americas"   2003                  0
            "Americas"   2004        5971302.067
            "Americas"   2005        14942084.32
            "Americas"   2006       38126080.523
            "Americas"   2007                  .
            "Americas"   2008      63589624.8952
            "Americas"   2009         4563002.55
            "Americas"   2010     1257873.765095
            "Americas"   2011       59184307.576
            "Americas"   2012      15414358.5389
            "Americas"   2013       50252760.162
            "Americas"   2014       12765808.621
            "Americas"   2015        1238127.276
            end
            ------------------ copy up to and including the previous line ------------------

            Listed 100 out of 3592 observations
            Use the count() option to list more


            [CODE
            preserve
            collapse (sum) chnodalilike , by (newregion year)
            myaxis order=newregion, sort(sum chnodalilike) descending
            [/CODE]

            Error:"value labels order already exist; specify new name?"

            Actually, I never had this error before. Do you have any recommendation?

            Thank you so much,

            Best,






            Comment


            • #21
              The error message comes from myaxis and the suggestion is to think up a different variable name.

              Comment


              • #22
                Thank you,

                I solved the problem,

                Best,

                Comment

                Working...
                X