Change vertical axis from time to number on timegrid - fullcalendar

How I can change vertical axis from time (6:00am, 7:00am etc) to pair number (higher school) (for example num1,num2,num3).

Related

R - igraph: overlapping nodes with same y-axis

I am plotting a food web ecological network with igraph and I am trying to avoid having my nodes to overlap.
The y-axis depends on the attributes of the nodes (i.e. the species trophic levels, varying between 1-3.52, no nodes between [1,2] by convention).
To do so, I calculate how many nodes there are within certain intervals of the y-axis range (1 to 4 with increments of 0.5).
If all nodes have the same size (defined by the user), I calculate the length of x-axis at each levels of y, as the sum of the size of the nodes (as if the nodes would be next to each other on a single axis):
xl <- (n nodes + 1 + 2 ) * size
I add 1 here since the nodes should be plotted from the certain of the nodes, so there is half a node on the left of the minima and right of the maxima of the x-axis. (The +2 is just to give a little space, and yes I know 1+2 =3 :) just to make the explanation easier).
I then calculate the break points on the x-axis calculating a sequence from half of the length I calculated above, centered around 0.
seq(-xl/2, xl/2,length.out = nnodes)
Doing so, each center of the nodes should be at a breakpoint on the x-axis with some distance between the nodes.
If the nodes have different sizes (defined by the user), I use the maximum size in the formula above so that I have enough space between each center of the nodes.
I combine the x-axis and y-axis coordinates as a matrix to use as my layout.
coordsp <- cbind(xcoord, TLsp)
I use rescale within the parameters of the plotting function.
plot(network, layout= coorsp,
rescale=TRUE,...)
I still get some overlap.
I tried using rescale = FALSE, specifying the x-axis and y-axis limits (range of the coordinates in coordsp) but the graph end up looking weird or the plotting window turns completely white.
I think the issue when rescale = TRUE is that it rescales the coordinates but not the size of the nodes, so that if they are too big for a window [-1,1]x[-1,1], the nodes end up overlapping.
Any guess on how to avoid overlap?
Thanks in advance

How to read a coplot() graph

I cannot warp my mind arround reading the plots generated by coplot().
For example from the help(coplot)
## Tonga Trench Earthquakes
coplot(lat ~ long | depth, data = quakes)
What do the gray bars above represent? Why are there 2 rows or lat/long boxes?
How do I read this graph?
I can shed some more light on the second chart's interpretation. The gray bars for both mag and depth represent intervals of the their respective variables. Andy gave a nice description of how they are created above.
When you are reading them keep in mind that they are meant to show you the range of the observations for the respective conditioning variable (mag or depth) represented in each column or row. Therefore, in Andy's example the largest mag bar is just showing that the topmost row contains observations for earthquakes of approx. 4.6 to 7. It makes sense that this bar is the largest, since as Andy mentioned, they are created to have roughly similar numbers of observations and stronger earthquakes are not as common as weaker ones. The same logic holds true for depth where a larger range of depths was required to get a roughly proportional number of observations.
Regarding reading the chart, you would read the columns as representing the three depth groups (left to right) and the rows as representing the four mag groups (bottom to top). Thus, as you read up the chart you're progressively slicing the data into groups of observations with increasing magnitudes. So, for example, the bottom row represents earthquakes with magnitudes of 4 to 4.5 with each column representing a different range of depths. Similarly, you read the columns as holding depth constant while allowing you to see various ranges of magnitudes.
Putting it all together, as mentioned by Andy, we can see that as we read up the rows (progressing up in magnitude) the distribution of earthquakes remains relatively unchanged. However, when reading across the columns (progressing up in depth) we see that the distribution does slightly change. Specifically, the grouping of quakes on the right, between longitudes 180 and 185, grows tighter and more clustered towards the top of the cell.
This is a method for visualizing interactions in your dataset. More specifically, it lets you see how some set of variables are conditional on some other set of variables.
In the example given, you're asking to visualize how lat and long vary with depth. Because you didn't specify number, and the formula indicates you're interested in only one conditional variable, the function assumes you want number=6 depth cuts (passed to co.intervals, which tries to make the number of data points approximately equal within each interval) and is simply maximizing the data-to-ink ratio by stacking individual plot frames; the value of depth increases to the right, starting with the lowest row and moving up (hence the top-right frame represents the largest depth interval). You can set rows or columns to change this behavior, e.g.:
coplot(lat ~ long | depth, data = quakes, columns=6)
but I think the power of this tool becomes more apparent when you inspect two or more conditioning variables. For example:
coplot(lat ~ long | depth * mag, data = quakes, number=c(3,4))
gives a rich view of how earthquakes vary in space, and demonstrates that there is some interaction with depth (the pattern changes from left to right), and little-to-no interaction with magnitude (the pattern does not change from top to bottom).
Finally, I would highly recommend reading Cleveland's Visualizing Data -- a classic text.

Can we show percentage increase in line grapgh Tableau?

