Convert plotted graph to (x,y) coordinates?

16 visualizaciones (últimos 30 días)
Felipe  Schuback
Felipe Schuback el 8 de Ag. de 2017
Comentada: Walter Roberson el 11 de Ag. de 2017
Hi all,
I have a plotted graph and I wanted to know if it is possible to "convert" the plot by the graph() function to a plot in a (x,y) axis (like a scatter plot), but it is very important that is preserves the look of the plot! Is this possible in any way?
Thank you very much!
  16 comentarios
Felipe  Schuback
Felipe Schuback el 11 de Ag. de 2017
I managed to do the individual coloring by inputting a color matrix when I call the scatter function. Is it possible to change the line colors in the scatter plot? Set all of them to black, for example?
Walter Roberson
Walter Roberson el 11 de Ag. de 2017
Ah yes, I forgot for a moment about specifying the individual colors for scatter().
scatter() plots do not have line colors.
If you are referring to quiver(), then you can use the 'Color' option to set the same color for all of the lines; however, it is not possible to use different colors for different lines in any one quiver() call.

Iniciar sesión para comentar.

Respuestas (1)

José-Luis
José-Luis el 10 de Ag. de 2017
It ain't pretty but it works. As far as I understand there are no simple options you can set to get the look you want.
data = rand(10,4);
qH = quiver(data(:,1),data(:,2),data(:,3),data(:,4),0);
hold on
qH1 = quiver(data(:,1),data(:,2),data(:,3),data(:,4),0);
colorVector = rand(1,3);
qH2 = quiver(data(:,1),data(:,2),data(:,3),data(:,4),0);
colorVector = rand(1,3);
qH.LineStyle = '-';
qH.Color = colorVector;
qH1.LineStyle = '-';
qH1.Color = 'w';
qH1.ShowArrowHead = 'off';
qH2.LineStyle = '--';
qH2.Color = colorVector;
qH2.ShowArrowHead = 'off';

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by