Announcement

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

  • How to plot the graph like this?

    Dear all, How can I plot the graph like this?This a graph generated by excel.How to fill the bar with slashes.
    Attached Files
    Best regards.

    Raymond Zhang
    Stata 17.0,MP

  • #2
    A related thread with some links that may be of help:
    https://www.statalist.org/forums/for...a-fill-pattern
    // ivica_rubil //

    Comment


    • #3
      Ivica Rubil is bang on. The only way to get that kind of bar shading is with community-contributed code. The code mentioned is from 2008 and may or may not have been broken since by changes in official code.

      Personal opinion: The example chart seems perfectly clear without any kind of special fill. (I can't read Chinese, but trust that is not an issue here.)

      Comment


      • #4
        Dear @Nick Cox, this is just a simple example.and It shows what I want to ask.in fact ,the graph what I want to plot has more than 1 category.
        Many journals often ask us to provide black-and-white graph.so I have to fill special fills.
        Best regards.

        Raymond Zhang
        Stata 17.0,MP

        Comment


        • #5
          We do rely on the examples you give. Besides, in your example it's the same shading for each bar so far as I can see.

          There are many solutions if journals don't support full colour. (The Stata Journal is one such.)

          1. It is a poor journal that won't support different grey scales, minimally solid black for an important single category and white for everything else.

          2. Bar charts don't have to be differentiated by colour. You can show groupings, use text to differentiate, and so on.

          3. You can use dot charts and so different symbols.

          As Naomi Robbins says somewhere, you wouldn't want to use a different colour for each word in a sentence. Why do you need to use a different colour for each bar?

          Comment


          • #6
            Sorry for my poor English.
            1.The Chinese characters is not an issue here.
            2.When there are many categories,such as 8 categories, use different grayscale is not a good idea and is different to read.
            3.Yes,I know I can use dot charts and different symbols, but I want to know if I can use bar charts here.
            4.I don't need to use a different color for each bar,I want to use different pattern fills for different categories.
            Best regards.

            Raymond Zhang
            Stata 17.0,MP

            Comment


            • #7
              Good to hear #1.

              When you have say 8 or more categories, different colours or pattern fills for each usually create, in my view, a confusing mess. If people won't read the text saying which is which, that;s their call.

              The reluctance of StataCorp to provide different fills is not of course my responsibility, but I approve nevertheless.

              Comment


              • #8
                If the journal's requirements are designed for and most easily met using Excel, then perhaps using Stata to prepare the appropriate summary data for plotting, and then exporting that data to Excel and using Excel to produce the plots would be the most efficient approach.

                Comment

                Working...
                X