I am using Tableau version 8.1. Suppose the x axis is different month years (201310,201311 etc) and the y axis is the percentage of revenue increase for that month. I want to show the percentage increase in revenue in a line graph with respect to the previous month.
Currently i am getting the percentage increase .
For example
from oct-nov there is 5 % increase: 200$
from nov-dec there is 4 % increase: 450$
from jan-feb there is 3% increase: 750$
But the line graph is displaying based on the value of percentage increase instead of revenue generated.
For example the graph is like this
columns shelf : Month year
rows shelf : percentage increase in revenue
So what is happening is that even though there is increase in revenue the graph is showing decreasing line graph (based on the percentage increase) from 5% to 4% to 3%.
What i want is that it should show the line graph upwardly as there is increase in revenue
from previous month. Can some one suggest how to accomplish this?
Regards
Gautam S
What you want then is not to chart the percentage increase in revenue (which shows declining rate of growth), but to chart the revenue itself (which shows increasing growth) and possibly having the rate of growth as a tooltip or label.
Put revenue on the rows shelf.
Put percentage increase in revenue onto the "Tooltips" box or the "Text" box in the Marks card.

Bar plot with broken y-axis and log x-axis

I am looking to present a variable as a bar plot with the caveat that the groups I am trying to plot (the size of an object) vary over several orders of magnitude. The other complication of the data is that the variable y also varies over several orders of magnitude when positive as well as having negative values. I usually think in pictures so I have sketched something along the lines that I am looking for below (the colour would simply be a function of the distance from zero, i.e. white zero, dark blue very negative, dark red very positive etc):
Here is a real case of the data if required:
x <- c(1.100e-08, 1.200e-08, 1.300e-08, 1.400e-08, 1.600e-08, 1.700e-08, 1.900e-08, 2.100e-08, 2.300e-08, 2.600e-08, 3.100e-08, 3.500e-08, 4.200e-08, 4.700e-08, 5.200e-08, 5.800e-08, 6.400e-08, 7.100e-08, 7.900e-08, 8.800e-08, 9.800e-08, 1.100e-07, 1.230e-07, 1.380e-07, 1.550e-07, 1.760e-07, 3.250e-07, 3.750e-07, 4.250e-07, 4.750e-07, 5.400e-07, 6.150e-07, 6.750e-07, 7.500e-07, 9.000e-07, 1.150e-06, 1.450e-06, 1.800e-06, 2.250e-06, 2.750e-06, 3.250e-06, 3.750e-06, 4.500e-06, 5.750e-06, 7.000e-06, 8.000e-06, 9.250e-06, 1.125e-05, 1.375e-05, 1.625e-05, 1.875e-05, 2.250e-05, 2.750e-05, 3.100e-05)
y <-c(1.592140e+01, -1.493541e+01, -6.255603e+00, -2.191637e+00, -1.274086e+00, -1.343391e+00, -8.869018e-01, -7.717447e-01, -6.140710e-01, -5.637220e-01, -5.404424e-01, -3.473077e-01, -2.279666e-01, -1.945254e-01, -2.485636e-01, -2.363181e-01, -2.197054e-01, -2.119314e-01, -1.897220e-01, -1.656779e-01, -1.478176e-01, -1.364191e-01, -1.297830e-01, -1.408082e-01, -1.514742e-01, -1.311300e-01, -1.358422e-01, -2.718636e+00, -2.231532e+00, -3.479395e+00, -3.572720e+00, -2.297957e+00, -3.265428e+00, -5.449620e+00, -7.741435e+00, -1.172256e+01, 9.368365e+00, 1.078983e+02, 9.542029e+01, 1.484089e+02, 2.293383e+02, 3.678836e+02, 7.965286e+02, 1.349151e+03, 1.577808e+04, 4.554271e+05, 1.821730e+06, 8.092310e+04, 1.015619e+06, 2.113788e+06, 5.208331e+06, 4.534863e+06, 8.086026e+06, 1.577413e+07)
I could also plot this as a scatterplot with broken axis but I am currently playing with the a nice approach to display such data- important for me is highlighting at the approximate value of x that y changes sign as well as the variability and magnitude of both the positive and negative values. Any tips and advice you have plotting such data would be great.
Edit based upon comments
I realise that on my graph x and y are the wrong way around, apologies for that. Parameter x should indeed be on the x-axis and parameter y on the y-axis.
Taking on board your suggestions I would be better to plot this data as a scatterplot. Accepting that I still need to break my axis at a relevant value of y (not x as shown in the figure) and have a log scale above this value and linear scale below. Somewhere below the smallest "positive" value of y seems sensible for this break. Can this be done using base r?
I guess something like this but with the split on the y-axis rather than the x-axis and in r of course.

Plotting a function on a date axis

In one column, I have a series of dates. In another column, I have a series of values. I'd like to plot the values on the y axis, and the dates on the x axis -- but I'd like a proper scale on the x axis, as some of the dates are distant by hundreds of days while some are only a week apart. So the points shouldn't be equally horizontally spaced from one another.
Use the XY (Scatter) chart type, which will display the dates proportionally. The other chart types (Column, Bar, Area, Line) will all display points equally spaced horizontally.

Resources