Skip to content

introduce rgbplot#339

Open
maxfreu wants to merge 2 commits into
rafaqz:mainfrom
maxfreu:plots
Open

introduce rgbplot#339
maxfreu wants to merge 2 commits into
rafaqz:mainfrom
maxfreu:plots

Conversation

@maxfreu

@maxfreu maxfreu commented Nov 29, 2022

Copy link
Copy Markdown
Contributor

Hi! I've just put my plotting code into a dedicated rgbplot function, which should make plotting rasters as rgb images convenient :) I've also modified the skipmissing stuff, because I had errors when the missingval was nothing.

@rafaqz

rafaqz commented Nov 29, 2022

Copy link
Copy Markdown
Owner

Amazing!

One question: is there a reason you don't use a plot(raster; rgb=true) ?

There is quite a bit if code duplication here, and the RGBPlot wrapper is a little unusual. Using an rgb keyword could solve that.

@maxfreu

maxfreu commented Nov 30, 2022

Copy link
Copy Markdown
Contributor Author

I’m just not that familiar with writing plot recipes. I can try to change it.

@rafaqz

rafaqz commented Nov 30, 2022

Copy link
Copy Markdown
Owner

Yes its a little mysterious, but there is a plotattributes object in scope in recipes functions that has the keyword arguments in it:

So something like this should work:

isrgb = get(plotattributes, :rgb, false)

And

bands = get(plotattributes, :bands, 1:3)

@maxfreu

maxfreu commented Nov 30, 2022

Copy link
Copy Markdown
Contributor Author

Ok, I'll give it a try when I find the time again. How does one properly document the behaviour for plot recipes?

@rafaqz

rafaqz commented Nov 30, 2022

Copy link
Copy Markdown
Owner

I don't really know how to document them! in all my packages the plotting is very poorly documented

@lazarusA

Copy link
Copy Markdown
Collaborator

this looks promising 😄 , any change on finishing this ?

@maxfreu

maxfreu commented Jan 14, 2025

Copy link
Copy Markdown
Contributor Author

Hi Lazaro! Well, one would have to re-run the tests and as far as I was concerned, this was pretty much finished. But Rafael suggested to use just "plot" with a rgb keyword instead of "rgbplot". I didn't have the time to include the suggested changes and well, I still don't really have.

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.

3 participants