YAxis property of an Axes read-only, but XAxis and ZAxis are not.
16 次查看(过去 30 天)
显示 更早的评论
I discovered that the YAxis property of an Axes is considered read-only, but the XAxis and ZAxis properties can be set and get. I was wondering if there was a specific reason for this, or if this is an oversight. Why is the YAxis property read-only, but the XAxis and ZAxis properties are not?
9 个评论
Adam
2019-7-17
Yeah, that's what I was meaning. I agree that setting YAxis as an entity is not something I would ever be trying to do, although if it were to recreate an axes with all the same properties and the yAxis could simply be saved as an object then re-assigned later that would make some sense.
采纳的回答
Steven Lord
2019-7-16
I needed to write code that saved the properties of the axes handle and then removed the read-only properties from the structure. I also needed to remove the individual handles as well and save those as structures, so that when the figure is closed I can recreate the figure by setting a new handle to the previous values without needing to save it as a .fig which will not work for my application.
Trying to generate code from your figure yourself is probably going to be difficult. If you're doing this interactively, use the Generate Code option on the File menu to create code that you can run (with the original data) to recreate the figure.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!