How to display specific points and values?
Afficher commentaires plus anciens
Hello
Could someone please help me figure out how to display specific points and what their values are? I have attached my code for your review and I have also enclosed what I am trying to achieve.
What I am trying to achieve: https://app.box.com/s/ptsahwxxehjkra8in71t9qtofd3cfoie
What I currently have: https://app.box.com/s/dz2easl852afn5v05pz3xnzw270efwcf
I am trying to get lnGamma1 to display at infinity and lnGamma2 to display at infinity as well as shown in the picture above with their values. I am also having issues with why the top xaxis not displaying if someone could help me with why that doesn't show up as well.
Thank you
clc; clear all; close all;
x1=[0:.1:1];
GERT=-1.8*x1+x1.^2+.8*x1.^3;
lnGamma1=-1.8+2*x1+1.4*x1.^2-1.6*x1.^3;
lnGamma2=-x1.^2-1.6*x1.^3;
hold on
plot(x1,GERT)
yyaxis left
plot(x1,lnGamma1)
ylabel('GE/RT lnGamma1')
ylim([-3,0])
yyaxis right
plot(x1,lnGamma2)
ylabel('GE/RT lnGamma2')
title('GE/RT, lnGamma1, lnGamma2 vs. Mol Fraction')
xlabel('Mol Fraction')
legend ('GE/RT','lnGamma1','lnGamma2','location','southeast')
hold off
Réponses (2)
Massimo Zanetti
le 7 Oct 2016
To display also top axis, use
box on;
I didn't get what is the other problem. Can you explain better?
d.c
le 7 Oct 2016
0 votes
Hello Massimo
Thank you for responding so quickly, I will do my best to clarify what I am looking to achieve. I posed 2 links the first link is of the solution and the 2nd link is of my work. If you look at the solution (1st link) it shows on the yaxis to the left ln(symbol)Gamma1^infinity and on the right it shows ln(symbol)Gamma^infinity. I am trying to get the points on my solutions the (2nd link) to appear. So where x=0 and where the line intersect, that point and the same thing for x=1 and where the line intersect on the right y-axis.
I hope that helps and thank you again.
Catégories
En savoir plus sur 2-D and 3-D Plots 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!