|
|
Using Slider on a Plot
Hi,
I asked this before and searched a lot of times but i couldn't find a solution.
My want to plot 3 graphs and change one of them's value with a slider. But each time I use the slider to change the value, it plots another graph and keeps the old ones (like this: http://i40.tinypic.com/2uelhcl.jpg).
Here is my files: http://duckload.com/download/465993/untitled.rar
I will be very happy if anyone can fix it or give me an example file. Thanks for your help.
Regards
|
|
0
|
|
|
|
Reply
|
Nuri
|
4/3/2010 9:24:05 AM |
|
any help?
|
|
0
|
|
|
|
Reply
|
Nuri
|
4/3/2010 11:08:04 AM
|
|
Hi Nuri,
What you should do is find the handle of the green line you would like to move.
The way to do it is the following:
1. When you plot the green line the first time, in your slider1_CreateFcn, keep its handle by
lineHandle = plot(... % your green line plot.
2. Then carry this on to your other callbacks by putting it into the handles structure:
handles.greenLine = lineHandle;
guidata(hObject, handles);
3. Now, in slider1_Callback, retrieve this handle:
lineHandle = handles.greenLine;
4. Once you do that, you can now modify the xData and yData properties of your line using the variable lineHandle. Something like:
% new values according to slider value
newXData = ...
newYData = ...
set(lineHandle,'xData',newXData,'yData',newYData);
This way, you are updating the data of your line, rather than making a new line.
Best.
|
|
0
|
|
|
|
Reply
|
Sadik
|
4/3/2010 3:17:23 PM
|
|
|
2 Replies
637 Views
(page loaded in 0.051 seconds)
Similiar Articles: Using Slider on a Plot Follow - Computer GroupHi, I asked this before and searched a lot of times but i couldn't find a solution. My want to plot 3 graphs and change one of them's value with a slider. using gui slider to display 3d image stack - comp.soft-sys.matlab ...Using Slider on a Plot - comp.soft-sys.matlab Slider in GUI - comp.soft-sys.matlab Using Slider on a Plot - comp.soft-sys.matlab Slider in GUI - comp.soft-sys.matlab using ... Plotting A Motion Chart - comp.soft-sys.matlabIf I have a set of data points, X,Y,Z, and T(time), how can I plot a 2d/3d graph and have a slider so that the graph changes with respect to the T dat... Plot 2D graph by reading .dat file - comp.soft-sys.matlab ...Using Slider on a Plot - comp.soft-sys.matlab Using Slider on a Plot - comp.soft-sys.matlab Using Slider on a Plot - comp.soft-sys.matlab Plot 2D graph by reading .dat ... How can I plot or display a 3D densitiy? - comp.soft-sys.matlab ...using gui slider to display 3d image stack - comp.soft-sys.matlab ..... display ... using gui slider to display 3d ... sys.matlab Using Slider on a Plot - comp.soft-sys ... plot of fft2 of M x N - comp.soft-sys.matlabUsing Slider on a Plot - comp.soft-sys.matlab Hi, I asked this before and searched a lot of times but i couldn't find a solution. My want to plot 3 graphs and change one ... Slider in GUI - comp.soft-sys.matlabDisplay result in GUI - comp.soft-sys.matlab Slider in GUI - comp.soft-sys.matlab Using Slider on a Plot - comp.soft-sys.matlab Slider in GUI - comp.soft-sys.matlab using ... plot scroll bars, x-axis spacing - comp.soft-sys.matlabInstead of horizontal panning, use horizontal scroll bars. 2. Have the initial figure/plot view x-axis spacing set to a value that allows more space between data ... Changing 3D plot view angles in a gui axis - comp.soft-sys.matlab ...Using Slider on a Plot - comp.soft-sys.matlab Set icon for GUI figure - comp.soft-sys.matlab Changing 3D plot view angles in a gui axis - comp.soft-sys.matlab ... Matlab on Android - comp.soft-sys.matlabUsing Slider on a Plot - comp.soft-sys.matlab Matlab on Android - comp.soft-sys.matlab I am using Matlab on Windows, which means the MatlabRuntime will be a *.exe. ... 3D ... Using Slider on a Plot - comp.soft-sys.matlab | Computer GroupHi, I asked this before and searched a lot of times but i couldn't find a solution. My want to plot 3 graphs and change one of them's value with a slider. plotting - Using a Slider to manipulate a Plot - MathematicaIt doesn't work for a few reasons: The syntax for Slider is not correct. It should be Slider[a, {0, 4}] The variable a needs to by Dynamic so that it is updated when ... 7/24/2012 1:07:12 AM
|
|
|
|
|
|
|
|
|