Comments (15)
- Thanks!
- It might have been good if I had done that to begin with, but now I don't want to break any existing code by changing it. You can get around this by always using
base_size
as a named argument
theme_wsj(base_size = 20)
theme_stata(base_size = 20)
from ggthemes.
No problem, it was just a thought.
The simplest would have been to change line 239 from:
theme_stata <- function(scheme="s2color", base_size = 11, base_family = "sans") {
to:
theme_stata <- function(base_size = 11, scheme="s2color", base_family = "sans") {
That would break if anyone is calling the function like this: theme_stata("s2color", 12, "sans") but you could have an if numeric check to see if the font size is being passed first or second, which would make the code backward-compatible. Anyway, just a thought. Cheers!
from ggthemes.
It would be easy to change, but I still don't see the need to. If there's a lot of complaints I'd reconsider. If I were to change it, I'd deprecate the entire theme_stata
function and make each scheme a separate theme, e.g. theme_stata_s2color
, etc. I think I originally had scheme as a required argument, and only later made it optional.
In general, i don't like the style of correcting a user's "mistakes" by guessing their intent. The function should check for correctness and and throw an error if its wrong. Trying to correct for the user's intent results in lots of uncaught logical bugs which are even harder to track down than responding to an explicit error message.
from ggthemes.
Sure, it's not a problem. The last point was not to correct a user 'mistake' but to make it possible to use the theme_stata()
function in the same way as theme_bw()
from ggplot2
and in the same way as you wrote it. Enough said. Thanks and cheers for now.
from ggthemes.
You're right that I should have been more consistent in the ordering of the arguments in the themes, and I'm kicking myself for not doing that in the first place. I just don't think it's big enough to break any existing code of other people (to whatever extent anyone is using it). But it's in my head now, so maybe my opinion will change. Thanks again!
from ggthemes.
Oh please don't kick yourself, it never was worth the long comments I made. I enjoy ggthemes very much. I used to spend a lot of time tweaking styles, but now I'll just pull one style from your existing ones. (to me the main point of using theme_stata()
is to show Stata users they can easily switch to R!)
from ggthemes.
Rethought this one. Since it was always optional, option order wasn't guaranteed.
from ggthemes.
👍 👍 👍
from ggthemes.
I noticed theme_solid()
also has a different order of options. The effect of theme_solid(20)
is not error but to pass the option to fill
with the result that the background color changes to blue.
from ggthemes.
Hmm, on one hand since the font family and font sizes are ignored, there shouldn't be any options. But if it is used as a parent theme, they should exist.
from ggthemes.
Another comment in passing, of utmost triviality, you have named two files theme-foundation.R
and theme-solid
while the other theme files are named e.g. tufte.R
. Perhaps it will be easier to read the code if you name everything like the function, e.g. theme_solid.R
, theme_tufte.R
, etc.. Makes it easier to find your way around the R
directory.
from ggthemes.
I looked at theme_solid
, and it makes no sense to include parameters that aren't used and in fact wouldn't be inherited. I'd rather throw an error than have those ignored.
from ggthemes.
I just use grep :-)
from ggthemes.
Rethought my rethinking. Made it so that base_size
and base_family
are the 1st two arguments to all user-facing theme_*
functions. But, it's still good and safe style to always use argument names for all optional arguments.
from ggthemes.
agreed about throwing an error! Thanks for your hard work 👍 👍 👍
from ggthemes.
Related Issues (20)
- images in main page of pkgdown website are broken HOT 1
- Helpful: page with visualization of themes and names HOT 1
- Themes working with scatter3d.
- `theme_tufte` with `geom_rangeframe` doesn't work with `facet_wrap` HOT 2
- Problems with theme_economist HOT 1
- Not enogh colors on palette "gdocs" HOT 2
- base_family not working in theme_economist() and theme_excel()
- Allow Gradient Scales to Accept Midpoint Arg
- Images are broken on homepage HOT 5
- Plot with `theme_fivethirtyeight()` applied can't be further modified with `{ggplot2}` functions HOT 3
- extended_range_breaks - n= not respected
- images in package home page are broken HOT 2
- Installation fails @ R4.2.1 RHEL
- theme_fivethirtyeight() error on mac HOT 1
- Any alternatives? HOT 2
- Fix package alias
- Fix CRAN check errors HOT 2
- theme_excel_new() error HOT 1
- Handle shape pallettes with unicode symbols
- Remove appveyor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ggthemes.