From: redclab on 19 Jan 2010 09:17 Hi, I am creating a GUI that plots different 2D-equations depending on the user input: the user selects from a listbox which equation wants to plot, and depending on the one chosen, he has to fill in all the variables required for that equation to be plotted, pushes the plot_pushbutton and the result shows in one of the axes. In the main screen of my gui I have 2 axes, but if the user wants to, it can be plotted in new popup windows (figures)(the user chooses where to plot) Well, my problem is: lets say I have plotted 3 equations (3lines) in one axis, but now the user wants to change the color of the first line...is there a way for the user to select a line plotted inside the axis by clicking on it?? I tried with uisetcolor but it only changes the last one that its plotted as the other ones dont get stored anywhere... Hope I explained myself.... Maybe its an easy thing but I just cant see it!! Thanks in advance
From: Paul Mennen on 19 Jan 2010 13:24 "redclab " wrote: > lets say I have plotted 3 equations (3lines) in one axis, but now the user wants to change the color of the first line...is there a way for the user to select a line plotted inside the axis by clicking on it?? I believe you would have to save the line handles returned from plot or plotyy or whatever you used to create the plots. Then create a buttondown function for those line handles so that the user can change the color of a line by clicking on it. Another way that may help you is to use "plt", an alternative to plot and plotyy available from the file exchange. With plt just click on the line you want to change and then select "Edit line" from the color menu. (There are also mouse and keyboard shortcuts for this). Then you can type in the new color you want into the edit box (as a color triple) or use the color sliders and color palettes to find the color you want. Note that from this menu you can also change other characteristics of the line (thickness, style, markers, cursor properties, etc.). If you decide to download plt.m from the FEX, I'd recommend trying the included demo (pltdemo.m) and looking at the help file (plt.chm). ~Paul
From: redclab on 20 Jan 2010 04:30 Hi, Thanks for the response. I took a look at the plt but Im actually using loglog to plot as I need logarithmic scales... So about the other option, to save the lines handles returned by plot...Ive been thinking about it but I really dont know how I can do it as I can have infinite lines plotted and only one loglog(x,y) ...should I make it with loops to store it?? Thanks!!
From: Paul Mennen on 23 Jan 2010 12:50 "redclab " wrote > Thanks for the response. I took a look at the plt but Im actually > using loglog to plot as I need logarithmic scales... Thanks for trying plt.m. It's interesting that with the hundreds of options that plt has you assumed that there wasn't an option for something as trivial as selecting logarithmic scales for the x or y axes. (It's in the options parameter). Also you can change between linear and log scales for either axis interactively by clicking on the Lin/LogX and Lin/LogY tags in the menu box to the left of the plot. I guess I've got to make my documentation clearer if you missed that. Oh well, it appears you managed to get your buttondown functions to work eventually and your problem is now solved. ~Paul
|
Pages: 1 Prev: double to long int type change in Mex Next: remove labels of bode diagram |