How to extract plots as graphs in netlogo? - netlogo

I want to export my plots into an excel sheet file using netlogo file-write commands
The problem is it only exports the x's and y's values, while I need the plots to be graphed since I have many of them.

The NetLogo dictionary (at https://ccl.northwestern.edu/netlogo/docs/dictionary.html and in the Help Menu) has several export primitives. One of these is export-view, which exports in png format.

Related

Issue getting gscatter to separate by group

I want to create an understeer plot from telemetry I have for a corner of a racing circuit. I am trying to plot 'GPS Speed' against 'Steering Angle' where group is the 'Run' (i.e WarmUp, ConstantSpeed, Endurance1 or Endurance2).
MATLAB code
The data I have is for several laps of the whole circuit so I have split it into the relevant data points for each lap. When I run the script, it does produce a scatter graph with all the data but it only displays the group of the last plot and applies the same colour to all:
Is there a way I can fix this? I wondered whether if I could import the specified columns from the csv file into a matrix first as I would then only require one gscatter plot to display everything I require.

Linking plotted data with color and size sources in MATLAB

This question is related to the question posted here, in which I outline a problem I'm facing regarding rapid visualization of 3D scatter plotted data in MATLAB during a simulation. (Sample code and data are also provided there.)
As an alternative to setting the XData, YData, ZData, SizeData, and CData properties of a 3D scatter plot in MATLAB, I'm wondering if it's possible to have all of their corresponding sources be dynamically linked to points that are 3D scatter plotted. The linked values would be queued into a buffer and plotted periodically (say, every 0.5 s). From what I understand, the sources are refreshed in the background, so plots with linked data would not slow down the simulation. From what I see in the documentation, only XDataSource, YDataSource, and ZDataSource are specified. Is dynamically linking the size and color data sources also possible, and if not, is there a simple workaround?
As a reminder, I'm using MATLAB R2016a on Windows 7.
Is dynamically linking the size and color data sources also possible, and if not, is there a simple workaround?
Yes, it is possible using the similarly named properties
SizeDataSource
CDataSource
These properties are set to the string names of the variables you want linked for updating. Then, with linking on, subsequent updates to these named variables will be reflected in your plots ever 1/2 second or so (at the fastest).
But, there is a big caveat here with your specific example.
The xxxxSource fields are typically initialized at the outset, when a graphic handle is created. This would be in your initial scatter3 calls.
The issue is that you have eight separate scatter plot handles, each referencing the same variable(s), but with different indexes. That is, you are updating the indices into these variables to produce your images.
A brute force way to use parameter linking here would be to create eight different variable names and link each to its corresponding scatter plot handle.
I think the cleaner solution is to use a timer callback to update things on a set time interval.

Uploading 3D interactive MATLAB mesh plot to ShareLaTeX

I've been working on a project about magnetic fields for my university, and at some point in the MATLAB simulation code I'm creating an interactive mesh plot of the magnetic field at certain points in space. I was wondering as to how I should convert this MATLAB figure to something that I can integrate in a LaTeX pdf. I've read about the media9 package, and I think I'll manage to figure the inserting the file in my .tex file out once I get the figure in an "exportable" form, but I'm not sure as to what I should convert my plot to and how I can do that.
Thanks in advance!

Matlab figures: Which format to reuse in Matlab?

I have two scripts that produce some plots. I want to reuse those figures in another script, which will create subplots with the plots from the first script on the left-hand side, and plots from the second script on the right-hand side.
I tried to save the figures from the first scripts in tiff and then loading them in the last script, but the result is blurry (probably due to resizing). Which format should I use to save the figures with the first scripts?

How to apply different line styles automatically to arrays in when plotting Matlab

Is it possible to make Matlab to apply different line styles automatically as it does with colors when told to plot a higher dimension array?
For example:
plot(t,X1(:,4:6))
Creates a plot with three lines of different color. Can Matlab do the same thing with line styles? Even if it is something like:
plot(t,X1(:,4:6),{':','-','-*'})
I'd rather not have to go and call a plot command for each 1D array individually and assign a line style there if I can help it. I'm working with legacy code that has a ton of calls without line styles already, each plotting a half dozen lines. It would take a while to do manually and I have to think Matlab can do something smarter
Thanks!
You can do it in one command, but you still have to assign the style separately.
plot(t,X1(:,4),':',t,X1(:,5),'-',t,X1(:,6),'-*')
The other option you have is to write your own function that goes through a for loop and plots each one with different styles.