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

Use NaN data for the dummy plot in chebfun.plot(). #2062

Merged
merged 1 commit into from
Feb 23, 2017

Conversation

aaustin141
Copy link
Contributor

Previously, we just replotted the existing line data and set the plot's
"Visible" property to 'off'. This doesn't work properly anymore in
R2016b, since MATLAB grays out the legend entries for graphics items
marked invisible.

The fix is easy enough: we plot NaN data for the dummy plot (but set
the line and point styles appropriately) and leave "Visible" set to
'on'. MATLAB doesn't draw anything on the plot for NaN data, so we're
good. A little ugly, but we already use this trick elsewhere for other
things.

Closes #2061.

Previously, we just replotted the existing line data and set the plot's
"Visible" property to 'off'.  This doesn't work properly anymore in
R2016b, since MATLAB grays out the legend entries for graphics items
marked invisible.

The fix is easy enough:  we plot NaN data for the dummy plot (but set
the line and point styles appropriately) and leave "Visible" set to
'on'.  MATLAB doesn't draw anything on the plot for NaN data, so we're
good.  A little ugly, but we already use this trick elsewhere for other
things.

Closes #2061.
@oliviersete
Copy link
Contributor

Thanks @aaustin141 , the fix seems to work fine.

@oliviersete oliviersete merged commit ea5c51a into development Feb 23, 2017
@trefethen trefethen deleted the fix-plot-grayed-legends branch August 23, 2017 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants