plot with 3 different lines and a set of points

2 vues (au cours des 30 derniers jours)
Christos
Christos le 23 Avr 2024
Commenté : Mathieu NOE le 23 Avr 2024
Hi. I want to plot in one logarithmic graph 3 different lines and a set of points. I have the part of the code down below to be more specific about my problem. As you can see, the x axis is logarithmic but the y axis is not. I dont understand what is wrong about my code. If you have any answers, please help me.
Thank you!
  2 commentaires
VBBV
VBBV le 23 Avr 2024
x = linspace(2,6,50); % use linspace
@Christos the variable y may not be needed, as you are evaluating y values using 3 different equations.
Use of linspace is better in this context, since you intend to use loglog function to plot your data.
Mathieu NOE
Mathieu NOE le 23 Avr 2024
the y axe is indeed in log scale , but the y range is not very wide , so you may have seen it as a linear scale , but is not
otherwise your "lines" would not appear as straight lines

Connectez-vous pour commenter.

Réponses (1)

Les Beckham
Les Beckham le 23 Avr 2024
The y axis is logarithmic. It's just not very obvious due to the limited range of your y data. Note the difference in the spacing between 240 and 260 vs. the spacing between 400 and 420, for example.

Catégories

En savoir plus sur Discrete Data Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by