Open etbartell opened 5 years ago
@etbartell I have same questions as your number 2 and 3
I also wanted to change colors Main title and Axis title I tried various combinations, nothing seems to be working.
The best thing to do with these functions is type args(axis)
or help(axis)
to get some of the options.
> args( axis )
function (side, at = NULL, labels = TRUE, tick = TRUE, line = NA,
pos = NA, outer = FALSE, font = NA, lty = "solid", lwd = 1,
lwd.ticks = lwd, col = NULL, col.ticks = NULL, hadj = NA,
padj = NA, ...)
I believe you need something like:
axis( side=1, at=c(1920,1950,1980), labels=c(1920,1950,1980) )
For colors, col= controls tick marks, and col.axis= controls labels.
axis( side=1, col="blue", col.axis="red" )
@etbartell nothing interactive on this lab. That is next week!
Hi everyone! I am trying to add two different sized text into my plot. I have this:
text( x=1924, y=2.7, label="League Average \n1924", cex=1.5, col=1 )
text( x=2012, y=7.5, label="League Average \n2012", cex=1.5, col=1 )
... but I am trying to add the bigger text for the year, like on the sample graph. How do I add that into the code to be in the same spot as that League Average text, but be a different color and size? Thanks!
That's a little tricky. If you have a vector of strings, you can apply different sizes (cex=) to each. But with one string you can only specify one size.
The easy fix is to plot two lines of text.
text( x=1924, y=3.5, label="League Average", cex=1.5, col=1, pos=3 )
text( x=1924, y=2.7, label="1924", cex=2, col=1, pos=3 )
I'm not sure what the exact values of Y you would want here. But I think you get the idea.
The pos=3 will center the text above the point might be a little easier to fine tune.
@lecy Gotcha, thank you so much!
I had a couple of questions about lab 3:
1) Is there a way under the plot.new function to change where tick marks are drawn on the x-axis? I've tried a few things including:
2) Is there a way to include the subtitle or axis titles anywhere except their default positions (for example, the sub-title is defaulted to the bottom)?
3) Do we need to include the interactive legend with the option to show individual teams?
Thanks!