piermorel / gramm

Gramm is a complete data visualization toolbox for Matlab. It provides an easy to use and high-level interface to produce publication-quality plots of complex data with varied statistical visualizations. Gramm is inspired by R's ggplot2 library.
MIT License
784 stars 222 forks source link

Add borders to points #65

Closed Nicholas-Schaub closed 7 months ago

Nicholas-Schaub commented 6 years ago

Two parameters were added to set_point_options: border_width and border_color. These options allow addition of a border to be drawn around each point. An example of a plot drawn with and without point borders is shown below.

The default is no border. If border_width is set to a value greater than 0, a black border is drawn around each point. If border_color is set but border_width is not, then no border will be drawn. Acceptable values for border_color are an 1x3 RGB matrix, or the Matlab color shorthand (such as 'g' or 'green').

figure_1_a_noborder

With borders: figure_1_a

piermorel commented 6 years ago

Hi @Nicholas-Schaub

Pretty active these days, thanks ! This pull request also includes the other one right? For some reason GitHub online diff ("files changed") is displaying entire changed files so it's hard to compare!

Nicholas-Schaub commented 6 years ago

Yeah, I'm not sure why that happened. I actually split these two commits so you can accept one and not the other. I can merge them if that would be easier.

I have been active. I'm in publication mode. I'm trying to match gramm's formatting to a colleagues formatting in ggplot. I think I'm done for the immediate future once these are done :)

Nicholas-Schaub commented 6 years ago

Oh wait...it looks like this one and the other one are merged...I didnt mean to do that. I must not have switched branches somewhere in there. I'll fix it. My apologies.

Nicholas-Schaub commented 6 years ago

That should make life easier. Sorry for the confusion.

piermorel commented 6 years ago

Hi,

The option should be made to work with other geom/stat that can use point options (jitter, summary, etc.). The best way to find out is to do a text search of functions that use draw_data.point_size and see where it can be applied.

Nicholas-Schaub commented 6 years ago

Hm...I'll look into this. Sorry for the delayed response.

piermorel commented 7 months ago

Hi @Nicholas-Schaub , with the opportunity I have to work again on gramm I'm merging your pull request. I added some functionality to have an 'auto' border color to allow for border-only points in gramm while keeping the correct colormap

Nicholas-Schaub commented 7 months ago

Woah, this is quite the blast from the past.

Thanks for coming back around to this.