Combining stacked bars within grouped barchart in R - r

i am quite new to R studio and I just can't figure out, how I can combine stacke bar and a normal barplot...I know the question has been answered before - but i do not work with ggplot yet (its too complicated for me right now.. will try my best to understand it another time).
This is how my graph looks like now:
enter image description here
This was my coding to this graph:
par(font.axis=2)
par(mar=c(5,4,6,8))
barplot(as.matrix(data), beside = TRUE, ylab="number of cells / well",
ylim=c(0,350000),cex.axis=1,cex.lab=1.25,col=c("darkorchid4","gainsboro","darkolivegreen4"),
legend("topright",c("alive","dead","sawed cells / well"),
fill=c("darkorchid4","gainsboro","darkolivegreen4")))
What i actually want is that "alive and dead" are a stacked bar, and sawed cells is a normal bar plot beside the stacked bar... ist that even possible?
Thanks for any help :)
This is my Excel sheet that i've worked with
enter image description here

Related

Trying to make a paneled spaghetti chart with highlighted line

I'm trying to make a graph like the one found here at the very bottom: https://www.data-to-viz.com/caveat/spaghetti.html
unfortunately I have a character variable instead of a numeric one for the x axis (I have four years by months), and I don't get the grey lines as in that graph per panel. Does anyone know how else to obtain that graph?
It's hard to say without more details/an example, but it seems like you should be able to do this using the gghiglight package. There's a facetted example half way down this page.

Spacing Between Multiple X-Axes in JFreeChart

I'm attempting to try and increase the vertical spacing between multiple x-axes using JFreeChart. Currently, my charts look like this:
Current chart
However, I need to produce something like the following so that the x-axes are more clearly defined (note that the vertical spacing between the x-axes is larger than in the first image):
Desired chart
Does any one have any idea on how to do this? I've been searching the JFreeChart API for > 2 days now and can't find anything that directly addresses the issue other than attempting to use org.jfree.chart.axis.AxisSpace in some way.
Many thanks for any help!
One approach would be to customise the axis label insets (that is, increase the space below each axis label).
http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/Axis.html#setLabelInsets-org.jfree.ui.RectangleInsets-

How to draw pie of pie or bar of bar charts in R (using ggplot2)? [duplicate]

I know it is possible to create such double pie charts in excel like this:
http://chandoo.org/wp/2009/12/02/group-small-slices-in-pie-charts/
but can SPSS or R do this also?
In relation to R:
The answer to the title question is "yes" ... see ?pie
As for the second question, the one in the body - it would be possible but would involve some coding. You'd have to draw two pie charts side by side (which could be managed with two calls to pie) and use segments or arrows (and text if necessary) to do the additional components of the plot.
Here's a rough example:
That required the fig argument of par to get them side-by-side.
(That example required a little fiddling to get right, but it would be possible to write a function to automate the details.)
The main issue I can see would be 'why on earth would you do it?' -- pie charts are a poor way of conveying information of this form. There are alternatives that result in much better ability to distinguish values, and less bias (such as what you get when comparing nearly horizontal vs nearly vertical slices).

LocusZoom standalone change x-axis and use the plots in a script

I am using the standalone LocusZoom software,but I am having two problems:
I have to create a plot showing only position on the x-axis (not showing the genes). If I just use showGenes=FALSE with nothing else the genes still appear, but if I use rfrows=0 then the genes are not shown, but the problem is that also the x-axis label with the positions disappears. Is there a way to only show the position label? It looks like the only way to do this is to modify the original script...
Is there a way to use several plots created using LocusZoom in an R script to position many plots into one unique figure? (output is a pdf for now) There is an option listed in the LocusZoom webpage (http://genome.sph.umich.edu/wiki/LocusZoom_Standalone) called "prelude" but I cannot get more info on how to use it.
If you have any suggestions for either of these two issues it would be very helpful! Thanks!!

ASP.NET charts trend line

I have basic bar charts showing some value (1 value per chart) on each day. The charts are rendered using standard MS ASP.NET charts.
Now I would like to add a trend line. Has somebody done such thing and would be so kind to give me some hints how to approach this task? I know how to add a line to the chart, just would like to know whether someone already did such thing.
If I have understood the question correctly, you want to show a line graph using the same values that each bar is drawn.
You can do this by adding one more series with chart type as line to the same chart area.
Make the Y-axis for the series as secondary and keep X-axis as primary (to keep same X-axis values for both Bar & line graph). Or you can also make X-Axis of this new series as Secondary (this will show labels on top of chart area) .

Resources