How do I create a graph similar to that of the example below?

2 vues (au cours des 30 derniers jours)
Devin Perera
Devin Perera le 14 Juil 2022
Modifié(e) : dpb le 17 Juil 2022

Réponses (1)

Jonas
Jonas le 14 Juil 2022
Modifié(e) : Jonas le 14 Juil 2022
you could do like this
loglog([ 10^2 10^2 10^4 10^4 10^2],[ 10^4 10^6 10^6 10^4 10^4]);
hold on;
loglog([ 1 10^2 10^4 10^4],[ 10^2 10^2 10^1 1]);
loglog(10.^([5 6 7 8 5]),[ 10^3 10^5 10^5 10^4 10^3]);
grid on;
axis([1 10^8 1 10^8])
  5 commentaires
Devin Perera
Devin Perera le 15 Juil 2022
The graph doesnt have to be a log graph as seen in the example, just the same concept showing the shapes.
dpb
dpb le 16 Juil 2022
Modifié(e) : dpb le 17 Juil 2022
As @Jonas shows, you can just plot points in sequential order to draw the lines -- each line will be a vector of x,y points from your data.
The perfect rectangle can be done with the rectangle function, the other areas could also be done with patch with no fill...
It'll perhaps be somewhat tedious, but not particularly difficult.
ADDENDUM
NB: You ca put all your data into single X,Y arrays by column -- if there aren't the same number of points to define each line, fill the remainder of the column to make the rectangular array with NaN; plot() will just silently ignore those entries.
This will let you get by with one call to plot() rather than having a long string of duplicated code with a bunch of named variables.
Create a matching array of labels to use for the indentifying text.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graphics Object Properties dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by