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

add kwarg legend and change kwarg label #15

Closed

Conversation

johnrichardrinehart
Copy link

Filed an issue regarding this, already.

Copy link
Owner

@KristofferC KristofferC left a comment

Choose a reason for hiding this comment

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

I didn't know there was a \labeldirective that you could attach to plots. The current naming of the keyword is thus unfortunate indeed.

What I don't like about this is that it will silently change peoples plots without any deprecation. I'm not sure what the best deprecation strategy is, but I think there needs to be some heads up to users.

@@ -13,12 +14,14 @@ end
Base.push!(plot::Plot, element) = (push!(plot.elements, element); plot)
Base.append!(plot::Plot, element) = (append!(plot.elements, element); plot)

function Plot(elements::AbstractVector, args::Vararg{PGFOption}; incremental = true, label = nothing)
Plot(elements, dictify(args), label, incremental, false)
function Plot(elements::AbstractVector, args::Vararg{PGFOption}; incremental =
Copy link
Owner

Choose a reason for hiding this comment

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

This line breaking seems odd to me.

Choose a reason for hiding this comment

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

I take advantage of Julia's flexibility with newlines. I hard-wrap at 80 characters. It's definitely a bad line break. Feel free to change it.

@johnrichardrinehart
Copy link
Author

Yeah, I have an idea to fix everything. If someone provides both the label= and the legend= kwarg then attach the specified label and a legend to the plot. Otherwise, if they attach only a label= then go ahead and attach both the \label{} and \addlegendentry{} to the plot (with the same name). If a user has multiple figures with common legend titles then this could present a duplicate label/reference warning from the LaTeX engine. But, I don't think it's a huge deal.

@tpapp
Copy link
Collaborator

tpapp commented Mar 6, 2018

I think this was fixed by bd4f86c with the introduction of LegendEntry and #54 which added Legend, and can be closed.

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.

None yet

3 participants