![]() ![]() ![]() % Display the position of the data cursor Here is a simple example of what you should get: function output_txt = DeletePoint(obj,event_obj) % Give it some meaningful name Give the function some meaningful name, and save it as a new. In the editor that opens add the following lines at the end: event_(event_=pos(1)) = nan Įvent_(event_=pos(2)) = nan #Delete plot command datagraph updateIf not, plot the data points and the lines as different objects, or use option 2 below.Īfter you create the figure, right click on one of the tooltips in the figure and choose Edit Text Update Function. The most GUI way I can think of is selecting the point using the 'Data Cursor' tool to see what are its' values and then replace the XData and YData property of this point to NaN, at the 'More Properties' button.Īlternatively, you can alter the callback function of the 'Data Cursor' to do this for you (you can see here another example).Ĭheck if the data points in your plot are a 'Scatter' graphic object, to do that type get(gca,'children') in the command window while the figure is chosen, and see if the first line of output is: You can use whichever logic you want to compute ind2rem, or even specify it manually. % (Option 3) Manual (watch out for indices out of bounds!) % (Option 2) Removing points in a certain interval: % (Option 1) Keeping every other datapoint: %% Choose which indices to remove, and remove. Then, assuming you loaded the figure and it is the current figure ( gcf), you can do: function q45177572 fig file, and have no handles to the plots/lines. I'll demonstrate how this is done in the example below:įor the purposes of demonstration, I shall assume that you're working with a. For charts with lines, this doesn't work (it creates discontinuities), and the appropriate points must be removed from the data vectors. When plotting unconnected points, you can replace either the XData or YData (or both) of the points you don't want by NaN. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |