Giter Club home page Giter Club logo

bbplot's People

Contributors

cguibourg avatar nassosstylianou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bbplot's Issues

Suggestion for "Color bars Conditionally" example in the cookbook.

Cool book. Just a suggestion here:

ggplot(bar_df,
aes(x = reorder(country, lifeExp), y = lifeExp, fill = country == "Mauritius")) +
geom_col() +
scale_fill_manual(values = c("#dddddd", "#1380A1"), guide = F) +
geom_hline(yintercept = 0, size = 1, colour="#333333") +
bbc_style() +
coord_flip() +
labs(title="Reunion is highest",
subtitle = "Highest African life expectancy, 2007") +
theme(panel.grid.major.x = element_line(color="#cbcbcb"),
panel.grid.major.y = element_blank())

Logo_Image_Path not working as expected

Hi!

I've been using this package today to try it out and I am very happy with it.

I have a logo image that I want to add to my plot. I used the logo_image_path option in the finalise_plot function.
The logo is added to the plot, but it is not complete, it is cutted on the right side.

Is there a way to have it complete without having to change the dimensions of the image?

Thank you,
Carlotta.

[Feature request] - Add arguments to bbc_style() for easy customization

Windows machines do not support Helvetica font type, so I had to make modifications to the bbc_style() in a separate ggplot2() function. It would be cool to have maybe a font argument that defaults to Helvetica, but would allow others to change the font name. Once the font changes, there may be some sizing differences, so it would also be cool to create an offset size, to do a plus or minus the current font sizes used in your function: bbc_style <- function(font = "Helvetica", offset = 0), which would allow me to use it like this: bbc_style("Arial", -2).

Error Failed to install bbplot from GitHub

I'm trying to install bbplot and received the following error messages:

Error: Failed to install 'bbplot' from GitHub:
(converted from warning) unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.5:
cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.5/PACKAGES'

The code that I used was:
install.packages('devtools')
devtools::install_github('bbc/bbplot')

I'm using R 3.5.3 (2019-03-11) on a Windows 10 Enterprise machine. I get a code 404 error messages when I try to go to the URLs in the above error message.

Any suggestions would be great. Thanks.

line_df not defined in README.md

The dataframe used to plot the example, line_df is not defined.

Perhaps create an example df and save to the package, or provide code in .md to create line_df.

Add a set of color palettes

I was reading your https://bbc.github.io/rcookbook/ and this is pretty great, but there's an easy step that you could take that would add simplicity and consistency to the plot making process: Take a look at RColorBrewer... it let's you very simply to call out colors as per a variety of themes... perhaps something like this could be done w/ BBC colours? This way one would never have to read a theme sheet, it would be built right in. Helpful?

image

Windows Fonts

Windows does not have it's own Helvetica font, which results in warnings when using bbc_style() on a typical windows computer.

Running windowsFonts(Helvetica = "TT Arial") at the start of the script will use the windows default of treating Helvetica as Arial and avoid the warnings.

The graphic can not show chinese

if I use the function bbc_style(), Chinese characters cannot show properly in the final graphic even when I add theme(text = element_text(family = "Kai")).
Delete bbc_style() can work properly.

So I think there may be some problem with bbc_style() when using Chinese characters.

Incongrous function name

The bbc_style function seems very similar to any other ggplot theme function, like the theme_grey, theme_classic, theme_light, etc., built in to the ggplot2 package, or many others like those in the ggthemes package.

Except the name.

I think it'd be great to change the name of the function to theme_bbc if you'd like greater visibility consider submitting it to ggthemes. With theme_economist, theme_fivethirtyeight, and theme_wsj, theme_bbc would feel right at home :)

Black bar at bottom of plot

Hi,

I've started using the bbplot package today which is generally working really well. However, when finalising the plot, the exports seem to include a black bar at the bottom of the image which masks the source details. I've fiddled with the code and it seems to be happening when the subtitle or source are longer than a certain number of characters (although still less wide than the width of the available space). I can't get any plots to finalise with both a subtitle and source at present.

Code:

svannualcount <- ggplot(svkc_count, aes(x = as.character(Recorded_Year), y = n)) +
  geom_col(fill="#082a52") +
  geom_hline(yintercept = 0, size = 1, colour="#333333") +
  theme(axis.text.x = element_text(angle = 0)) +
  bbc_style() +
  labs(title="This is a test title",
       subtitle = "Can you read my test title?")

finalise_plot(plot_name = svannualcount,
              source = "Source: This is a test source.",
              save_filepath = "/tmp/svkcannualplot.png",
              width_pixels = 640,
              height_pixels = 450,
              logo_image_path = "/tmp/vrulogo.png"
             )

Graphic:
image

image

Allow the use of logos from the internet

When finalizing a plot, it would be nice to be able to pull a logo from a URL. This would make it easier to share code examples without first requiring users to download the logos.

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.