changing name of x-axis for avplot - r

Using avplot in rStudio I created an Added Variable Plot.
I tried to change the name of the x-axis of the separate plots but can't figure out how to change them separately (so that every plot has the correct labelling of the x-axis).
Using xlab I could only change all of them at the same time with the same name.
My goal is to change the df$bis11_survey.Attention into "Attention" and so on.
I don't want to rename them in the data frame, only in the plot if thats's possible.
I added a screenshot of the plot
What command could I use that would let me change them separately?

Related

Set logscale for y axis in ggplot

I have used facet_wrap to build my plot as picture below:
After considering abit, I have used scale_y_log10 to transform my data (4 panels in the plot).
However, I realized that I only need to do the transformation for the first panel not the others since those values are very closed to 0.
My idea is to separate those values I would like to transform and combine them later on. I wondering that whether I can use scale_y_log10 for only one single panel created by facet_wrap so that I dont have to separate my dataset.
Thanks

Displaying plots in julia in notebook (using juliaBox)

I want to display a plot in the julia language (using iJulia).
But is doesn't show the plot.
Here is a minimal working example of what I tried:
using Plots
function testplotting()
x=[1,2,3,4]
y1=[1,2,3,4]
y2=[1,2,3,4]
plt=plot(x,y)
plot!(x,y2)
return plt
end
plt=testplotting()
display(plt)
println("finished")`
But is doesn't show the plot..
Without the line where I add the extra line to plot the other array it works, but I want to plot multiple variables at the same time.
Can anyone explain why it doesn't display or how to fix it?
Try plot!(plt, xlabel = "blabla").
plot! with a single argument implicitly modifies the "current" plot, which it gets by querying the current plot in global scope. Given that you are in a function scope, the global scope has no access to the plot you just created. Thus you need to specify which plot you want to modify.

dygraphs specify color of one series (R)

I have a bunch of series I'm graphing with dygraphs, but one of the series is special and I bold it
dySeries("meanOfMeans",strokeWidth = 4) %>%
but if I try
dySeries("meanOfMeans",strokeWidth = 4,color = "black") %>%
it turns every line in the graph black. Is there a way to just set one color?
Alternatively, is there a way to order the series first? right now the special series is showing up last, which means when the number of series changes, the meanOfMeans falls into a different slot, changing it's color. This is distracting.
If it can just be ordered in the first column, this would be a non-issue, because the color wouldn't change. Note that the series is in the first column in the actual data.table itself, but when I add the dySeries() line, it moves to the end.
You'll need to specify the color you want for each variable separately with a dySeries command for each.
As specified on page 20 of the dygraph package manual, "global and per-series color specification cannot be mixed."
https://cran.r-project.org/web/packages/dygraphs/dygraphs.pdf#page=20
As you found, if you specify only one color, regardless of what series it was specified for, dyGraph will color all of your series accordingly. If you specify some colors, but not all, the colors will not be correct.
As for the ordering of variables, variables will appear on the dygraph according to their dySeries command. When using the stacked version, dyOptions(stackedGraph=TRUE), the variable that is specified first will appear on the top, and the last will appear on the bottom.
I hope this helps :-)

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!!

How to name a particular curve plot in R

i have lines of different colors in a same graph. I want to name each line associated with a particular colour. I want the names displayed not in the graph, but on the right side outside of the graph. Does:
line(......,xname="This_Is_The_Name_Associated_With_BlueColourLine")
work? I think xname displays names on the lines itself. Please help.Thanks!

Resources