Discussion Overview
The discussion revolves around how to re-label the x-axis in MATLAB plots to display actual time values instead of index numbers. Participants explore various methods for achieving this, focusing on the integration of time steps and the corresponding adjustments needed for tick marks and labels on the plot.
Discussion Character
- Technical explanation
- Conceptual clarification
- Debate/contested
- Mathematical reasoning
Main Points Raised
- One participant seeks to replace the default index-based x-axis labels with actual time values, specifically wanting to display a range from 0 to 5 instead of 0 to 1200.
- Another participant suggests using the documentation for the plot function as a potential resource.
- A participant shares their attempt to set custom tick marks and labels, indicating a need for dynamic adjustments based on changing parameters.
- There is a suggestion to use the command
plot(t, y) to plot y against time, which would automatically label the plot correctly.
- Some participants emphasize that using
plot(y) results in plotting against index numbers rather than time, which may lead to misinterpretation of the data.
- One participant provides a detailed method for manually setting tick marks and labels based on the desired scale, including calculations for tick spacing.
- A later reply confirms that the proposed method for manual labeling worked successfully.
Areas of Agreement / Disagreement
Participants generally agree on the need to adjust the x-axis labels, but there are differing opinions on the best method to achieve this. Some advocate for using the time variable directly in the plot function, while others prefer to manually set the tick marks and labels.
Contextual Notes
Participants express uncertainty about the best approach to dynamically adjust labels based on varying time parameters, indicating a reliance on manual calculations for specific cases.
Who May Find This Useful
This discussion may be useful for MATLAB users looking to customize plot axes, particularly in contexts involving time series data or integration results.