What is the name of this plot? - ggplot2

I would like to redo this plot, which was published in one of the newspaper about Covid 19 death toll. I am not sure what kind of graph is this, I am assuming this is percent stacked area plot.

It is probably a streamgraph of some kind. So, a streamgraph is a type of stacked area chart. It represents the evolution of a numeric variable for several groups. Areas are usually displayed around a central axis, and edges are rounded to give a flowing shape.
I found it hard to install streamgraph from git hub repository, however, there is a ggplot alternative available called "ggTimeSeries". Below is the link for streamgraph R documentation.
https://www.r-graph-gallery.com/streamgraph.html

Related

Circular panning with matplotlib

I'm looking for a way to have interactive "circular panning" with matplotlib: when
interactively moving the axes to the left or the right, I want the data
(and axes labels) to "wrap around". (An (silly) example application would
be e.g. plotting annual average temperatures, and wanting to look at
whether anything special is happening around New Year.)
Is there a simple way to achieve this?

Drawing "boxes" on my PDF output

I am working on a corporate-level summary report for my employer. Because this is a fairly high-level report, I'm trying to "pretty" it up a bit (I think the standard SAS output is exceptionally ugly). I've managed to include graphics using ODS REGION and the like, but I'm having trouble generating a fairly basic bar chart.
All I want to do is draw boxes onto the PDF file by specifiying X,Y and W,H and the background color. I've gotten close using this SUGI paper (which employs ODS REGION with a PROC GSLIDE).
That works OK, but I've run into many vexing little issues. For example:
There's a minimum height and width for GSLIDE (appx 3 points) which has made it very difficult to represent small numbers on my bar graph
The corners of GSLIDE are slightly rounded, causing strange looking "artifacts" when attempting to overlay and stack them
There's apparently a "maximum" width (appx 480 points). I think I might be able to solve this with the GOPTIONS VSIZE attribute, but I have to be careful because if the ODS REGION and GSLIDE are exactly the same size, then SAS (for some reason) thinks that the GSLIDE is bigger than the REGION and fails to render GSLIDE properly.
I've searched the internet for an easier approach, but it seems there are few SAS programmers trying to do what I'm doing. I know that I'm reinventing the wheel a bit in that SAS providers bar charts via SAS/GRAPH, but they don't provide the level of customization I need to display the results the way I want them.
How can I draw a simple rectangular shape, with nice square corners, and no weird width/height limitations, on a PDF file?
This isn't direclty relevant to the question, but since it's been brought up, here's an idea of what the bar chart looks like:
Each row measures a metric across a mutually exclusive sub-section of a larger population. The Gray bar represents the total size of the population being measured. The blue bar measures the metric (and the reported number is the metric across the sub-section). The "white bar" is the size of the total population. (The light blue bar is an alternate metric displayed only for those who are curious - it will always be smaller than the blue bar.) Some sub-sections contain no data, so they are displayed as "N/A".
There's also a rolling total. So, after one or a few sub-sections are reported, they are rolled into the rolling total. The gray background groups the related sub-sections, with the rolling total reported at the bottom.
This is pretty much exactly what I want this chart to look like. If it can be done using standard SAS charts, I'd be happy to use them - but I think it's been easier to get this effect on my own by painting the graph myself.
I found a partial answer... you can use a LayoutRegion defined via PROC TEMPLATE to set the background color of an ODS REGION. You still must "put something" within the region to force SAS to render it (for example, ODS TEXT = " ";), but it removes at least one pain point: minimum and maximum sizes.
Unfortunately, the corners are still rounded, but I'll update this answer if I can figure out a way to fix that via an attribute or something.

How to resolve overlapping scatter points in a highchart

I have a time series data being plotted with Highstock API, as a scatter. When I am plotting it for a period of 5 days or more... my scatter points generated in very close proximity are getting totally overlapped. I have to close in my time frame to see that there are actually two points close by(which were overlapping).
so please help me on how i can improve display on this issue.
From what I've read and observed, this is one of the reasons to use a scatter plot: to see where data sets overlap, group together, and to show possible correlation (see the formal definition over at Wikipedia: https://en.wikipedia.org/wiki/Scatter_plot).
You may wish to add a note to the chart that encourages your users to zoom in to see more detail. The zoom function is a native part of Highcharts/Highstock, but isn't immediately obvious to many users.
It's worth noting that you can limit the zoom to either one axis (zoomType: 'x') or both axes (zoomType: 'xy'); see http://api.highcharts.com/highcharts#chart.zoomType. That may offer you a bit more control over how you want your users to view the parts of the chart with a larger number of overlapping points.

How can I extend a line from two points to the edges of the plot area using Core Plot?

I'm using Core Plot to graph linear equations.
I would like to be able to supply two different data points and have a line drawn between them, but also extrapolated beyond the points themselves so that the line extends all the way to the edges of the plot area.
For example, given a 20x20 plot area with the origin centered and points at -5,-5 and 5,5, the line (green below) would extend all the way from -10,10 to 10,10 (blue below).
Is this possible? Is the best option just to find the plot range (which will be different each time) and find two points that are outside of it? I'm not sure if this will work; I have user interaction enabled and I want to make sure that the user can't accidentally pan far enough that the line will end.
Your idea of finding two endpoints outside the plot range is what I'd do. If you've limited the scrolling range, just pick points at the limits of that range. If not, you'll need to monitor changes to the plot space ranges with a plot space delegate and update the plot as needed.

How to move a Core Plot graph

I have a Core-Plot Graph within a Mac Application. But the inside table is appearing shifted down and to the left of the containing "frame/border" so that neither of the axis' are showing. I cannot figure out how to change this does anyone know what parameters I need to change to fix this?
Update: Sorry I did not realize I could upload an image, I have done so know and will try your suggestions in the mean-time.
Not sure what you mean by "inside table". It would be easier to offer suggestions if you could post a screenshot.
Without seeing what's wrong, here are some common areas to look at:
If you haven't already done so, look at the example apps included with Core Plot for ideas. The Plot Gallery app has many sample plots and the others are useful, too.
You may need to add padding (paddingLeft, paddingBottom, etc.) on the graph and/or plot area frame. Padding the graph pushes everything in away from the edges of the graph. Padding the plot area frame pushes the plot area in so the axes and titles can hang outside the plot area (the area where the plots are drawn).
If you want to keep an axes pinned to a specific place, e.g., the edge of the graph, set up a floating axis. Otherwise make sure the orthogonal coordinate is set (it defaults to 0). For example, the orthogonal coordinate for the x-axis is the y-value where the x-axis crosses the y-axis.