I have a following simple code with two sine waves
I have two questions regardng the plot
1. Is there a way to print an index (1,2,3...) of a datapoint on the plot?
2. Is there a way on how to make the lines Bold or to increase thickness?
Plot help instruction do not work (or I am using it wrong). Any examples fro
both would be much appreciated.
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
1) Yes, but there isn't a built in way, as far as I know. Using a bit of a hack (I'm never great at manipulating cell arrays), you can use the text command to add text (in this case the indices) to specific points on the plot, like so:
indices = 1:length(t);
indices_cell = mat2cell(indices, 1, ones(1, length(t))); % there is probably a better way to make a cell array
indices_strings = cellfun(@num2str, indices_cell, "UniformOutput", false); % takes every number in the cell array and maps it to a string
text(t, x, indices_strings) % adds the strings to the coordinates (t,x) you may want to adjust them by adding or subtracting some value to make it look nicer?
2) Change the linewidth property using the plot command, like so:
Hope this helps,
James Sherman Jr.