How to adapt the space between the grid lines to the space between the ticks?
1 次查看(过去 30 天)
显示 更早的评论
Good evening everyone
As I wanted the grid lines of my plot to have a different color from the axis, I put a second axis under the first. Now I doubled the ticks on the y axis but the grid lines aren't doubleing too. Has anyone an idea how to fix this?
Thank you (Btw I am still using R2007b)
0 个评论
回答(1 个)
dpb
2018-5-17
You have to address the proper axes object to change its properties...to make working with multiple axes easier, be absolutely sure to save the handles of each when you create them so have to "talk to" the desired one.
Post your code so far so we can use it for pedagogical purposes to get from where you got (sounds like good start) to where you're headed...(and actually, the above hint may be all the help you really need, we'll see :) ).
4 个评论
dpb
2018-5-18
>> help gca
gca Get handle to current axis.
H = gca returns the handle to the current axis in the current
figure. The current axis is the axis that graphics commands
like PLOT, TITLE, SURF, etc. draw to if issued.
...
gca is a function so its return value is variable depending on what has happened since -- this is particularly significant when either in a GUI or interactive session and the user (or you) switches context.
Ah, ok, older releases do prevent using later features...
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!