How to make grid lines visible while Axis is invisible?
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Chaitanya Jha
am 24 Jun. 2019
Beantwortet: Chaitanya Jha
am 26 Jun. 2019
Hi, I am developing a GUI in which I have two plots, current and voltage (see below). I am using 3 axes, a big one whos X-Axis displays the time, two smaller axes on top of this big axes, I plot current and voltage in these two smaller top axes. The visibility of the smaller axes is set to 0 and only the visibility of their Y-Axis is switched on afterwards. This gives it an impression that both current and voltage are plotted on the bigger axes on which X-Axis serves as time axis. I can do all this, however, I would like to switch on the YGrid of the two smaller axis while keeping the axis itself invisible. I have tried different methods, such as setting the YGrid property to 'on' and using 'grid on' command, but nothing works. Can it be done?

4 Kommentare
Geoff Hayes
am 25 Jun. 2019
Chaitanya - to be clear, the axes object is hidden (visible property set to off or false) yet you want to show the YGrid lines for that hidden axes object?
Akzeptierte Antwort
Weitere Antworten (1)
Jan
am 25 Jun. 2019
The question is a little bit confusing for me. An invisible axes does not have visible properties. But you can create a visible axes and hide what you want:
ax = axes;
ax.XGrid = 'on';
ax.YGrid = 'on';
ax.XTick = [];
ax.YTick = [];
ax.XAxis.Visible = 'off';
ax.YAxis.Visible = 'off';
Siehe auch
Kategorien
Mehr zu Axes Appearance finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!