How to extract plots from Netlogo? - plot

I have to write a report about a model that I have built using Netlogo. I have made many plots of model's variables and I'd like to extract them and put them in my report to show how these variables vary upon the time. These variables represent what the change of some parameters imply. So, I'd like to obtain a better plot than netlogo's one, because netlogo's plots haven't got enumerated axis and I'd like plots with enumerated axis.
It would be amazing to put the plot in a word document or in a power point document

See the NetLogo dictionary entry for export-all-plots. The easiest way to access this is the menu File > Export > Export All Plots ... and then choose a folder/directory to store the file and a file name. You will then get a file in csv format that you can open in your graphing package (eg R, Excel).

Related

Plotting multiple variables in JMeter Custom Graph

Using the below configuration I am able to plot a variable in JMeter custom graph section.
But is there a way to plot similar multiple variables in same graph?
<sample_variables>var1</sample_variables>
<jmeter.reportgenerator.graph.custom_graph1.classname>org.apache.jmeter.report.processor.graph.impl.CustomGraphConsumer</jmeter.reportgenerator.graph.custom_graph1.classname>
<jmeter.reportgenerator.graph.custom_graph1.title>Test Custom Graph 1</jmeter.reportgenerator.graph.custom_graph1.title>
<jmeter.reportgenerator.graph.custom_graph1.property.set_Y_Axis>Response Times</jmeter.reportgenerator.graph.custom_graph1.property.set_Y_Axis>
<jmeter.reportgenerator.graph.custom_graph1.property.set_X_Axis>Over Time</jmeter.reportgenerator.graph.custom_graph1.property.set_X_Axis>
<jmeter.reportgenerator.graph.custom_graph1.property.set_granularity>60000</jmeter.reportgenerator.graph.custom_graph1.property.set_granularity>
<jmeter.reportgenerator.graph.custom_graph1.property.set_Sample_Variable_Name>var1</jmeter.reportgenerator.graph.custom_graph1.property.set_Sample_Variable_Name>
As of JMeter 5.5 it's not possible, however you can have multiple charts, one per Sample Variable
Also JMeter .jtl result files are basically CSV files so you can add another page and use i.e. Google Charts library for plotting whatever you want there.

Multiple prophet plots saved to jpeg in for loop (R)

I'm trying to, within a for loop, create and save multiple plots from fb prophet and save them to jpeg files.
Despite following the code for many questions related to saving R plots in a loop on stackoverflow, none of the solutions seem to be working and I can't figure out what I'm doing wrong. The below code would be within a for loop:
jpeg(filename="plot1.jpeg")
plot(model, future_forecast) + ggtitle(Material_name)
dev.off()
#now plot seasonalities
jpeg(filename="plot2.jpeg")
prophet_plot_components(model, future_forecast)
dev.off()
I expect that this code would create two separate plots using the prophet plotting functionality, and save them to jpeg files. What actually happens is that the program saves one plot file correctly, and a second plot file as a blank plot.
When you execute (or source) a script as opposed to running it line-by-line, some of the output is suppressed. This is what is happening here. In order to force the output of your plot, just enclose the statement within the print function.
For example:
print(prophet_plot_components(model, future_forecast))

save 3d graph to multiple format

I currently have a 3d graph and I would like to save the output in both png and pdf. Is there a way to save it in those format at the same time? I know there is a ggplot function that can save plot but I'm not sure how in base r.
As far as I know you will need at least 2 lines of code, if this is what you mean. I like to use the dev.print() function to save graphics. The function is saving a copy of the plot your are currently looking at. Please note that dev.print() copy the interactive window and not directly the plot as it is specified in the help section.
dev.print() example:
dev.print(png, "yourfile.png")
dev.print(pdf, "yourfile.pdf")
To know where your file is saved you can also get and set your working directory with those 2 functions :
getwd() and setwd()
You can also use the png() and pdf() functions to save plot specifically in those format.
Your question is probably a duplicate tho.

Editing multiple plots in Rstudio

One interesting feature of RStudio is it allows to save multiple plots generated from a script. This however opens up the problem of how to edit multiple plots. My issue at the moment is adding lines to histograms using the abline() function. This function was designed however to work with the last plot generated by the environment. One way of course would be ad the lines as soon as the plot is generated, however I have to calculate the coordinates at the end of the algorithm, by then I have transformed the data and generated multiple plots from it. So I was wondering if there isn't a way to tell R to search for a given plot and add the line to it. I read abline() documentation but found nothing regarding it. One can always save the data necessary to generate the plot and generate it at the end of the script, but I was wondering if there isn't a less consuming memory method.
One way to get around this issue is:
1.Save your graphics as variables, for ex: hist_1=hist(x, plot=FALSE)
2.Write any code u like, for ex: very complicated code give y as a number for output
3.plot(hist_1)
4.abline(hist_1, v=y)
gives a general idea of how to edit multiple plots without having to save multiple copies of datasets and without overloading Rstudio interface. Works well with the R ubuntu terminal too.

Plot Large data

I have a large file that contains two column data X,Y. I have got a round 20 million records. I want to graph the file in ggplot or even in normal plot (scattered plot). I used to read the file in R by using read command and store the whole data in a data frame, however, with the current size R can't read the file. I managed to plot the data in gnuplot by using every command to reduce the size. But I'd like to graph the file with R.
How to read the large file and plot it. I think reading the file line by line will not help because I want to graph the values. I'm not aware of any command like èvery in R.
Thank you for any suggestions.

Resources