Arrow between two subplots

15 visualizaciones (últimos 30 días)
Robinson Medina Sanchez
Robinson Medina Sanchez el 25 de Mayo de 2018
Respondida: Hasan Alrajhi el 4 de Ag. de 2019
I have a very simple question. I have a scope (in simulink) with three different subplots inside. I want to add some arrows to it, so I used the "print to figure" option. Once I have the figure, I added the arrow using the insert-> arrow, but I cannot extend it over more than one subplot. I tried to used the annotation command in the workspace but it doesn't draw anything:
annotation('line',[0.03050,1],[0.1645,0.5],'color','r','LineWidt',1)
Any idea what am I doing wrong? Thanks in advance for your suggestions.

Respuestas (2)

per isakson
per isakson el 26 de Mayo de 2018
Editada: per isakson el 26 de Mayo de 2018
See Line Properties. Set the value of the property
Clipping — Clipping of object to axes limits
to off. Doc says:
Clipping of the object to the axes limits, specified as one of
these values:
'on' Do not display parts of the object that are outside the
axes limits.
'off' Display the entire object, even if parts of it appear
outside the axes limits. ...
  2 comentarios
Robinson Medina Sanchez
Robinson Medina Sanchez el 30 de Mayo de 2018
Editada: Robinson Medina Sanchez el 30 de Mayo de 2018
Thank you for your answer. However, it still does not seem to work. I have attached an example of the figure. I want to draw an arrow from the text block B to the text block I. This is what I am doing:
figure=gcf; figure.Clipping='off';
axes1=gca; axes1.Clipping='off'; %same for the other axes
After that I use insert-> arrow, however I still cannot extend the arrow from one sub-plot to the next. There is also no clipping property in this arrow.
Once again, any hint is appreciated.
per isakson
per isakson el 30 de Mayo de 2018
"I have a very simple question." It appears to be simple, but I fail. Caveat: I'm not up to date with the new graphic stuff.
Simple experiment on R2017b:
subplot(2,1,1)
subplot(2,1,2)
arh=annotation('arrow', [0.1,0.9 ],[0.1,0.9] )
arh.LineWidth = 5;
arh.Color = [1,0,0];
>> arrowParent = arh.Parent ;
>> arrowParent.Type
ans =
'annotationpane'
>> arrowParent.Parent
ans =
Figure (1) with properties:
I had little success with your figure:
  • missing tileGrid throw an error when I tried to open the figure. I added an empty function, which helped to open the figure.
function tileGrid( varargin )
end

Iniciar sesión para comentar.


Hasan Alrajhi
Hasan Alrajhi el 4 de Ag. de 2019
annotation('arrow',[0.463690476190475 0.5703125],...
[0.518164960688327 0.922118380062305],'Color',[1 0 0],'LineWidth',5)

Etiquetas

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