Drawing hyperbola using patch function.
Afficher commentaires plus anciens
I have to draw points in matlab which show trade-off (i.e, inversely relationship) for this reason I have to draw the hyperbola-like shape. I used the code shown below to draw points by using patch file now I need to hyperbola by using patch function.
% line([.1 .1 6 6 .1 .1],[.81 2.735 164 48.6 .81 2.735],'Marker','*','Color','k','LineStyle','-');
% line([4 4 6 6],[57 95 57 95],'Color','b','LineStyle','-');
patch([1.5 13.84 1.5],[13.8 1 288],'c','LineStyle','-')
%%%%%%%%%%%%%%%%P2 %%%%%%%%%%%%%%%%%%%%
x = [0.76 0.69];
y = [0.78 0.83];
annotation('textarrow',x,y,'String','P_{2}(29,405)')
% % %%%%%%%%%%%%%%%%%%%%P1 %%%%%%%%%%%%%%%
x = [0.65 0.60];
y = [0.47 0.55];
annotation('textarrow',x,y,'String','P_{1}(24,288)')
% % %%%%%%%%%%%%%P3%%%%%%%%%%%%
x = [0.76 0.69];
y = [0.60 0.65];
annotation('textarrow',x,y,'String','P_{3}(29,334)')
6 commentaires
Walter Roberson
le 18 Mai 2017
Why does it need to be patch()? Do you need to draw a line that changes color? Do you need to texturemap on top of it? Do you need to make semi-transparent lines?
Have you considered using fill() or area() ?
shane watson
le 19 Mai 2017
Walter Roberson
le 19 Mai 2017
Have you considered using area() ? It creates a patch() but with a syntax that is more convenient.
shane watson
le 20 Mai 2017
Walter Roberson
le 20 Mai 2017
Are you looking for something that draws an area, or are you looking for something that draws a curved line?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!