Code Monkey home page Code Monkey logo

stata-schemepack's Introduction

StataMin issues license Stars version release

Installation | Examples | Change log


schemepack-1

schemepack v1.4

(09 Nov 2022)

In this repository are various ready-to-use Stata schemes. The earlier schemes come in three flavors: white, black, and gg (grey). As the names suggest, these are the background colors, where the last one is inspired by the ggplot2 scheme in R. The newer schemes are standalone versions with unique colors that allows the graphs to stand out.

Addition info:

  • The scheme_test.do contains the script to test the various schemes.
  • The figures folder contains the high-resolution images of the schemes.

Link to the Medium article that describes these schemes: Stata graph schemes by The Stata Guide. Here you can learn how to program your own schemes.

Note that scheme file options, e.g. colors, lines, sizes, etc. might be subject to minor adjustments to improve their overall visual quality.

Installation

The package can be installed via SSC or GitHub. The GitHub version, might be more recent due to bug fixes, feature updates etc, and may contain syntax improvements and changes in default values. See version numbers below. Eventually the GitHub version is published on SSC.

The package can be installed from SSC (v1.4):

ssc install schemepack, replace

or install them from GitHub (v1.4):

(GitHub files might contain latest updates that have not been currently pushed to SSC).

net install schemepack, from("https://raw.githubusercontent.com/asjadnaqvi/stata-schemepack/main/installation/") replace

Once installed, please see help schemepack for the scheme descriptions and test them out.

You can also download and run the ./data/scheme_test.do dofile to test various graph schemes that uses this test data:

use "https://github.com/asjadnaqvi/stata-schemepack/blob/main/data/scheme_test.dta?raw=true", clear

or try them out on your own datasets! If you want to revert back to the default Stata s2 scheme, then type set scheme s2color. Note that you can permanently set a scheme by typing set scheme <name>, perm.

Please report errors or bugs or suggestions in the Issues section.

Examples

A preview of the schemes is given below. Not every scheme has been fine tuned for each and every aspect. Regardless, all elements can be modified, either by using the GUI or syntax. Some general purpose schemes are white_tableau and cblind1. Some themes like neon or black_w3d are great for presentations on dark backgrounds.

Each scheme has a pre-defined number of colors which are marked next to the scheme names. If no number is specified, then the standard 12 color range is used. Colors repeat if there are more graph elements than the scheme colors. In this case, you can either: (a) think again about how much information you want to display since 12 colors is already a lot!, (b) cutomize elements like adding dotted or dashed lines etc., or (c) automate colors following the Cutomizing color schemes guide.

Standalone schemes

tab1 (12 colors)

tab2 (12 colors)

tab3 (12 colors)

cblind1 (10 colors) (color-blind friendly scheme)

ukraine (9 colors)

swift_red (8 colors)

Taylor Swift dropped a new album, Red, and we dropped a new Stata scheme celebrating it:

neon (12 colors) (pure black background)

Glowing neons on a black background. Perfect for a dark beamer presentation:

rainbow (6 colors)

Celebrating pride (2021 edition):

Tableau color scheme

white_tableau (my default scheme)

black_tableau

gg_tableau

Cividis color scheme

white_cividis

black_cividis

gg_cividis

Viridis color scheme

white_viridis

black_viridis

gg_viridis

Hue color scheme (default ggplot2 colors)

white_hue

black_hue

gg_hue

brbg color scheme

white_brbg

black_brbg

gg_brbg

piyg color scheme

white_piyg

black_piyg

gg_piyg

ptol color scheme

white_ptol

black_ptol

gg_ptol

jet color scheme

white_jet

black_jet

gg_jet

w3d color scheme

white_w3d

black_w3d

gg_w3d

Change log

  • 08 Nov 2022: v1.4 release. Fixes and corrections to schemes. GitHub folder renamed to stata-schemepack to align it with other dataviz packages.
  • 08 Sep 2022: Minor fixes for v1.3
  • 14 Aug 2022: Bug fixes to schemes files. Ukraine scheme slightly desaturated. Four new schemes added: cblind1 (color-blind friendly), tab1, tab2, tab3 (qualitative colors).
  • 05 Mar 2022: A new scheme based on Ukraine's flag colors.
  • 15 Nov 2021: A new scheme based on Taylor Swift's Red album colors added. Minor fixes to the help file.
  • 28 Oct 2021: MAJOR UPDATE: schemes released on SSC (ssc install schemepack, replace). They collection has been renamed from tsg_schemes to schemepack to make it more generic and easier to remember. Black schemes have a notch darker background (its not pure black). Bar graph outlines adjusted to make them more visible. Otherwise some schemes were blending into the background.
  • 28 Jun 2021: Minor errors in templates have been fixed. For example bar labels were showing in the wrong color in the black themes. The test file has been reduced in size. The preview graphs have been regenerated. The number of graphs show in the preview below have been reduced except for the tableau schemes. All files exist in the figure folder though.
  • 26 Jun 2021: Two new schemes added: neon and rainbow. Neon tests a new and more generic scheme generator script. Rainbow celebrates the 2021 Pride month and introduces the 6 pride flag colors in the schemes. This scheme is fairly limited in the sense that it only has six colors. But these are more than enough for presentations etc. This is also derived from the generic scheme template used for the Neon scheme.
  • 15 Jun 2021: Schemes updated to make them compatible with Stata 15 and earlier. The s2-scheme.scheme was updated to a new version in 2019 and the older scheme version was giving errors.
  • 16 Apr 2021: Very minor fixes to some colors. Histograms fixed and added to the graphs. Following schemes added: brbg, piyg, ptol, jet, w3d
  • 08 Apr 2021: Repository created with pkg file and the following schemes added: tableau, cividis, viridis, hue

How can you support the schemes?

You can support the schemes by using them ๐Ÿ˜

You can also:

"Buy Me A Coffee!!!"

stata-schemepack's People

Contributors

asjadnaqvi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stata-schemepack's Issues

X-axis scaling issue

I have just started using your amazing package, however, I encounter an issue where the x-axis do no scale properly (scaling from 0-8), however, I got a data point which has x-value greater then 8. Can you let me know how can I fix this? I have added xscale(range(0 (2) 10)) but it is not working. I am currently using your white_hue scheme.
I am not a regular github user so I do not know if raising the issue here is appropriate. Please understand. Thank you.
I am looking forward to hearing your response,
Van

Graph

Failure to install

Dear Asjad,

Thank you for the update (although I think that the Ukranian scheme colors are too saturated to be of use).
But, while exploring, I seem to have a problem with downloading from your Github server, the following:

net d tsg_schemes, from("https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/")

results in my Stata window (v. 17 rev. 06 Apr. 2022):

file
    https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/tsg_schemes.pkg not found
could not load tsg_schemes.pkg from https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/
r(601);

Likewise, using:

net install tsg_schemes, from("https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/") replace

results in:

file
    https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/tsg_schemes.pkg not found
could not load tsg_schemes.pkg from https://raw.githubusercontent.com/asjadnaqvi/Stata-schemes/main/schemes/
r(601);

Set all schemes to 'off'

Hi There,
Just wondering whether its possible to turn schemes off after selecting one.
Standard Stata code for similar (trace, off or more, off for instance) doesn't apply here.
Apologies if I've missed this.

regards, Shay

Do file missing

Dear author,
The do file that codes the graphs is missing
I thought to let you know

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.