Plotting vertical bars and series (x= y=) together using SAS - plot

Here is a graphical output that I'm trying to mimic. I want a series AND vertical bars plotted simultaneously
However the SAS has a compatibility issue with plotting series and vbar together. Is there a way to plot my data as above?

Take a look at the V9.2 GBarLine example at:
http://robslink.com/SAS/democd30/aaaindex.htm
If you have SAS version 9.2 or above you should be fine.

Related

Can I create a target zone on my time series plots in R?

I've created a time series plot in R using the ggplot package, but I wanted to see if I could further customize it by creating target zones. I originally started with an Excel plot that allows me to move a gray box to different areas of the plot as an easier way to point out a range of temperatures. However, I wanted to see if I could replicate this in R. Here's a screenshot of my Excel plot to better explain my goal: Time Series on Excel. On the time series plot, you can see a gray box that you can drag around and change the size of to better define a range of temperatures (in this case, it covers from 15-25C). Is this possible to do on top of my time series plot in R? I'm only starting to code in R so it's been quite hard for me to navigate, and I appreciate any help I could get. Thanks!

Overlay Plots : Time Series - Different Frequencies (Lines over Bars) [ggplot2]

My question is about overlaying plots of different x and y scales .The raw data is out of a public weather database in New Zealand called CliFlo, managed by NIWA. I'm not prepared to copy the data for an example because of copyright protections.
I want to reproduce the types of graphs they offer at a fee, shown on this web page. Take the Rainfall graph. There is a cumulative rainfall line graph overlayed on top of a monthly rainfall bar graph. I can generate each graph separately using ggplot2, but I can't find a good way to overlay them like in the example. I've found the gridExtra package to let me print them side-by-side, and I've come across the magick package that might let me do the job, but I'm not sure on how to get the plots lined up properly and how to use the magick package properly. Can anybody help me out on this?
Should I try to scale the month bars to fit the daily line graph but make them spaced out and thicker so they look like months, or would it be easier to use the magick package somehow?
I'd attach an image of what I have so far, but I'm new to this website and it won't let me yet.

R ggplot2 geom_boxplot horizontal bars

I am very new to R and I wanted to use a box and whisker chart in my power bi dashboard and the custom visualisation for this was very slow for the volume of data.
I got the same data I am using in power bi from a mssql 2012 database and tried the same code in R studio. I get the box and whisker chart but all I get is horizontal bars. I am using the below code. SecondsOpen is still a num in the data frame as I had read this can get set to factor.
When I calculate median and average and percentiles via functions in power bi it all works ok. I am clearly doing something wrong but as I am so new to R I am struggling to see what.
library(ggplot2)
ggplot(res,aes(month_start_date,'SecondsOpen')) +geom_boxplot()
Box and whisker Image
Dataframe Datatypes Image
ah it was 'SecondsOpen' should be SecondsOpen!

Transforming table to format for stacked bar chart

I've got a data frame in R that looks like this
URL TTFB StartRender FullyLoaded
http://news.bbc.co.uk/ 500 750 3000
and I want to plot a stacked bar chart from it where each segment of the bar is as follows:
TTFB
StartRender - TTFB
FullyLoaded - StartRender
I'm having a real problem understanding how I need to transform the data to be able to plot the column for each URL (or even what the data needs to look like)
Stacked bar charts are not good data visualizations. Much better to use a grouped Cleveland dot plot. In R these are available with the dotchart command in the graphics package.
The problem with stacked bar charts is that it is hard to estimate the proportions except for the bottom of the stack.
Faceting provides a good alternative to stacking, and can be done fairly easily in R using ggplot2

R: How to overlay pie charts on 'dots' in a scatterplot in R

Using R I would like to replace the points in a 2d scatter plot by a pie chart displaying additional values.
The rational behind is that I have time series data for hundreds of elements (proteins) derived from a biological experiment monitored for 4 conditions. I would like to plot the elements (categorial data) on the y axis and occurrence of a event in time on the x axis. To visualize the relative occurrence between the 4 conditions I would like to visualize this in form of a pie chart or doughnut chart overplayed onto the respective point in the scatter plot.
The overall data density is low so overlapping won't be an issue.
Is this possible in R?
I was thinking of using a manual scale in ggplot2 but could not figure out how to define a pie chart as a scale.
Also of interest would be how to best cluster this data and sort it accordingly.
Yes. pieGlyph() is one ready-to-go function from the Rgraphviz package.
Also, I would check out this Q/A for how to do things like this more generally:
How to fill a single 'pch' point on the plot with two-colours?
Especially check out ?my.symbols from the TeachingDemos package.
Lastly, in regards to ggplot2, you should check out this blog post about possible upcoming features:
http://blog.revolutionanalytics.com/2011/10/ggplot2-for-big-data.html
See also Paul Murrell. Integrating grid graphics output with base graphics output. R News, 3(2):7-12, October 2003. http://www.r-project.org/doc/Rnews/Rnews_2003-2.pdf
The code on pp 10-11 sets up the main plot axes, labels and legend, and then opens a series of smaller windows centered at each individual point on the plot and plots a small graph in each window. I've tried pie charts, mosaics and barplots, but the method is not limited to these types.

Resources