How to change the width of the boxplot frame in R - r

I am trying to change the thickness of the border containing the boxplot figure. Is there a way to do this in R? Attached is the image with an arrow pointing to the border that I am talking about whose thickness I would like to change illustration image
Thanks!

You can do that by overwriting the existing box with a heavier one.
boxplot(iris$Sepal.Length ~ iris$Species)
box(lwd=3)

Related

ggplot2 "borders" of filled points

So first: I'm wholly new to programming and this is my second(?) week of R, so apologies in advance.
I'm using pch=21 and using a fill color to show a factor, but I'd like to control the border size of the points.
Is there any way to increase the border size of pch 21? Or is there another way of adding borders to points that will allow me to control border size?
ggplot(mpg, aes(x=model,y=cty))+
geom_point(color="black",size=3,pch=21,aes(fill=manufacturer))
The reason this is a problem is because I'd like to use white filled points on a white background (it's just a common style in my field), but they're too hard to see unless I make the black border more distinct.

Transparent lines on 3D plot

Does anyone know how to make a 3D line plot where the lines are semi-transparent using Plotly or a different tool?
The 3D plot I am trying to create is here: https://plot.ly/~starhammer/238/
A 2D example of the transparency is here: https://plot.ly/~starhammer/274
This was achieved by adjusting the opacity parameter of the line in Plotly. I have tried changing the line opacity in the 3D plot but it doesn't seem to do anything,
Are you looking for something like this?
If yes, you can adjust your opacity by setting your own 'rgba' color ('a' stands for Alpha and defines the opacity).
From your workspace go to
TRACES => Style
under the Line section, click on the color button and set your desired 'rgba' color

Formatting the border between lattice panels in R

When making a multi-panel plot in lattice, each panel is by default bordered by a black line. I would like to be able to adjust the color and width of these panel borders. Bonus points if you can show how to add a colored border around specific panel(s).
For instance, this code makes a plot with three panels, one for each unique value of df$gears. Each panel is bordered by a black line.
library(lattice)
xyplot(mpg~hp|factor(gear), mtcars, layout=c(3,1), between=list(x=c(1))
,par.settings=list(axis.line=list(col="lightgray")))
This code almost does what I want. It changes the borders (and tick marks) of all panels to light gray. Is there a way to change the color of components independently (e.g., left and right axes)? Is there a way to address the formatting for each sub-panel independently?
Thanks,
Bryan

Highcharts display grid over plot with z-index

I'm trying to display a graph with the xAxis and yAxis grid lines overlayed on top of the plot.
I can set the zIndex of the plot, but there doesn't seem to be an option to set the zIndex of the grid.
If it's not possible, I can lower the opacity of the plot so that the grid shows through from underneath, but I'd rather not do it that way.
I can't find a way. Even setting zIndex on the series to -99 makes no difference. Have you considered using plot lines or plot bands to draw your own? These both support zIndex.
Update:
Original poster found that the highstock gridZIndex option works for highcharts.
http://api.highcharts.com/highstock#xAxis.gridZIndex

mschart: Different background colors for different y-value ranges?

Is there any way I can create a line chart using mschart where the chart area's background color changes for different ranges of y values?
For instance, a line chart would have a green background for y values 0 - 10, a yellow background for y values 10 - 20 and a red background for y values 20 - 30.
A gradient will not work, the colors must be solid.
I might have to use a background image, but I think there might be a better way. Unfortunately, web searches haven't turned anything up.
I've decided the only way to do this is to use a background image. Where needed I can use GDI+ to create the image at runtime with the proper height and width.
you can also use custom labels feature of MSchart.
int element = Chart1.ChartAreas["Default"].AxisY.CustomLabels.Add(0, 10,"Low");
element = Chart1.ChartAreas["Default"].AxisY.CustomLabels.Add(10, 20, "Medium");
element = Chart1.ChartAreas["Default"].AxisY.CustomLabels.Add(20,30,"High");

Resources