Re: [racket-users] color-maps for the plot package

2019-03-22 Thread Jens Axel Søgaard
Looks great.


Den tor. 21. mar. 2019 kl. 14.01 skrev Alex Harsanyi :

>
> I created a pull request for items (1) and (2), illustrating the changes
> that I propose, you can find it here:
>
> https://github.com/racket/plot/pull/52
>
> Alex.
>
> On Wednesday, March 20, 2019 at 12:17:47 PM UTC+8, Alex Harsanyi wrote:
>>
>>
>>
>> On Wednesday, March 20, 2019 at 10:35:51 AM UTC+8, Ben Greenman wrote:
>>>
>>> > Could you (or Ben or Matt) elaborate on how do you see this work for
>>> non
>>> > plot programs?
>>>
>>> I'm thinking a color-map% object would define a possibly-infinite
>>> sequence of colors that look nice in some way. The colors might be
>>> useful anywhere where someone wants a "rainbow" of colors ... maybe
>>> for:
>>>
>>> - fonts in a slideshow (colorblind-friendly? grayscale-friendly?),
>>> - coloring the error messages made by a linter or program analyzer,
>>> - drawing a sunset, etc.
>>>
>>
>> The examples listed above might be better served by other color choosing
>> mechanisms, for example, I have implemented some color manipulation code
>> based
>> on https://tallys.github.io/color-theory/, you can find it here:
>> https://github.com/alex-hhh/data-frame/blob/master/private/colors.rkt .
>> In
>> particular the `pick-color` function might do something similar to what
>> Pyret
>> is using (as suggested by Justin Zamora).
>>
>> Other solutions are also possible, including using gradient color maps,
>> but
>> this is a larger scope that I originally planned for and I don't have
>> the time to prepare and submit a patch for such changes.
>>
>> My proposal is more limited, to allow plot users to produce good looking
>> plots
>> with minimum effort.  What I propose is:
>>
>> (1) Add a mechanism (via parameters) to replace the `pen-colors` and
>> `brush-colors` vectors in the plot package with custom defined colors.
>> This
>> means that the existing `->pen-color` and `->brush-color` functions would
>> now
>> return a different color depending on what `pen-colors` or `brush-colors`
>> are
>> installed.  This also has the benefit that the existing mechanism of
>> specifying numbers for colors will now work with color maps:
>>
>> (plot (list (function sin -5 5 #:color 1)))
>>
>> (2) "Borrow" the qualitative color maps from matplotlib, so the user has
>> some
>> nice predefined set of colors to choose from for their plots.
>>
>> Also, possibly the following backwards incompatible changes:
>>
>> (3) change the default set of `pen-colors` and `brush-colors` to one of
>> the
>> new color maps, so the nicer colors are on by default.
>>
>> (4) change the default plot behavior so that a different color is chosen
>> for
>> each renderer, this means that things like the code below would result in
>> different colors used for the `sin` and `cos` functions:
>>
>> (plot (list (function sin -5 5) (function cos -5 5)))
>>
>> If others think that (1) and (2) are worthwhile doing, I will submit a
>> PR, so
>> we can discuss the API an implementation over something more concrete.  I
>> am
>> open discussion for points (3) and (4).
>>
>> For the more broader color map changes, if the improvements are split up
>> in
>> small incremental tasks, I will be happy to help out, as time allows.
>>
>> Alex.
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
-- 
Jens Axel Søgaard

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-21 Thread Alex Harsanyi

I created a pull request for items (1) and (2), illustrating the changes 
that I propose, you can find it here:

https://github.com/racket/plot/pull/52

Alex.

On Wednesday, March 20, 2019 at 12:17:47 PM UTC+8, Alex Harsanyi wrote:
>
>
>
> On Wednesday, March 20, 2019 at 10:35:51 AM UTC+8, Ben Greenman wrote:
>>
>> > Could you (or Ben or Matt) elaborate on how do you see this work for 
>> non 
>> > plot programs? 
>>
>> I'm thinking a color-map% object would define a possibly-infinite 
>> sequence of colors that look nice in some way. The colors might be 
>> useful anywhere where someone wants a "rainbow" of colors ... maybe 
>> for: 
>>
>> - fonts in a slideshow (colorblind-friendly? grayscale-friendly?), 
>> - coloring the error messages made by a linter or program analyzer, 
>> - drawing a sunset, etc. 
>>
>
> The examples listed above might be better served by other color choosing
> mechanisms, for example, I have implemented some color manipulation code 
> based
> on https://tallys.github.io/color-theory/, you can find it here:
> https://github.com/alex-hhh/data-frame/blob/master/private/colors.rkt .  
> In
> particular the `pick-color` function might do something similar to what 
> Pyret
> is using (as suggested by Justin Zamora).
>
> Other solutions are also possible, including using gradient color maps, but
> this is a larger scope that I originally planned for and I don't have
> the time to prepare and submit a patch for such changes.
>
> My proposal is more limited, to allow plot users to produce good looking 
> plots
> with minimum effort.  What I propose is:
>
> (1) Add a mechanism (via parameters) to replace the `pen-colors` and
> `brush-colors` vectors in the plot package with custom defined colors.  
> This
> means that the existing `->pen-color` and `->brush-color` functions would 
> now
> return a different color depending on what `pen-colors` or `brush-colors` 
> are
> installed.  This also has the benefit that the existing mechanism of
> specifying numbers for colors will now work with color maps:
>
> (plot (list (function sin -5 5 #:color 1)))
>
> (2) "Borrow" the qualitative color maps from matplotlib, so the user has 
> some
> nice predefined set of colors to choose from for their plots.
>
> Also, possibly the following backwards incompatible changes:
>
> (3) change the default set of `pen-colors` and `brush-colors` to one of the
> new color maps, so the nicer colors are on by default.
>
> (4) change the default plot behavior so that a different color is chosen 
> for
> each renderer, this means that things like the code below would result in
> different colors used for the `sin` and `cos` functions:
>
> (plot (list (function sin -5 5) (function cos -5 5)))
>
> If others think that (1) and (2) are worthwhile doing, I will submit a PR, 
> so
> we can discuss the API an implementation over something more concrete.  I 
> am
> open discussion for points (3) and (4).
>
> For the more broader color map changes, if the improvements are split up in
> small incremental tasks, I will be happy to help out, as time allows.
>
> Alex.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-20 Thread Daniel Prager
Side note:

For people looking for aesthetically pleasing discrete color palettes,
check out the top two tools on this page:
http://www.play-crafts.com/blog/tools/

   1. *Palette builder *helps you select a few colors from a pleasing image
   2. *Color play* randomly creates palettes (the source allows you to
   specify n)

The main people behind the site and the tools — Anne Sullivan and Gillian
Smith — straddle art, craft, and computer science in their work.

Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-20 Thread Laurent
This is a fantastic idea, Alex. (While I'm at it, thanks for all your other
projects related to the GUI, they are really cool.)

I'm *very* much in favour of all your points, (1) to (4).

I've had uses of different colors scheme for academic papers, and the
default palette doesn't work well for me. I haven't tried the matplotlib
palettes, but my various attempts have never been entirely satisfactory.
Here's an excerpt from some of my stabs:
https://github.com/Metaxal/bazaar/blob/master/plot.rkt#L133
(this includes a palette generator to maximize color difference, line 376+,
which I find much better than the default palette, but it doesn't take into
account the specifics of the human eye.)

Just a side note: the #:color argument is already quite flexible and
accepts things like '(10 20 30), which is pretty nice.



On Wed, Mar 20, 2019 at 4:17 AM Alex Harsanyi 
wrote:

>
>
> On Wednesday, March 20, 2019 at 10:35:51 AM UTC+8, Ben Greenman wrote:
>>
>> > Could you (or Ben or Matt) elaborate on how do you see this work for
>> non
>> > plot programs?
>>
>> I'm thinking a color-map% object would define a possibly-infinite
>> sequence of colors that look nice in some way. The colors might be
>> useful anywhere where someone wants a "rainbow" of colors ... maybe
>> for:
>>
>> - fonts in a slideshow (colorblind-friendly? grayscale-friendly?),
>> - coloring the error messages made by a linter or program analyzer,
>> - drawing a sunset, etc.
>>
>
> The examples listed above might be better served by other color choosing
> mechanisms, for example, I have implemented some color manipulation code
> based
> on https://tallys.github.io/color-theory/, you can find it here:
> https://github.com/alex-hhh/data-frame/blob/master/private/colors.rkt .
> In
> particular the `pick-color` function might do something similar to what
> Pyret
> is using (as suggested by Justin Zamora).
>
> Other solutions are also possible, including using gradient color maps, but
> this is a larger scope that I originally planned for and I don't have
> the time to prepare and submit a patch for such changes.
>
> My proposal is more limited, to allow plot users to produce good looking
> plots
> with minimum effort.  What I propose is:
>
> (1) Add a mechanism (via parameters) to replace the `pen-colors` and
> `brush-colors` vectors in the plot package with custom defined colors.
> This
> means that the existing `->pen-color` and `->brush-color` functions would
> now
> return a different color depending on what `pen-colors` or `brush-colors`
> are
> installed.  This also has the benefit that the existing mechanism of
> specifying numbers for colors will now work with color maps:
>
> (plot (list (function sin -5 5 #:color 1)))
>
> (2) "Borrow" the qualitative color maps from matplotlib, so the user has
> some
> nice predefined set of colors to choose from for their plots.
>
> Also, possibly the following backwards incompatible changes:
>
> (3) change the default set of `pen-colors` and `brush-colors` to one of the
> new color maps, so the nicer colors are on by default.
>
> (4) change the default plot behavior so that a different color is chosen
> for
> each renderer, this means that things like the code below would result in
> different colors used for the `sin` and `cos` functions:
>
> (plot (list (function sin -5 5) (function cos -5 5)))
>
> If others think that (1) and (2) are worthwhile doing, I will submit a PR,
> so
> we can discuss the API an implementation over something more concrete.  I
> am
> open discussion for points (3) and (4).
>
> For the more broader color map changes, if the improvements are split up in
> small incremental tasks, I will be happy to help out, as time allows.
>
> Alex.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-20 Thread Jens Axel Søgaard
Den tir. 19. mar. 2019 kl. 23.03 skrev Alex Harsanyi :

> On Tuesday, March 19, 2019 at 9:53:23 PM UTC+8, Jens Axel Søgaard wrote:
>>
>> This is a great idea.
>>
>> It would be really nice to be able to use the colors also from non-plot
>> programs.
>>
>
> Could you (or Ben or Matt) elaborate on how do you see this work for non
> plot programs?
>

I would use it to draw graphs - but not using the built-in plot library.

/Jens Axel

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-20 Thread Matt Jadud
>
>
> If others think that (1) and (2) are worthwhile doing, I will submit a PR,
> so
> we can discuss the API an implementation over something more concrete.  I
> am
> open discussion for points (3) and (4).
>
> For the more broader color map changes, if the improvements are split up in
> small incremental tasks, I will be happy to help out, as time allows.
>
>
1-4 sound like a solid foundation. If it was possible to have an API point
where a user can add (and then select) their own colormap, that would be
lovely. This would allow the described machinery to "just work" if I want
to explore the generation and use of colormaps other than those in the
library.

I've got an "all-puce" map in mind...

Thank you for the work and effort.

Cheers,
Matt

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Alex Harsanyi


On Wednesday, March 20, 2019 at 10:35:51 AM UTC+8, Ben Greenman wrote:
>
> > Could you (or Ben or Matt) elaborate on how do you see this work for non 
> > plot programs? 
>
> I'm thinking a color-map% object would define a possibly-infinite 
> sequence of colors that look nice in some way. The colors might be 
> useful anywhere where someone wants a "rainbow" of colors ... maybe 
> for: 
>
> - fonts in a slideshow (colorblind-friendly? grayscale-friendly?), 
> - coloring the error messages made by a linter or program analyzer, 
> - drawing a sunset, etc. 
>

The examples listed above might be better served by other color choosing
mechanisms, for example, I have implemented some color manipulation code 
based
on https://tallys.github.io/color-theory/, you can find it here:
https://github.com/alex-hhh/data-frame/blob/master/private/colors.rkt .  In
particular the `pick-color` function might do something similar to what 
Pyret
is using (as suggested by Justin Zamora).

Other solutions are also possible, including using gradient color maps, but
this is a larger scope that I originally planned for and I don't have
the time to prepare and submit a patch for such changes.

My proposal is more limited, to allow plot users to produce good looking 
plots
with minimum effort.  What I propose is:

(1) Add a mechanism (via parameters) to replace the `pen-colors` and
`brush-colors` vectors in the plot package with custom defined colors.  This
means that the existing `->pen-color` and `->brush-color` functions would 
now
return a different color depending on what `pen-colors` or `brush-colors` 
are
installed.  This also has the benefit that the existing mechanism of
specifying numbers for colors will now work with color maps:

(plot (list (function sin -5 5 #:color 1)))

(2) "Borrow" the qualitative color maps from matplotlib, so the user has 
some
nice predefined set of colors to choose from for their plots.

Also, possibly the following backwards incompatible changes:

(3) change the default set of `pen-colors` and `brush-colors` to one of the
new color maps, so the nicer colors are on by default.

(4) change the default plot behavior so that a different color is chosen for
each renderer, this means that things like the code below would result in
different colors used for the `sin` and `cos` functions:

(plot (list (function sin -5 5) (function cos -5 5)))

If others think that (1) and (2) are worthwhile doing, I will submit a PR, 
so
we can discuss the API an implementation over something more concrete.  I am
open discussion for points (3) and (4).

For the more broader color map changes, if the improvements are split up in
small incremental tasks, I will be happy to help out, as time allows.

Alex.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Ben Greenman
On 3/19/19, Justin Zamora  wrote:
> On Tue, Mar 19, 2019 at 10:35 PM Ben Greenman
>  wrote:
>> I'm thinking a color-map% object would define a possibly-infinite
>> sequence of colors that look nice in some way. The colors might be
>> useful anywhere where someone wants a "rainbow" of colors ... maybe
>> for:
>
> If you're interested in contrasting colors instead of a gradient, you
> could use philogenic colors, the way Pyret does for its error
> messages. http://blog.brownplt.org/2018/06/11/philogenic-colors.html
>
> Justin

Great. It'd be nice if a color sequence like that was provided by a
Racket library.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Justin Zamora
On Tue, Mar 19, 2019 at 10:35 PM Ben Greenman
 wrote:
> I'm thinking a color-map% object would define a possibly-infinite
> sequence of colors that look nice in some way. The colors might be
> useful anywhere where someone wants a "rainbow" of colors ... maybe
> for:

If you're interested in contrasting colors instead of a gradient, you
could use philogenic colors, the way Pyret does for its error
messages. http://blog.brownplt.org/2018/06/11/philogenic-colors.html

Justin

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Ben Greenman
> Could you (or Ben or Matt) elaborate on how do you see this work for non
> plot programs?
>
> For plots, the reason that color maps are useful is because the user will
> usually not care what the colors are, as long as they stand out visually
> and look pleasing next to each other.  My proposed interface would allow
> the user to essentially say "use the first color for the first data set,
> the second color for the second data set, etc" and than the meaning of
> "first color" and "second color" are defined as a parameter (the color map
> itself) and will look good with minimal effort.
>
> The above description would not work well for general draw programs,
> however there is `the-color-database` which allows selecting individual
> colors by name.  Maybe we need more color names added to that one?
>
> Also, both matplotlib and mathematica support continuous color maps,
> presumably because they can plot images or 2d arrays and they need
> gradients.  Since the racket plot package does not support this, I just
> wanted to implement color maps as a distinct set of colors, not as a linear
>
> gradient (see the link to the prototype code)

I'm thinking a color-map% object would define a possibly-infinite
sequence of colors that look nice in some way. The colors might be
useful anywhere where someone wants a "rainbow" of colors ... maybe
for:

- fonts in a slideshow (colorblind-friendly? grayscale-friendly?),
- coloring the error messages made by a linter or program analyzer,
- drawing a sunset, etc.

> Also, even if this is added to the `plot` package itself, it can still be
> used outside of it, just as you can use `->pen-color` for things not
> related to plots.

If I'm the only one voting for racket/draw then by all means put it in plot.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Alex Harsanyi


On Tuesday, March 19, 2019 at 9:53:23 PM UTC+8, Jens Axel Søgaard wrote:
>
> This is a great idea. 
>
> It would be really nice to be able to use the colors also from non-plot 
> programs.
>

Could you (or Ben or Matt) elaborate on how do you see this work for non 
plot programs?

For plots, the reason that color maps are useful is because the user will 
usually not care what the colors are, as long as they stand out visually 
and look pleasing next to each other.  My proposed interface would allow 
the user to essentially say "use the first color for the first data set, 
the second color for the second data set, etc" and than the meaning of 
"first color" and "second color" are defined as a parameter (the color map 
itself) and will look good with minimal effort.

The above description would not work well for general draw programs, 
however there is `the-color-database` which allows selecting individual 
colors by name.  Maybe we need more color names added to that one?

Also, both matplotlib and mathematica support continuous color maps, 
presumably because they can plot images or 2d arrays and they need 
gradients.  Since the racket plot package does not support this, I just 
wanted to implement color maps as a distinct set of colors, not as a linear 
gradient (see the link to the prototype code)

Also, even if this is added to the `plot` package itself, it can still be 
used outside of it, just as you can use `->pen-color` for things not 
related to plots.

Alex.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Jens Axel Søgaard
FWIW see also the Mathematica documentation on ColorSchemes and related
functions for inspiration.

https://reference.wolfram.com/language/guide/ColorSchemes.html

/Jens Axel

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Matt Jadud
+1 in general, and making them accessible from outside plot makes sense to
me.

On Tue, Mar 19, 2019 at 9:53 AM Jens Axel Søgaard 
wrote:

> This is a great idea.
>
> It would be really nice to be able to use the colors also from non-plot
> programs.
>
> /Jens Axel
>
>
>
>
>
>
> Den tir. 19. mar. 2019 kl. 08.09 skrev Alex Harsanyi <
> alexharsa...@gmail.com>:
>
>>
>> The Python matplotlib package supports the concept of a colormap for
>> selecting
>> colors for each data set that is displayed -- the user uses an index, like
>> color 0, 1, 2, etc and this is mapped to a RGB value in the color map.
>> The
>> visual aspect of a plot can be changed just by switching the color map.
>>
>> The color maps that are available to the matplotlib user have a nice set
>> of
>> colors chosen by experts (presumably) and this makes it easy to create
>> nice
>> looking plots, you can see the colors here:
>>
>> https://matplotlib.org/examples/color/colormaps_reference.html
>>
>> The `plot` library from Racket allows specifying colors by using the RGB
>> triplet, or by using the `->pen-color` function which converts an index
>> into a
>> hardcoded set of colors -- this is similar to the color map concept,
>> except
>> that the available colors are not as nice and they are hardcoded:
>>
>>
>> https://docs.racket-lang.org/plot/utils.html?q=-%3Epen-color#%28def._%28%28lib._plot%2Futils..rkt%29._-~3epen-color%29%29
>>
>> I would like to add support for color maps to the plot package, if others
>> consider it worthwile.  The way I think it would work is that a new plot
>> parameter (say `plot-pen-color-map`) would be defined and `->pen-color`
>> would
>> be changed to use the user specified color map instead of the default set
>> of
>> colors (the default set would still be used if no color map is specified).
>>
>> I put together some prototype code (including a screenshot of what it
>> would
>> look like) here:
>>
>> https://gist.github.com/alex-hhh/8ca14a0890dc2cfa8fc89e0c816d86da
>>
>> Technically this could be implemented outside the `plot` package, but I
>> think
>> it is much nicer to be readily available when Racket is installed and it
>> will
>> result in much nicer looking plots for a lot less effort.
>>
>> Do others think this would be useful?
>>
>> Alex.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> --
> Jens Axel Søgaard
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Ben Greenman
+1

Maybe the colormaps should go in racket/draw.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Jens Axel Søgaard
This is a great idea.

It would be really nice to be able to use the colors also from non-plot
programs.

/Jens Axel






Den tir. 19. mar. 2019 kl. 08.09 skrev Alex Harsanyi :

>
> The Python matplotlib package supports the concept of a colormap for
> selecting
> colors for each data set that is displayed -- the user uses an index, like
> color 0, 1, 2, etc and this is mapped to a RGB value in the color map.  The
> visual aspect of a plot can be changed just by switching the color map.
>
> The color maps that are available to the matplotlib user have a nice set of
> colors chosen by experts (presumably) and this makes it easy to create nice
> looking plots, you can see the colors here:
>
> https://matplotlib.org/examples/color/colormaps_reference.html
>
> The `plot` library from Racket allows specifying colors by using the RGB
> triplet, or by using the `->pen-color` function which converts an index
> into a
> hardcoded set of colors -- this is similar to the color map concept, except
> that the available colors are not as nice and they are hardcoded:
>
>
> https://docs.racket-lang.org/plot/utils.html?q=-%3Epen-color#%28def._%28%28lib._plot%2Futils..rkt%29._-~3epen-color%29%29
>
> I would like to add support for color maps to the plot package, if others
> consider it worthwile.  The way I think it would work is that a new plot
> parameter (say `plot-pen-color-map`) would be defined and `->pen-color`
> would
> be changed to use the user specified color map instead of the default set
> of
> colors (the default set would still be used if no color map is specified).
>
> I put together some prototype code (including a screenshot of what it would
> look like) here:
>
> https://gist.github.com/alex-hhh/8ca14a0890dc2cfa8fc89e0c816d86da
>
> Technically this could be implemented outside the `plot` package, but I
> think
> it is much nicer to be readily available when Racket is installed and it
> will
> result in much nicer looking plots for a lot less effort.
>
> Do others think this would be useful?
>
> Alex.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
-- 
Jens Axel Søgaard

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] color-maps for the plot package

2019-03-19 Thread Sam Tobin-Hochstadt
I would like this a lot. I have often wished for an easy way to get
some of the nice color schemes I see people use in ggplot2 and
elsewhere.

Sam

On Tue, Mar 19, 2019 at 3:09 AM Alex Harsanyi  wrote:
>
>
> The Python matplotlib package supports the concept of a colormap for selecting
> colors for each data set that is displayed -- the user uses an index, like
> color 0, 1, 2, etc and this is mapped to a RGB value in the color map.  The
> visual aspect of a plot can be changed just by switching the color map.
>
> The color maps that are available to the matplotlib user have a nice set of
> colors chosen by experts (presumably) and this makes it easy to create nice
> looking plots, you can see the colors here:
>
> https://matplotlib.org/examples/color/colormaps_reference.html
>
> The `plot` library from Racket allows specifying colors by using the RGB
> triplet, or by using the `->pen-color` function which converts an index into a
> hardcoded set of colors -- this is similar to the color map concept, except
> that the available colors are not as nice and they are hardcoded:
>
> https://docs.racket-lang.org/plot/utils.html?q=-%3Epen-color#%28def._%28%28lib._plot%2Futils..rkt%29._-~3epen-color%29%29
>
> I would like to add support for color maps to the plot package, if others
> consider it worthwile.  The way I think it would work is that a new plot
> parameter (say `plot-pen-color-map`) would be defined and `->pen-color` would
> be changed to use the user specified color map instead of the default set of
> colors (the default set would still be used if no color map is specified).
>
> I put together some prototype code (including a screenshot of what it would
> look like) here:
>
> https://gist.github.com/alex-hhh/8ca14a0890dc2cfa8fc89e0c816d86da
>
> Technically this could be implemented outside the `plot` package, but I think
> it is much nicer to be readily available when Racket is installed and it will
> result in much nicer looking plots for a lot less effort.
>
> Do others think this would be useful?
>
> Alex.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] color-maps for the plot package

2019-03-19 Thread Alex Harsanyi

The Python matplotlib package supports the concept of a colormap for 
selecting
colors for each data set that is displayed -- the user uses an index, like
color 0, 1, 2, etc and this is mapped to a RGB value in the color map.  The
visual aspect of a plot can be changed just by switching the color map.

The color maps that are available to the matplotlib user have a nice set of
colors chosen by experts (presumably) and this makes it easy to create nice
looking plots, you can see the colors here:

https://matplotlib.org/examples/color/colormaps_reference.html

The `plot` library from Racket allows specifying colors by using the RGB
triplet, or by using the `->pen-color` function which converts an index 
into a
hardcoded set of colors -- this is similar to the color map concept, except
that the available colors are not as nice and they are hardcoded:

https://docs.racket-lang.org/plot/utils.html?q=-%3Epen-color#%28def._%28%28lib._plot%2Futils..rkt%29._-~3epen-color%29%29

I would like to add support for color maps to the plot package, if others
consider it worthwile.  The way I think it would work is that a new plot
parameter (say `plot-pen-color-map`) would be defined and `->pen-color` 
would
be changed to use the user specified color map instead of the default set of
colors (the default set would still be used if no color map is specified).

I put together some prototype code (including a screenshot of what it would
look like) here:

https://gist.github.com/alex-hhh/8ca14a0890dc2cfa8fc89e0c816d86da

Technically this could be implemented outside the `plot` package, but I 
think
it is much nicer to be readily available when Racket is installed and it 
will
result in much nicer looking plots for a lot less effort.

Do others think this would be useful?

Alex.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.