Recently, while reading up on Wilkinson and Cleveland Dot plots, I saw this excellent article by Xan Gregg on the topic. I also saw some interesting examples of Lollipop Charts, kind of a dot plot with statistics along with a drop line, maybe more suitable for sparse data. I thought
Search Results: styleattrs (149)
As many of the regular readers of this blog know, SGPLOT and GTL, provide extensive tools to build complex graphs by layering plot statements together. These plots work with axes, legends and attribute maps to create graphs that can scale easily to different data. There are, however, many instances where
Tomorrow is Independence Day, a federal holiday in the United States. Flags are displayed everywhere, especially in Washington, D.C., where I live. So let's have a little Fun with Flags! The current U.S. flag has 50 stars, one per state, with five rows of six stars interleaved with four rows
If you toss a coin 28 times, you would not be surprised to see three heads in a row, such as ...THHHTH.... But what about eight heads in a row? Would a sequence such as THHHHHHHHTH... be a rare event? This question popped into my head last weekend as I
Recently, while browsing health care data, I came across the graph shown below. The graph includes the healthy life expectancy at birth by countries in the EU, along with the associated per capita expenditure. The graph also shows estimate of potential gain in life expectancy by increasing expenditure efficiency. The
Most SAS regression procedures support a CLASS statement which internally generates dummy variables for categorical variables. I have previously described what dummy variables are and how are they used. I have also written about how to create design matrices that contain dummy variables in SAS, and in particular how to
Last week I published an article on creating bar charts with visual category values. The idea was to use visual icons for the category values in a HBAR of age by animal. For the data, I referred to a visual from the 2010 Encyclopedia Britannica Inc. that I found on the
We often say a picture (or graph) is worth a thousand words. So, recursively, this could apply to other text in the graph. I thought it would be interesting to see if we can create a graph with visual categories. Another benefit is that such visual categories are inherently meaningful
If you're a fan of SAS' ODS Graphics, you probably know that it does pretty much everything except geographical maps. But it's flexible enough that you can "fake it 'till you make it"! This example describes how to fake a geographical (choropleth) heat map using Proc SGplot polygons. In my
If you give an artist some tools, they can create a pretty picture. Sure, they might have a preferred tool - but they can probably do a pretty decent job no matter what you give them (paint, colored pencils, watercolor, charcoal, etc). And creating pretty graphs in SAS is no
Today's post illustrates the REG, PBSPLINE, LOESS, SERIES, and SPLINE statements in PROC SGPLOT. The GROUP= and BREAK options in the SERIES statement are also discussed.
Suppose you create a scatter plot in SAS with PROC SGPLOT. What color does PROC SGPLOT use for the markers? If you specify the GROUP= option so that markers are colored by a grouping variable, what colors are used to represent the various groups? The following scatter plot shows the
PROC SGPLOT writes a graph template and uses it to create a graph. You can edit the template and then create a modified graph.
Previously, I discussed ways to create a Box Plot with Stat Table and Markers in the linked article. One of the graphs showed a Box Plot of Cholesterol by Death cause along with the display of the actual observations. The main goal for that article was display of statistics with
I have a fondness for fractals. In previous articles, I've used SAS to create some of my favorite fractals, including a fractal Christmas tree and the "devil's staircase" (Cantor ) function. Because winter is almost here, I think it is time to construct the Koch snowflake fractal in SAS. A
This is the 2nd installment of the "Getting Started" series, and the audience is the user who is new to the SG Procedures. It is quite possible that an experienced users may also find some useful nuggets here. One of the most popular and useful graph types is the Bar
A SAS customer asked how to use background colors and a dashed line to emphasize the forecast region for a graph that shows a time series model. The task requires the following steps: Use the ATTRPRIORITY=NONE option on the ODS GRAPHICS statement to make sure that the current ODS style
A Spider Plot is another way of presenting the Change from Baseline for tumors for each subject in a study by week. The plot can be classified by response and stage. Another way of displaying Tumor Response data was discussed earlier in the article on Swimmer Plot. This article is prompted
Last week I had the pleasure of presenting my paper "Graphs are Easy with SAS 9.4" at the Boston SAS Users Group meeting. The turn out was large and over 75% of the audience appeared to be using SAS 9.4 back home. This was good as my paper was focused on the cool new
In this post, I will show you how to control the order of the entries in a legend and explicitly control the correspondence between groups and style elements in PROC SGPLOT. In many cases, the colors that are used to differentiate groups do not matter--the graph simply needs to display
In a scatter plot, the regions where observations are packed tightly are areas of high density. A contour plot or heat map of a bivariate kernel density estimate (KDE) is one way to visualize regions of high density. A SAS customer asked whether it is possible to use SAS to
One of my favorite new features in PROC SGPLOT in SAS 9.4m2 is addition of the COLORRESPONSE= and COLORMODEL= options to the SCATTER statement. By using these options, it is easy to color markers in a scatter plot so that the colors indicate the values of a continuous third variable.
As often is the case, this article is prompted by a recent post on the SAS/GRAPH and ODS Graphics page communities page. A user wanted to create a Graph Table showing a bar chart with tabular data for each of the category values along the x-axis. The user was creatively using
Last week I posted an article on displaying polar graph using SAS. When the measured data (R, Theta) are in the polar coordinates as radius and angle, then this data can be easily transformed into the XY space using the simple transform shown below. x=r*cos(theta * PI / 180); y=r*sin(theta * PI
At the 2013 SAS Global Forum, I presented a paper titled "Make a Good Graph" which reviewed some of the features that make for a good graph. This paper presents an aggregation of ideas from various sources, including some recommendations from thought leaders in the graphics arena such as Edward Tufte,
The advent of the AXISTABLE statement with SAS 9.4, has made it considerably easier to create graphs that include statistics aligned with x-axis values (Survival Plot) or with the y-axis (Forest Plot). This statement was specifically designed to address such needs, and includes the options needed to control the text attributes of
Let us continue our review of the Clinical Graphs included in the CTSPedia repository. Today, I noticed this Heatmap of Benefits and Risks over Time for Subjects in a study by Treatment, submitted by Max Cherny using "R" code. I thought it would be a good exercise to see how to build this
A few weeks ago I posted an article describing how to display simple Network Diagrams with Curved Links using SGPLOT procedure. The key requirement is that the node positions have to be computed by user. Often, for simple diagrams, nodes can be positioned using a simple layered layout. Separately, I also
The SG procedures in SAS use aesthetically pleasing default colors, shapes, and styles, but sometimes it is necessary to override the default attributes. The MARKERATTRS= option enables you to override the default colors, symbols, and sizes of markers in scatter plots and other graphs. Similarly, the LINEATTRS= option enables you
Let us continue with our journey beyond standard plots and charts. Often we need to create some simple diagrams to visualize the connections between different entities such as patients and providers or even a social network. Many of you may not have a custom tool to create diagrams. But you have Base SAS, so