Borrar filtros
Borrar filtros

Display Markers At Specific Data Points

60 visualizaciones (últimos 30 días)
Tahir Afareen
Tahir Afareen el 18 de Nov. de 2019
Editada: Steven Lord el 25 de Oct. de 2023
Greetings
when i run this comman
plot(t_010_tbc_r_002,stress_010_01,'-o','MarkerIndices',1:10:length(stress_010_01))
it gives me this error
Error using plot
There is no MarkerIndices property on the Line class.
Error in Results (line 194)
plot(t_010_tbc_r_002,stress_010_01,'--o','MarkerIndices',1:10:length(stress_010_01))
reasons???
  2 comentarios
Erivelton Gualter
Erivelton Gualter el 18 de Nov. de 2019
It does not seems to be wrong.
Run the following code and see if it works fine:
x = linspace(0,10);
y = sin(x);
plot(x,y,'-o','MarkerIndices',1:5:length(y))
Tahir Afareen
Tahir Afareen el 18 de Nov. de 2019
same error
Error using plot
There is no MarkerIndices property on the Line class.
Error in New_Curve_02 (line 3)
plot(x,y,'-o','MarkerIndices',1:5:length(y))

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 18 de Nov. de 2019
The MarkerIndices name-value pair is relatively new.
If you do not have it, it is straightforward to do that with a second plot call:
figure
plot(t_010_tbc_r_002,stress_010_01,'-b')
hold on
plot(t_010_tbc_r_002(idx),stress_010_01(idx),'ob')
hold off
Experiment to get different results.
  2 comentarios
Tahir Afareen
Tahir Afareen el 18 de Nov. de 2019
Thank you very much Star Strider. It works.
figure
plot(t_010_tbc_r_002,stress_010_01,'-b')
hold on
plot(t_010_tbc_r_002(1:10:length(t_010_tbc_r_002)),stress_010_01(1:10:length(stress_010_01)),'ob')
hold off
Star Strider
Star Strider el 18 de Nov. de 2019
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (1)

the cyclist
the cyclist el 18 de Nov. de 2019
Editada: Steven Lord el 25 de Oct. de 2023
The marker indices functionality was introduced in version R2016b. If you have an older version, then you'll get an error.
You can find a suggested work-around in this question.
[SL: fixed typo in version number]
  1 comentario
Tahir Afareen
Tahir Afareen el 18 de Nov. de 2019
Thankyou for pointing that out.
Found the reason, I am using R2016a

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by