Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch single axis ruler visibility #928

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

JTSvejda
Copy link
Contributor

@JTSvejda JTSvejda commented Jul 8, 2016

Added a loop to the drawAxes() function to add the axis property 'axis line=none' if the visibility of the -axis specific ruler is set to 'off', e.g.

plot(1:10)
set(get(gca,'XAxis'),'Visible','off')

capture

Best Regards
JTSvejda

…s <xyz> line=none' if the visibility of the <xyz>-axis ruler is set to 'off'.

Signed-off-by: Jan Taro Svejda <jan.svejda@uni-due.de>
@okomarov okomarov changed the title Routine to switch axis ruler visibility Switch single axis ruler visibility Jul 8, 2016
@okomarov
Copy link
Member

okomarov commented Jul 8, 2016

@JTSvejda Thanks for this PR. I took the liberty to edit your post to add the example, as it wasn't completely clear that we wanted to toggle single axis.

As a side note, this might be a good opportunity to encapsulate axis visibility into a function, with the overall visibility, checked a bit earlier in the code, also part of this function. Moreover, we would need to test for Octave vs Matlab, as I do not think that the former has this option.

@miscco
Copy link
Contributor

miscco commented Jul 10, 2016

@okomarov I would second that.

@@ -922,6 +922,14 @@ case guitypes()
m2t = drawBoxAndLineLocationsOfAxes(m2t, handle);
m2t = drawGridOfAxes(m2t, handle);
m2t = drawLegendOptionsOfAxes(m2t);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be moved above to the following clause

if ~isVisible(handle)

and an elseif. I would prefer if hide axis is not accompanied with 'axis xyz line = 0'

@JTSvejda
Copy link
Contributor Author

I hope this is the solution to your comment...

m2t.axes{end}.name = 'axis';

m2t = drawBackgroundOfAxes(m2t, handle);
m2t = drawTitleOfAxes(m2t, handle);
m2t = drawBoxAndLineLocationsOfAxes(m2t, handle);
m2t = drawGridOfAxes(m2t, handle);
m2t = drawLegendOptionsOfAxes(m2t);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That spurios newline should go away

@miscco
Copy link
Contributor

miscco commented Jul 11, 2016

So does this also account for axis ticks and ticklabels?

@JTSvejda
Copy link
Contributor Author

I've tested it with the attached example and the ticks and ticklabels are non-visible if the axis ruler is non-visible.

example_axisRulerVisibility.zip

@okomarov
Copy link
Member

This should go at the beginning of function getAxisOptions() and if the axis is not drawn, return early.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants