Plotting Multiple Graphs In The Same Plot Using the plot...
Transcript of Plotting Multiple Graphs In The Same Plot Using the plot...
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer Programming Lecture 13Computer Programming Dr.Moayed Almobaied
Plotting Multiple Graphs In The Same Plot
Using the plot Command
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
Using the hold on and hold off Commands
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
Using the line Command
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
FORMATTING A PLOT
The xlabel and ylabel commands:
The title command:
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
The text command:
The legend command:
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
The text in the string that is included in the command
and is displayed when the command is executed can
be formatted. The formatting can be used to define
the font, size, position (superscript, subscript), style
(italic, bold, etc.), and color of the characters, the
color of the background, and many other details of
the display.
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
Greek characters:
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
Formatting of the text that is displayed by the xlabel, ylabel,
title, and text commands can also be done by adding optional
PropertyName and PropertyValue arguments following the
string inside the command.
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
The axis command:
When the plot (x, y) command is executed, MATLAB creates
axes with limits that are based on the minimum and maximum
values of the elements of x and y.
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
Formatting a Plot Using the Plot Editor
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
Plots with Logarithmic Axes
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
Notes for plots with logarithmic axes:
• The number zero cannot be plotted on a log scale
• Negative numbers cannot be plotted on log scalesLecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
PLOTS WITH ERROR BARS
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied
PLOTS WITH SPECIAL GRAPHICS
Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13
Islamic University of GazaFaculty of EngineeringCivil Engineering Department
Computer ProgrammingComputer Programming Dr.Moayed Almobaied Lecture 13