Announcement

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

  • #31
    Nathan E. Fosse this is a known issue with the earlier release available on SSC. At some point, ColorBrewer switched to using the https:// protocol and the page redirect doesn't get handled by Stata. You can fix it by installing from the project repository:

    Code:
    net inst brewscheme, from("http://wbuchanan.github.io/brewscheme")
    Once I'm able to finish up the documentation for brewtheme I'll end up sending Kit Baum a version 1.0 release.

    Comment


    • #32
      Thanks wbuchanan ! Much appreciated. Exciting to see it developed.
      Nathan E. Fosse, PhD
      [email protected]

      Comment


      • #33
        Nathan E. Fosse not a problem at all. If you notice any issues or think of things that you might want to see moving forward, feel free to mention it and if it is something I can pull off I can try incorporating it into the program.

        Comment


        • #34
          Matthias Gomolka I've still not been able to figure out why the y-axis values are not being displayed with the appropriate format. I was able to figure out what happened with displaying the minimum Y-axis grid line (e.g., x-axis line):

          Code:
          discard
          
          clear
          
          #d ;
          
          /* 1. create theme
          minor_tick specified twice in the gsize option. 
          */
          brewtheme matthiasg, graphsi("x 6.45" "y 4") 
          numsty("legend_cols 0" "legend_rows 2" "zyx2rows 0" "zyx2cols 1")   
          gsize("label med" "small_label small" "text medium" "body medsmall"    
          "small_body small" "heading large" "matrix_label medlarge" 
          "note small" "star medsmall" "text_option medsmall" 
          "minor_tick half_tiny" "tick_biglabel medium" 
          "title_gap vsmall" "key_gap vsmall" "key_linespace vsmall" 
          "legend_key_xsize 4" "legend_key_ysize medsmall" 
          "clegend_width huge" "pielabel_gap zero" "plabel small" "pboxlabel small" 
          "sts_risktable_space third_tiny" "sts_risktable_tgap zero" 
          "sts_risktable_lgap zero" "pie_explode medium")    
          relsize("bar_groupgap 67pct" "dot_supgroupgap 67pct" "box_gap 33pct" 
          "box_supgroupgap 200pct" "box_outergap 20pct" "box_fence 67pct")   
          symbolsi("smallsymbol small" "histogram medlarge" "ci medium" "ci2 medium" 
          "matrix medium" "refmarker medlarge" "parrowbarb zero")    
          color("tick gs12" "grid gs12" "major_grid gs12" "minor_grid gs12" 
          "matrix navy" "matrixmarkline navy" "histback gold" "clegend white" 
          "clegend_line black" "pboxlabelfill bluishgray" "plabelfill bluishgray")    
          linepattern("foreground solid" "grid solid" 
          "major_grid solid" "minor_grid dot" "text_option solid")    
          linesty("textbox foreground" "grid grid" "major_grid major_grid" 
          "minor_grid minor_grid" "legend legend")  
          linewidth("p medium" "foreground thin" "background thin" "grid thin" 
          "major_grid thin" "minor_grid thin" "tick thin" "minortick thin" 
          "ci_area medium" "ci2_area medium" "histogram medium" "refmarker medium" 
          "matrixmark medium" "dots vvthin" "dot_area medium" "dotmark thin" 
          "plotregion thin" "legend thin" "clegend thin" "pie medium" "sunflower medium" 
          "text_option thin" "pbar vvvthin") 
          textboxsty("note small_body" "leg_caption body")  
          axissty("horizontal_default horizontal_withgrid" 
          "vertical_default vertical_withgrid" "bar_super horizontal_nolinetick" 
          "dot_super horizontal_nolinetick" "bar_scale_horiz horizontal_withgrid" 
          "bar_scale_vert vertical_withgrid" "box_scale_horiz horizontal_withgrid" 
          "box_scale_vert vertical_withgrid") 
          clockdir("caption_position 7" "legend_position 6" "by_legend_position 6" 
          "p 3" "legend_caption_position 7")    
          gridringsty("caption_ring 5" "legend_caption_ring 5")   
          anglesty("vertical_tick horizontal")   
          yesno("extend_axes_high yes" "grid_draw_min yes" "grid_draw_max yes"
          "draw_major_grid yes" "caption_span no") 
          barlabelsty("bar none");
          
          // 2. create scheme file (using theme)
          brewscheme, schemename(matthiasg) themefile(matthiasg) allstyle(ggplot2) 
          allcolors(5) allsaturation(75);
          
          
          // 3. Example  
          sysuse auto.dta, clear;
          
          format %12,0gc price;
          format %12,0gc weight;
          
          /* 
          Unless you're planning on hand coding a lot of graphs, I would personally 
          avoid setting the scheme globally
          set scheme custom
          
          And pass the scheme as an argument to the graph command */
          twoway (fpfitci price weight) 
          (scatter price weight if rep78==1, sort) 
          (scatter price weight if rep78==2, sort) 
          (scatter price weight if rep78==3, sort) 
          (scatter price weight if rep78==4, sort) 
          (scatter price weight if rep78==5, sort), title("Example Graph") 
          legend(order(3 "1978 Repair Record = 1" 4 "1978 Repair Record = 2" 
          5 "1978 Repair Record = 3" 6 "1978 Repair Record = 4" 
          7 "1978 Repair Record = 5" 1 "Confidence Interval")) scheme(matthiasg);
          I also tried to clean things up a little bit by removing any of the entries that would be set as defaults by brewtheme. I've attached a copy of the graph below for convenience:

          Click image for larger version

