-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output Plots Font #222
Comments
Hi @ericward-noaa! Thanks so much for pointing me to this issue number. I am modifying the code within the "R" folder that comes inside of the "MixSIAR-master" folder that I downloaded from Github. How do I direct R to read these specific code files? Sorry, I'm semi new to R and am still figuring out package structures and how RStudio is reading packages. It seems like RStudio is reading from GitHub instead of the MixSIAR folder sitting on my desktop. Also, am I correct in assuming I will have to add a text size variable inside of the geom_text function on lines 113, 137, 163, 185, and 207 of the plot_data_two_iso file? Additionally, which R file controls the scaled density plots? |
P.S. I’ve been playing with the text code within my own forked repository but haven’t had any luck getting the GUI to produce an isospace plot with text change. I have reinstalled MixSIAR several times from my own repository. Any advice you have would be much appreciated. Thank you. |
Hi Dustin, All you should need to do is follow Eric's code in #220 to get the ggplot object
Not sure exactly what you want to modify... the above covers several. Also, the original png was the default low res, this is 300 dpi. |
Hi @brianstock. Thanks so much for the clarification. This is exactly what I was wanting to do. I'm assuming if I add text = element_text(size = 15) to the ggplot2 call, it will increase the text of the prey item types within the isospace plot. Is this true? My final question is how to do this same editing on the density distribution plots that are produced after running the model? Is there a similar type of walk through that results in a ggplot call? Thank you again for all of your help. |
unable to get your code to work for this operation where I can modify I even updated to R to version 4.0.0 but still has problems with your first line of code in both version 3.5.3 and 4.0.0 under version 3.5.3 the error is Please download and install Rtools custom from http://cran.r-project.org/bin/windows/Rtools/. under version 4.0.0 the error is i'm not sure what to do now |
That error was resolved for me when I installed Rtools. It is a necessary install for some R packages. You should visit the cran link that R has provided to install the software, then run writeLines('PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"', con = "~/.Renviron") in RStudio. |
thanks icer182 this is not clear to me, specially since I dont use Rstudio |
@jrfrun no worries. I would recommend upgrading your R to version 4.0 and then run Rtools40. Rtools is R package specific. If you don't feel like doing this, there should be an older version of Rtools that you can download for R 3.5.3 https://cran.r-project.org/bin/windows/Rtools/history.html. |
I appreciate your help, but I already had version 4.0 and under that version I did not have the Rtools issue, the issue I had under 4.0 was regards |
@jrfrun it looks like you have both R 3.5.3 and 4.0.0 installed. Try uninstalling R 3.5.3 and then run an update on rlang in RStudio. You can do this in the screen on the lower right hand side of RStudio. Select the packages tab and then click update. If nothing else, just remove rlang and reinstall it. |
We will stay tuned to hear back from @brianstock about modifying the density distribution plots. @jrfrun, I hope you have been able to fix your issue. |
@icer182 For the posterior density plots, no, there isn't a similar function argument to return the @jrfrun |
@brianstock, thank you for the advice. If I download the repository, how do I then point RStudio to read the modified output_Jags.R file instead of the one originally installed using the install_github(brianstock/MixSIAR) command? |
You can run |
@brianstock Thanks for the explanation! I am still learning R, so this has taught me something new. I appreciate your help. |
@brianstock yes I am able in R 4.0.0 to run library(remote) with no problem icer182 I appreciate your suggestion of uninstalling my other R version 3.5.3, regards |
icer182 I went in and uninstalled R 3.5.3 since I had it in addition to R4.0.0 and you had suggest I was getting an error with rlang because of the presence of both versions, but now having only R4.0.0
|
I reinstalled rlang and I got past that error :) but the next error in that code that brian provided is
|
Interesting. I'm not getting that error and instead receiving this one. file("") only supports open = "w+" and open = "w+b": using the formerError in read.table(file = file, header = header, sep = sep, quote = quote, : |
interesting, seems this code that will enable mixsiar is not sufficiently stable or robust enough |
I don't think that is the case. We are just missing some declaration or have incorrectly stated a variable. I am replacing code with my actual csv files. |
maybe, but I am not replacing anything just yet, I am trying to run exactly what Brian provided |
I'm not sure why it isn't working for you. The default code above worked for me |
icer182 just weird I just tried it now and it worked |
I solved the above issue by modifying this line "mix.filename <- system.file("extdata", "killerwhale_consumer.csv", package = "MixSIAR")" to read "mix.filename <- "yourfile.csv"" |
Hi @brianstock. I've finally had success with generating the new isospace plot, but can't figure out how to control for size of the source.labels. I have found the geom_text relating to those labels, but that line of code will not allow me to insert any size based information within the aes. Should this be going outside of the aes instead? or what would you recommend for controlling the font size for the source labels? |
Similarly, in the output_jags.R file under each ggplot there is a labs() function. would labs(title = my.title, text(my.title, cex = 1.5)) increase the text of the title? Please clarify @brianstock. Thank you! |
well I am making progress, I was able to use code to generate my isoplot but seem to have trouble storing it in g and applying modifications. it plots on the screen but does not save it to g where it can be manipulated by later commands
Error: object 'g' not found
|
Hi @jrfrun. Your feature to store g should not be manipulated because you provide the statement to store the type of font in the png function below. Make sure your original declaration of g still looks like this: g = plot_data(filename="isospace_plot", plot_save_pdf=F, plot_save_png=F, mix,source,discr, return_obj=T). Try changing "orig_plot" back to "isospace_plot" and see if that helps. |
icer182 thanks for the input, i'll try that but all this seems a little unclear |
Hi @brianstock. I just wanted to check in again about the function needed to adjust the size of the source label text in the isospace plot and the title (in my case groups small medium large) of the posterior density plots. I found the code for each, but am having a difficult time determining what function is needed and how that function should be implemented. Please let me know. Thank you. |
I don't want to discourage you from using the MixSIAR Issues page... but this is a relatively straightforward ggplot2 question, not specific to MixSIAR. In ggplot functions, stuff inside |
Hi Brian,
I am trying to publish some MixSIAR figures for my dissertation and one of my committee members has a problem with the font size for the isospace plot and density distribution plots. I am using 2 tracers and have dug into the code for 2 tracers and the posterior plot, but am unsure where to add the pointsize variable. Can you please provide some insights about how I can quickly increase font size of the output plots? I am currently running MixSIAR 3.1.10 on Windows. I was unable to ascertain the answer from the previously asked questions.
Thank you,
Dustin
The text was updated successfully, but these errors were encountered: