How would I visualize the amount of time that's passed between dates? - graph

If I had a product and wanted to visualize the amount of time that has passed between releases of that product, what type of graph would I use? What I'm trying to show is the average amount of time that has passed between release cycles, as well as (approximately) how far through the current release cycle we currently are.
The best I could come up with is a horizontal bar graph. Each bar would have a date associated with it that marked a particular release, and the length of the bar could indicate how much time has passed, maybe even list the exact number of days, but I could imagine that being slightly confusing, e.g. is that the amount of time that's passed before that release or after that release?
I imagine there must be a better way to visualize this.
UPDATE: I think I may have explained it poorly; let me try another approach. This buying guide does almost exactly what I want. It's compact, it lists when the releases happened, you can see roughly how long one release took compared to another (relatively), and the unfinished release is shown so you can get an idea of about how far through the average cycle you are. But one of the problems it has is that it is difficult to tell whether a particular stretch of time in between releases came before a particular date or afterwards. I was thinking about making the bars bigger and putting in the number of days too, which would only make the before/after ambiguity worse. So my question is, how can this chart be improved to be more visually intuitive? Thanks!

From your Question and your comments to the two answers prior to mine, your dataviz technique will have to
show the amount of time that has
passed between release cycles;
show both absolute and relative (i.e., time elapsed within a
release cycle as well as between them) which
is practically awkward because, as
you said, either you're forced to use
a tiny font to fit your plot on an
8.5 x 11 page, or the plot is so wide that it doesn't conveniently print
and it's too difficult for a readerto
capture in a single glance; and
show progress w/r/t the next target release
For the first item, i just used an axis scaled to time (x-axis). For the second, i used the y axis to represent intra-project time--where as, time between projects is on the x-axis. Doing this, keeps the plot size manageable. For the third item, i prefer to represent duration differently for cases like this--i.e., where there's a definite start and a definite finish. In other words, when my boss asks me how a certain project is going, i think i naturally say "50% complete" or something like that, rather than "we are four weeks into it". I think thermometer symbols can be visually intuitive here--i.e., you show progress by filling a container.
So in the plot below, i show five separate projects (versions 1 through 5); the x-axis is in weeks and shows how far apart in time are the project start dates for each. The y-axis (which i didn't show, instead relying on the color fill in the thermometer symbol to show "degree of completion of each project.
I created this plot in R (using only libraries in the base install).
Here's the code:
# synthetic data:
x = c(1, 10, 22, 40, 58) # x-axis
y = c(2, 5.5, 9, 12.4, 15.0) # y-axis
z = c(1, 0.9, 0.80, 0.67, 0.25) # % fill for thermometer symbols
# create the plot:
plot(x, y, ann=F, axes=F, type="n")
symbols(x, y, thermometers=cbind(0.5, 4, z), inches=1.2, fg=rep(3, 5),
ann=F, axes=F)
axis(side=1, at=xt, lwd.ticks=1.3, col="steelblue4", col.ticks="red")
A few comments in case you're not familiar with R. First, the plot, and axis function calls could have been omitted. The other three are purely for aesthetics:
plot was called to create a plot with no data, no labels, and no visible axis, so that i could draw my custom axis later and leave the y-axis out entirely;
axis is just for drawing a custom x-axis, with the tick marks where i wanted them.
symbols is the only call required.
The 'thermometer' argument is a matrix in which the first two columns are the symbol width and height, respectively, and the third column is the % filled ('z'); 'inches' is the actual symbol size, and 'fg' is the fill color for each symbol, i.e., 'rep(3,5) just means '3' repeated 5 times, where '3' is just a convenience symbol for the lovely green color you see below.

Maybe a Gantt Chart? For each release, you could use a row to the duration that the release was active. Also, you could include rows for development time. You would be able to visualize pretty easily a number of metrics...
Time between releases
Duration of each release
% completion of current dev cycle
Development periods compared release to release

I think I'd probably use some sort of Timeline, good examples

Related

Jump y axis values when highest value is to far away from the other points

Basically I'm building an area graph with Chart.js, the data that I'm using in order to build the graph usually contains a peak that is much higher than the rest of the points and the y-axis range of values will be to high, to notice the diference between the lower points and it wil seem almost as a parallel line to the x-axis as we can see in this image:
Graph with problems
The solution I want to try is to skip the values from the y-axis between the lower points and the peak of the graph, and accomplish a graph presentation similar to this one:
Solution graph sketch
As we can see at this sketch the y-axis has a normal scale until 300 but then as the next point is to far away from the other ones the y-axis values are skiped.
So what I want to know is if this jump on the values of the y-axis is possible to achieve with this library (Chart.js) and if so where can I find documentation about it, because I already looked everywhere and couldn't find a thing. If not I would ask you for recommendations of any other librarys where I could achieve this.

How to plot only within a range defined by x number of bars?

I understand that I can contingently plot on the chart using range of date and time values.
However, I would like to be able to plot using a specific number of candlesticks.
For example, I would like to be able to say something like
// Within the most recent 10 bars
// If close[0] > close[1]
// plotshape()
I have tried implementing numerous variations using barstate.isrealtime or barstate.islast but I keep running into limitations.
One major problem is that, although bar_index[#] works by indexing backwards from the most recent bar, the value of bar_index[10] is not 10 but some number in the thousands (depending on the timeframe of the chart — for me its Daily = 2,616 candles, 1hr = 6,217 candles, 15m = 5,222, etc.). In other words, it counts the number of bars from the oldest bar available.
Since referencing of the bars (starting from most recent) and the index values (starting from the oldest) are conflicting--due to counting from opposite ends--I am not sure how to specify: plotshape() for the most recent 10 bars.
I am also running into trouble due to the fact that bar_index[0] occurs every single iteration of the chart's timeframe--so I am getting caught in recursive calculations when trying to do bar_index[0]-bar_index[10].
It seems that what I need is something like bar_index.islast[10]
The reason that I would like to call a plotshape() based on the number of specified candles versus since x date/time (or within date range (x,y)), is because I want my indicator to function properly regardless of which timeframe my chart is displaying:
If I am showing a monthly chart, I want to plot across the last 10 monthly bars; If I am showing a daily chart, I want to plot across the last 10 daily bars; etc.
If I am forced to use a date range, then this functionality breaks down, since I will be shown increasingly more bars for smaller timeframes.
Caveat**
I am able to kinda make this work by specifying the number of bars from the oldest candlestick by stating something like:
bar_index > 2600 ? color=color.black : na
However, given the fact that every single time frame displays a different number of bars, this is not a workable solution for me.
Thanks for any advice.
UPDATE
I have been hunting around and and found that the functionality I desire is already built into the show_last argument of the various plot()functoins.
Ill leave my question posted, in case it helps someone else.
UPDATE I have been hunting around and and found that the functionality I desire is already built into the show_last = int argument of the various plot() functions.
I'll leave my question posted, in case it helps someone else.

plot every tick on axis[SAS]

I have dataset include about 100 observations, say all of them are in (x,y) format, all of y is in integer format. I need proc sgplot to make a graphic about them. The range about my y is from 1 to 150. I hope I can force the graphic to show every corresponding y value on the y-axis instead of automatically reducing the ticks to a small number in order to show them clearly. For example, if the first five value of my y is (1,3,4,6,7,....), I hope the y tick shows exactly (1,3,4,6,7,....) instead (1,5,...).
I tried
yaxis value=(1 to 150 by 1) valueshint display=all;
It does not work as maybe I have too many observations. I know the result maybe overwhelming, but I just want to see the result. Thanks.
You don't say if you're using SAS/GRAPH or ODS GRAPHICS (SGPLOT etc.), so I'll answer the latter which is what I know; the answer should be useful for both in concept.
You likely cannot get SAS to plot so much on the axis unless the axis is very large itself. This means you have two options.
Raise the size of the graphic produced a lot in terms of pixels(and then shrink that to a usable size via image physical size, or using an external tool). Not necessarily usable in all cases, but produces a very high resolution plot (which is very big size-wise). This page explains how to do that for ODS graphics (use image_dpi as a high number, and width and height in inches as a normal number), and this page explains for SAS/GRAPH. You may need to make your font small to make it work (if you're adding numbers, which I assume you are), or you may need to make an initially large plot first and then go into paint/photoshop/gimp/etc. and make it smaller.
Use annotate to create the axis marks. This is fairly easy if you know how to use annotate, as you're just writing to the location of the axis (y) and the item (x), and then a bit below that for the text. This will make it very easy to make a total garbage plot, but it will likely work ultimately.
These likely work in both SAS/GRAPH and ODS GRAPHICS, and I can't test either as you don't post any code or simulated data to test with, but I think both approaches have some merit (as does the approach of "don't do this", but you've thought that through).

Intelligent Y Axis Scaling BarPlot R

I want to plot some data with barplot. Rather, I want to make a bar graph and barplot seemed the logical choice. I am plotting just fine but I was wondering if there is a way to intelligently scale the y axis to round up from the highest count.
For example I set the yaxis in this case to be 30, because I knew that Strand.22 had 27 counts in it: barplot(unlist(d), ylim=c(0,30), xlab="Forward Reverse", ylab="Counts")
In the future, I want this script to run on its own, so it would be optimal for the the Y-axis to choose it's own ylim. Short of pulling the information out of my 'd' variable I can't think of a good way to do this. Is there an easy way to do this with barplot? Would some other plotter work better? I have seen things about ggplots but it seemed super complex and I wasn't sure that it would do anything better.
EDIT: If I do not choose a ylim it picks automatically and this is what it decided was best.
I disagree with it's choice.
If you don't specify ylim, R will come up with something based on the data. (Sounds like you don't like it's choice, which is fair.)
If you specify something based on the data like:
barplot(unlist(d), ylim=c(0,1.1*max(unlist(d)))
R will draw you a plot that reflects the maximum value of data. That example just takes the maximum of your values and multiplies that by 1.1 (this could be any number) to give it a little extra height. R does something similar to this when you make a scatterplot but it handles barplots slightly differently.

Irregular scaling of axis in R

I have computed values for several categories for three networks. I'd like to create a bar plot in R to show the differences between these parameters for the networks. So far I plotted this with the barplot R function with the categories on the x-axis, their values on the y-axis and to each category three bars (one for each network).
But now I have one value which is much higher than all the others. Therefore the differences for the rest cannot be seen since they're represented only by a thin line because of that one large bar which almost fills the whole plot.
My idea was now to plot the values on the y-axis on an irregular scale, meaning for example, that one half represents the values from 0 to 300, and the other half from 300 to 3000. Is there any way to do this? Or a good alternative approach to handle this problem? I also thought of plotting the logarithm but unfortunatly I have also negative values.
I would suggest that an irregular scale isn't a good plan - I think it confuses viewers of the chart. Instead, you could use the layout() function to plot three separate barplots in a horizontal layout. Thus, each category could have it's own plot, with it's own scale.
If, however, you still have a single bar at 3000, while everything else is at 300, that won't really help. In that case, you could manually set your y-axis limits with ylim=c(min,max). To keep the bar from stretching off the screen, you can just use simple logic to define anything > 300 as 300, or something similar. Then, put a text point there stating the actual value (using text, maybe with arrow).
With those ideas out there, I would suggest that a graph where one value is 10x the other values might not really be worth presenting, or if it is, the main takeaway from it isn't going to be "how do values 2 and 3 compare to each other", it's going to be "holy moley look how much bigger 1 is than 2 and 3". So, it might not be a big deal if one bar is giant and two are small, as long as you aren't doing all 9 on a single plot (which would screw up other, relevant comparisons). So, if you split them using layout(), then it wouldn't be as big of a deal.

Resources