Name:	matthiasG-example.png
Views:	1
Size:	338.1 KB
ID:	1328953

          Comment


          • #35
            Originally posted by wbuchanan View Post
            I was able to figure out what happened with displaying the minimum Y-axis grid line (e.g., x-axis line)
            Which of the many options makes the line at y=0 appear?

            Comment


            • #36
              Friedrich Huebler thanks for pointing that out. I was in a bit of a rush this morning. The argument that solved things for the x-axis was:

              Code:
              "grid_draw_min yes"
              passed to the yesno parameter. I've not been able to chase down the cause of the y-axis issue or to the number formatting issue but thought the update might be helpful if it was a bit more important to the user. My best guess with regards to the y-axis thing is that it is an internal thing with Stata:

              Code:
              #d ;
              sysuse auto.dta, clear;
              
              format %12,0gc price;
              format %12,0gc weight;
              
              /* 
              Unless you're planning on hand coding a lot of graphs, I would personally 
              avoid setting the scheme globally
              set scheme custom
              
              And pass the scheme as an argument to the graph command */
              twoway (fpfitci price weight) 
              (scatter price weight if rep78==1, sort) 
              (scatter price weight if rep78==2, sort) 
              (scatter price weight if rep78==3, sort) 
              (scatter price weight if rep78==4, sort) 
              (scatter price weight if rep78==5, sort), title("Example Graph") 
              legend(order(3 "1978 Repair Record = 1" 4 "1978 Repair Record = 2" 
              5 "1978 Repair Record = 3" 6 "1978 Repair Record = 4" 
              7 "1978 Repair Record = 5" 1 "Confidence Interval"));
              Results in the y-axis values being displayed with a different format from the one specified for the variable.

              Comment


              • #37
                Matthias Gomolka I think I've figured out the y-axis issue, and it seems like it is potentially a bug with the way fpfitci renders the y-axis labels:

                Code:
                sysuse auto.dta, clear
                format %10,0gc price weight
                tw scatter price weight
                tw scatter weight price
                tw fpfitci price weight
                tw fpfitci weight price
                I've already emailed Stata tech support to make them aware of the issue as well, but I don't think there is anything I'd be able to do. If you needed something analogous to this, I'd suggest using something like:

                Code:
                #d ;
                twoway (scatter price weight if rep78==1, sort) 
                (scatter price weight if rep78==2, sort) 
                (scatter price weight if rep78==3, sort) 
                (scatter price weight if rep78==4, sort) 
                (scatter price weight if rep78==5, sort)
                (fpfitci price weight, fc(none)), title("Example Graph") 
                legend(order(3 "1978 Repair Record = 1" 4 "1978 Repair Record = 2" 
                5 "1978 Repair Record = 3" 6 "1978 Repair Record = 4" 
                7 "1978 Repair Record = 5" 1 "Confidence Interval")) scheme(matthiasg);
                To work around things for now. Specifying no fill color for the area between the fitted and confidence interval lines allows the points to be visible and the y-axis ends up being rendered by the first scatterplot drawn to the screen.

                Comment


                • #38
                  Again, thanks a lot wbuchanan. Also, sorry for submitting the issue on GitHub after you already answered it here. I didn't notice the third page until now.

                  PS: The y-axis format issue does not depend on the type of the fit plot (lfit, qfit, fpfit, ...)

                  Comment


                  • #39
                    Matthias Gomolka no worries and thanks for the info about the y-axis thing. I'll forward that information back to the folks at StataCorp.

                    Comment


                    • #40
                      It took much longer than I originally anticipated, but the version 1.0.0 release of brewscheme is now available from the project page and has been submitted to the SSC as well. The newest version can be installed using:

                      Code:
                      net inst brewscheme, from("https://wbuchanan.github.io/brewscheme/") replace
                      No features have been added since the release candidate, but the documentation has been updated throughout. The biggest change that has happened is the documentation for -brewtheme- now includes references for each entry in the s2color scheme. There are some entries that are not explicitly documented in the existing official documentation, and in those cases, clicking on the entry will open the s2color scheme file for you and you can use the line number reference in the helpfile to locate where the entry exists in the s2color scheme. This primarily affects entries that seem related to contour plots and some of the graphs used with survival analysis. All other entries will redirect you to the official help documentation. This was done for a few reasons, but the biggest was making it more sustainable/easy on dependency management (e.g., in the worst case scenario, the only changes would be updating the link endpoint to the official documentation instead of writing/creating new documentation from scratch). Similarly, for each of the entries, the first table in the help files (e.g., shows the entry name and the valid values) includes linked content that either redirects the user to the official help documentation for the valid values or prints the results of the appropriate graph query command to the results window.

                      Lastly, the project page has been completely overhauled to make it more useful/consistent with the programs themselves. Now, each command page will display an HTML friendly version of the help file and embedded examples also show the output where appropriate/necessary. It also includes some improvements to make navigating around individual pages a bit easier (e.g., page anchors to move around the page a bit more effectively).

                      Comment


                      • #41
                        Version 1.0 of brewscheme is now available from the SSC archives.

                        Comment


                        • #42
                          Dear Mr. Buchanan,
                          thanks a lot for this amazing tool. As many, also I have spent hours copying RBG-numbers into bargraphs trying to find combinations that look nice and are still distinguishable when printed in black and white. These days are over now!

                          Best regards,
                          Boris Ivanov

                          Comment


                          • #43
                            Boris Ivanov

                            thanks for the kind words and I'm glad to know this tool has been helpful/useful to you (and hopefully your colleagues/collaborators).

                            Comment


                            • #44
                              Dear Wbuchanan,
                              I recently produced a couple of bargraphs. I want to change the the colour of some of the bars to Teal without running the command again. But the Teal colour in Stata is not giving me the exact colouring I want.

                              I understand that instead of writing color(teal) in the middle of a line of code, I can use color(“0 103 127”). If possible, how do I do this using the graph editor using the RBG codes?

                              Thanks,
                              Dapel

                              Comment


                              • #45
                                Zuhumnan Dapel
                                You may have better luck getting an answer to your question by starting a new thread. Since the question is not related to the topic of this thread it would only make it more difficult for other users to find the information in the future. It might be better to start a new thread and look through some of the examples in the Graphics manual in the mean time. I rarely use the graph editor and when I do it is typically to determine the names of specific aesthetic parameters. Since no one will have any idea how you created the bar graphs it would not be easy to provide you with accurate and clear guidance.

                                Comment

                                Working...
                                X