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.


[racket-users] Re: printing decimals

2019-03-19 Thread Sanjeev Sharma
WHOPS ... SRFI/54 

On Friday, March 15, 2019 at 1:57:03 PM UTC-4, sdgu...@gmail.com wrote:
>
> Hi all,
>
> I've been looking through the docs for a way to print decimals to a 
> defined precision.
>
> I can get close to what I want using something like ~a and giving it a set 
> width without having to build a function to do so. I mean I can build a 
> function to do as its just a bit of string manip but it feels really odd 
> that there doesn't seem to be a built in way to do so even though we try to 
> keep all the decimals in fractional notation to maintain precision as long 
> as possible in racket.
>
> any ideas anyone or am I just being blind and its right there in the docs 
> somewhere?
>
> thanks,
> Scott
>

-- 
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] Re: printing decimals

2019-03-19 Thread Sanjeev Sharma
SRFI 57, the function cat

differs from ~r in several areas,  but looks like a decent alternative 

On Friday, March 15, 2019 at 1:57:03 PM UTC-4, sdgu...@gmail.com wrote:
>
> Hi all,
>
> I've been looking through the docs for a way to print decimals to a 
> defined precision.
>
> I can get close to what I want using something like ~a and giving it a set 
> width without having to build a function to do so. I mean I can build a 
> function to do as its just a bit of string manip but it feels really odd 
> that there doesn't seem to be a built in way to do so even though we try to 
> keep all the decimals in fractional notation to maintain precision as long 
> as possible in racket.
>
> any ideas anyone or am I just being blind and its right there in the docs 
> somewhere?
>
> thanks,
> Scott
>

-- 
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.


Re: [racket-users] Re: Racket News - Issue 4

2019-03-19 Thread 'Paulo Matos' via Racket Users



On 18/03/2019 14:55, Jérôme Martin wrote:
> Thank you so much for this!
> 

Opened this for you:
https://github.com/racket-news/racket-news.github.io-src/issues/12

Feel free to add to it if something else comes to mind.

> If I can suggest a project for next month's spotlight:
> 
> - Christopher Lemmer Webber, co-editor of the ActivityPub specs, is
> working on a distributed social network library based on Racket:
> https://gitlab.com/spritely
>   It's still in early development, but I think it's an important project
> to give visibility to ;)
> 
> Maybe we could also have a spotlight section for #lang languages too?
> 
> - The brag parser generator is obviously a good project.
> - The video lang by Leif is also pretty awesome.
> - The slideshow lang might be a great pick too.
> - Obviously scribble.
> 
> On Friday, March 15, 2019 at 12:03:47 PM UTC+1, Paulo Matos wrote:
> 
> I have just published Issue 4 at
> 
> http://racket-news.com/2019/03/racket-news-issue-4.html
> 
> 
> Grab a coffee and enjoy!
> -- 
> Paulo Matos
> 
> -- 
> 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.

-- 
Paulo Matos

-- 
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] Re: Racket News - Issue 4

2019-03-19 Thread Jérôme Martin
On Tuesday, March 19, 2019 at 9:29:00 AM UTC+1, Paulo Matos wrote:

> Sure! That's great. I will add it to the submissions for issue 5 or 6. 
>

Thanks!
 

> I can obviously have one more section but the reason I would prefer not 
> to is because at about ~26 issues per year, I would like to have good 
> content for a long time coming, if you know what I mean. :) 
>
> Therefore I would prefer to schedule those great langs in the project 
> spotlight for issues up ahead. What do you think? 
>

Makes sense! Let's put quality before quantity ;)
 

-- 
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] Re: Racket News - Issue 4

2019-03-19 Thread 'Paulo Matos' via Racket Users



On 18/03/2019 16:51, Matt Jadud wrote:
> I'd be willing to pitch in some text around the thinking about the 'tbl'
> library for introductory data work, so that people might push back on
> it. Or, it would at least give a coherent surface for some conversation
> around collaboration.
> 
> If not next issue, at some point. Or, not. I'm flexible. It would force
> me to get some things in writing, though, which is useful.
> 

Hey Matt, that would be great. If you want to send in a pitch for the
Project Spotlight or any other section, feel free. It would be great to
have more contributions! :)

> Cheers,
> Matt
> 
> On Mon, Mar 18, 2019 at 9:55 AM Jérôme Martin
> mailto:jerome.martin@gmail.com>> wrote:
> 
> Thank you so much for this!
> 
> If I can suggest a project for next month's spotlight:
> 
> - Christopher Lemmer Webber, co-editor of the ActivityPub specs, is
> working on a distributed social network library based on Racket:
> https://gitlab.com/spritely
>   It's still in early development, but I think it's an important
> project to give visibility to ;)
> 
> Maybe we could also have a spotlight section for #lang languages too?
> 
> - The brag parser generator is obviously a good project.
> - The video lang by Leif is also pretty awesome.
> - The slideshow lang might be a great pick too.
> - Obviously scribble.
> 
> On Friday, March 15, 2019 at 12:03:47 PM UTC+1, Paulo Matos wrote:
> 
> I have just published Issue 4 at
> 
> http://racket-news.com/2019/03/racket-news-issue-4.html
> 
> Grab a coffee and enjoy!
> -- 
> Paulo Matos
> 
> -- 
> 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.

-- 
Paulo Matos

-- 
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] Re: Racket News - Issue 4

2019-03-19 Thread 'Paulo Matos' via Racket Users
Hi Jerome,

Thanks for all the suggestions.

On 18/03/2019 14:55, Jérôme Martin wrote:
> Thank you so much for this!
> 
> If I can suggest a project for next month's spotlight:
> 
> - Christopher Lemmer Webber, co-editor of the ActivityPub specs, is
> working on a distributed social network library based on Racket:
> https://gitlab.com/spritely
>   It's still in early development, but I think it's an important project
> to give visibility to ;)
> 

Sure! That's great. I will add it to the submissions for issue 5 or 6.

> Maybe we could also have a spotlight section for #lang languages too?
> 
> - The brag parser generator is obviously a good project.
> - The video lang by Leif is also pretty awesome.
> - The slideshow lang might be a great pick too.
> - Obviously scribble.
> 

We could do that but I have been using project spotlight in the broader
sense of standalone project and/or lang. For example, I featured the
rosette #lang a couple of issues ago.

I can obviously have one more section but the reason I would prefer not
to is because at about ~26 issues per year, I would like to have good
content for a long time coming, if you know what I mean. :)

Therefore I would prefer to schedule those great langs in the project
spotlight for issues up ahead. What do you think?

Paulo Matos

> On Friday, March 15, 2019 at 12:03:47 PM UTC+1, Paulo Matos wrote:
> 
> I have just published Issue 4 at
> 
> http://racket-news.com/2019/03/racket-news-issue-4.html
> 
> 
> Grab a coffee and enjoy!
> -- 
> Paulo Matos
> 
> -- 
> 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.

-- 
Paulo Matos

-- 
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.