Adding tick marks without overriding existing marks
Ältere Kommentare anzeigen
I would like to add a tick mark to a semilogx() plot to indicate the -3dB point of my transfer function. I know that I can use (gca,'XTick',[ ... ]) to add tick marks at specific frequencies; however, this forces the plot to ONLY display my specified tickmarks and completely removes the existing grid. is there anyway to add a tick mark overlay that maintains the standard semilog grid?
Note: the professor for this class had figures in his notes that do what I would like to do, but he has a pretty strict no-contact policy during take-home-exam weekends.
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 3 Dez. 2016
current_ticks = get(gca, 'XTick')
new_ticks = [current_ticks, specific_frequencies];
set(gca, 'XTick', new_ticks);
Or you can line() at the appropriate location, passing in 'Clipping', 'off') if you want the tick line to be visible outside the drawing area.
2 Kommentare
Andrew Jones
am 3 Dez. 2016
Bearbeitet: Andrew Jones
am 3 Dez. 2016
Walter Roberson
am 3 Dez. 2016
If it complains about the order then sort() new_ticks
Kategorien
Mehr zu Axis Labels finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
