GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — legends, part 1 by kushalkolar · Pull Request #406 · fastplotlib/fastplotlib

Conversation

@kushalkolar

@kushalkolar kushalkolar commented Feb 19, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

starts #403

major WIP

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kushalkolar
start legends, not functional yet
59ed74c
@kushalkolar kushalkolar mentioned this pull request Feb 19, 2024
added colorbar #366
Closed
kushalkolar added 5 commits February 19, 2024 23:46
@kushalkolar
add faq (#400)
6966097
@kushalkolar
fix bug when remove_graphic() is used (#405)
0967ea0
@kushalkolar
add 'Deleted' as a graphic feature (#404)
d537a4e
@kushalkolar
very basic adding line legends works
0dc0d95
@kushalkolar
use OrderedDict for legend items
c7f6284
@kushalkolar

kushalkolar commented Feb 20, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

got some very basic stuff working, can add simple LineGraphics to the legend

image

Changing label and auto-update of colors and thickness works

image

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
allow accessing legend items via Graphic, updating colors works
fee30f5
@kushalkolar

kushalkolar commented Feb 20, 2024

Copy link
Copy Markdown
Member Author

I should determine a way to make a sorting method for LegendItems in space (based on the size of each) and then organize into an optimal column, row or grid of items. Get the bbox for all LegendItems and set the Legend mesh to the bbox.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 7 commits February 20, 2024 12:58
@kushalkolar
legend mesh resizes properly
de23dd9
@kushalkolar
remove legend items and reorder works
e316c5e
@kushalkolar
enforce all legend labels to be unique
b6e2531
@kushalkolar
add legends property to PlotArea
a6743cc
@kushalkolar
checks for Graphic name
1e639b4
@kushalkolar
highlight linegraphic when legend item is clicked
d5b4f5b
@kushalkolar
legend is moveable
bcae1f2
@kushalkolar

kushalkolar commented Feb 22, 2024

Copy link
Copy Markdown
Member Author

If legend is placed in the main plot area scale the text size and spacing based on current scene bbox.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 7 commits February 22, 2024 14:11
@kushalkolar
remove weird characters that were committed for some reason
b7e6fc5
@kushalkolar
Merge branch 'legends' of https://github.com/fastplotlib/fastplotlib …
d8840dd
…into legends
@kushalkolar
weird merge conflict
e3637ca
@kushalkolar
progress on legend grid placement, not yet working
80cd459
@kushalkolar
Merge branch 'legends' of https://github.com/fastplotlib/fastplotlib …
9024465
…into legends
@kushalkolar
Merge branch 'legends' of https://github.com/fastplotlib/fastplotlib …
fc98604
…into legends
@kushalkolar
max_rows works for legend
142c989
@kushalkolar kushalkolar changed the title legends legends, part 1 Feb 27, 2024
@kushalkolar
kushalkolar marked this pull request as ready for review February 27, 2024 05:22
kushalkolar added 3 commits February 27, 2024 10:24
@kushalkolar
just allow max_rows kwarg for legends, no cols
c2122e8
@kushalkolar
Merge branch 'main' into legends
5ed8e38
@kushalkolar
line that snuck in from another branch
9609d8c
clewis7
clewis7 reviewed Feb 28, 2024
View reviewed changes

@clewis7 clewis7 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Is there a plan to have something like plot.add_legend(), that would take a plot_area and auto generate a legend based on existing graphics in the plot?

Notes:

  1. Interesting functionality, if I don't specify a dock to put the legend in, it places it in the middle of the plot. Should we have a default dock to use ("top" or "right") if someone just passes the plot?
  2. Also, if I don't change the size of the dock before adding the legend, it doesn't appear? Should we automatically change the size of the dock area that the legend is being added to?
  3. Legend location: it appears like the legend is not centered in the middle of the plot.
    image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread fastplotlib/layouts/_plot_area.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread fastplotlib/legends/legend.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@clewis7

clewis7 commented Feb 28, 2024

Copy link
Copy Markdown
Member

I see here you provided images exemplifying use, I think we should add a legends.ipynb.

@kushalkolar thoughts?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@clewis7

clewis7 commented Feb 28, 2024

Copy link
Copy Markdown
Member

Interesting functionality, if I don't specify a dock to put the legend in, it places it in the middle of the plot. Should we have a default dock to use ("top" or "right") if someone just passes the plot?

I see you can pass a Plot, Dock, or Subplot. My only worry is that when I just passed the same plot that my data is in it put the legend over the graphic. Guess maybe it is up to the user to know that you can put legend in a plot or subplot by itself, or you can put it in a dock.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

clewis7
clewis7 reviewed Feb 28, 2024
View reviewed changes
Comment thread fastplotlib/legends/legend.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

clewis7
clewis7 reviewed Feb 28, 2024
View reviewed changes
Comment thread fastplotlib/legends/legend.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
small changes
29f646d
@kushalkolar

kushalkolar commented Feb 29, 2024

Copy link
Copy Markdown
Member Author

Is there a plan to have something like plot.add_legend(), that would take a plot_area and auto generate a legend based on existing graphics in the plot?

We can think about this later once we have all the legend functionality we want.

  1. Interesting functionality, if I don't specify a dock to put the legend in, it places it in the middle of the plot. Should we have a default dock to use ("top" or "right") if someone just passes the plot?

Nope, it can make sense to put the legend in the main plot area too, the user can move them out of the way of existing graphics if required.

  1. Also, if I don't change the size of the dock before adding the legend, it doesn't appear? Should we automatically change the size of the dock area that the legend is being added to?

Done

  1. Legend location: it appears like the legend is not centered in the middle of the plot.

We can fix this later XD

I see here you provided images exemplifying use, I think we should add a legends.ipynb.

We can do this after implementing all legend functionality that we want, basically when we fully resolve #403

it is up to the user to know that you can put legend in a plot or subplot by itself, or you can put it in a dock.

Yup!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
kushalkolar merged commit 8919d7c into main Feb 29, 2024
@kushalkolar
kushalkolar deleted the legends branch March 4, 2024 12:17
@kushalkolar kushalkolar mentioned this pull request Mar 6, 2024
fix fastplotlib.__init__ #424
Merged
@kushalkolar

kushalkolar commented Apr 5, 2024

Copy link
Copy Markdown
Member Author

Is there a plan to have something like plot.add_legend(),

Now after the recent References refactor I realize this is probably the best way to do it, keep the API uniform. Can properly look into it after or during axes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@clewis7 clewis7 clewis7 left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kushalkolar @clewis7
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.