Skip to content

Marker style and size issues of legend. #745

Description

@gepcel

Let's see an example first:

import ultraplot as pplt
fig,ax=pplt.subplot()
ax.plot(.5, .7, m='.', ms=30, label='plot of size 30')
ax.scatter(.5, .5, ms=30, label='scatter of size 30')
ax.format(xlim=(0, 1), ylim=(0, 1))
ax,legend(loc='ll', ncols=1)
ax.sizelegend([20], labels=['area=True'], loc='lr')
ax.sizelegend([20], labels=['area=False'], loc='ur', area=False)

The result is as following:

Image

I have three questions/suggestions:

  1. The marker style of plot method and it's coresponding legend entry (plot of size 30 of this example) is inconsistent.
  2. As I understand it, the plot method use size=30 as the diameter. This should theoretically be the same as sizelegend with area=False, which doesn't seem to be the case in the example. Conversely, the scatter method use size=30 as the area, which should match sizelegend with area=True, and this appears to be correct.
  3. I suggest add area arg to catlegend, and maybe other semantic legends if you think it's appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions