The labels are being put into the proper place on the graph. Your third point is at y = -3.something which happens to be outside the range of what you are displaying. That is not the fault of text(), that is because you have told it coordinates that are not on your graph.
That code does not produce the plot you show above, not even if you set(gca,'xdir','reverse') to reverse the X axes. The upper line that is plotted in your image is about 5 units lower than the actual y2(y1(f)) value. Meanwhile the third text label that is to the upper right and outside the graph appears to be at the correct y2(y1(f)) value.
Side note: you can make your plotting shorter, using just a single statement.
h = plot( f , y1(f), '--o', f, y2(y1(f)), '--o' )
I would, by the way, not call the result ax1 as the result of plot() is line objects, not axes objects.
Well the plot line you provided works and if I use set(gca,'xdir','reverse') it gets what I want - see attached image.
There are two things I would like to do with this: The first is plot all 8 points on the two functions and the second extrapolate these functions as they approach 0.
The red and green star, what is the purpose of this? It's not a necessary point, I just want to show the 8 points and extrapolate the end of the function as f approaches 0.
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
Translated by
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.