Coder Social home page Coder Social logo

Comments (3)

vnijs avatar vnijs commented on July 20, 2024

Do you mean something like the following?

visualize(dataset = "diamonds", xvar = "cut", yvar = "price", type = "bar", custom = TRUE) + 
geom_bar(stat="identity", colour="red", fill = "orange") 

In ggplot2, a bar-chart uses fill to specify a specific variable to plot/color by. For example:

visualize(dataset = "diamonds", xvar = "cut", yvar = "price", type = "bar", fill = "clarity", custom = FALSE)

Winston's cookbook has some nice examples:

http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/

from radiant.

subhashjaini avatar subhashjaini commented on July 20, 2024

Ooops, I was dealing with a histogram,

from radiant.

vnijs avatar vnijs commented on July 20, 2024

You can add pretty much anything to a plot generated using visualize that you want. However, I'm not sure if it is possible to edit a geom that has already been specified in ggplot2. I'll have to think about that a bit more. One issue is that color is also a parameter for line and scatter plots that has a different meaning than you are looking for. Anyway, you are not restricted to using only the functions exported by radiant. You can still fall back on regular ggplot commands. For example:

ggplot(r_data[["W"]], aes(x = NumberOfPeople)) + 
geom_histogram(fill = "blue")

from radiant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.