Why are the options given for IconData causing errors when used?
Using Options
on IconData
reveals:
Options @ IconData
(* {Background → None, ImageSize → Automatic} *)
Great! Let's simply use them:
IconData[ "WindDirection", 315, Background -> None ]
Why are we getting an unknown option error (OptionValue)? Is something similar also observable for other built-in functions?
Note: This will also happen for ImageSize
.
I am using Version 11.3 on Windows 10 (64 Bit).
Update:
While we may argue about the above -- after all the documentation for IconData
will not show valid options --, note the following behavior:
SetOptions[ IconData, Background → Green];
IconData["WindDirection", 315]
You will note, that the options indeed have changed, but now there is no green background, while
IconData["WindDirection", 315, Background -> Green]
will show a green background albeit throwing an error message as given above.
error options
|
show 1 more comment
Using Options
on IconData
reveals:
Options @ IconData
(* {Background → None, ImageSize → Automatic} *)
Great! Let's simply use them:
IconData[ "WindDirection", 315, Background -> None ]
Why are we getting an unknown option error (OptionValue)? Is something similar also observable for other built-in functions?
Note: This will also happen for ImageSize
.
I am using Version 11.3 on Windows 10 (64 Bit).
Update:
While we may argue about the above -- after all the documentation for IconData
will not show valid options --, note the following behavior:
SetOptions[ IconData, Background → Green];
IconData["WindDirection", 315]
You will note, that the options indeed have changed, but now there is no green background, while
IconData["WindDirection", 315, Background -> Green]
will show a green background albeit throwing an error message as given above.
error options
2
If you look atInputForm@IconData["WindDirection", 315]
, you'll see that it returns aGraphics
. Thus a workaround isShow[IconData["WindDirection", 315], Background -> Green]
...
– Carl Lange
3 hours ago
woah woah woah,IconData
does not support any options, according to docs. You are using it on your own risk :)
– Kuba♦
2 hours ago
@Kuba So why then isOptions
giving me a different answer? Also: I am a WolframLanguage Risk-taking Individual - short: WRI! ;-)
– gwr
2 hours ago
@Kuba The conscientious risk-taker would at least expectSetOptions[ IconData, Background -> Green]
to work. But heck, it does not!
– gwr
2 hours ago
2
The standard rule of thumb is that if it's not documented, it's not supported (even if it works - or in this case, doesn't 😅).
– Carl Lange
2 hours ago
|
show 1 more comment
Using Options
on IconData
reveals:
Options @ IconData
(* {Background → None, ImageSize → Automatic} *)
Great! Let's simply use them:
IconData[ "WindDirection", 315, Background -> None ]
Why are we getting an unknown option error (OptionValue)? Is something similar also observable for other built-in functions?
Note: This will also happen for ImageSize
.
I am using Version 11.3 on Windows 10 (64 Bit).
Update:
While we may argue about the above -- after all the documentation for IconData
will not show valid options --, note the following behavior:
SetOptions[ IconData, Background → Green];
IconData["WindDirection", 315]
You will note, that the options indeed have changed, but now there is no green background, while
IconData["WindDirection", 315, Background -> Green]
will show a green background albeit throwing an error message as given above.
error options
Using Options
on IconData
reveals:
Options @ IconData
(* {Background → None, ImageSize → Automatic} *)
Great! Let's simply use them:
IconData[ "WindDirection", 315, Background -> None ]
Why are we getting an unknown option error (OptionValue)? Is something similar also observable for other built-in functions?
Note: This will also happen for ImageSize
.
I am using Version 11.3 on Windows 10 (64 Bit).
Update:
While we may argue about the above -- after all the documentation for IconData
will not show valid options --, note the following behavior:
SetOptions[ IconData, Background → Green];
IconData["WindDirection", 315]
You will note, that the options indeed have changed, but now there is no green background, while
IconData["WindDirection", 315, Background -> Green]
will show a green background albeit throwing an error message as given above.
error options
error options
edited 2 hours ago
gwr
asked 3 hours ago
gwrgwr
7,58622558
7,58622558
2
If you look atInputForm@IconData["WindDirection", 315]
, you'll see that it returns aGraphics
. Thus a workaround isShow[IconData["WindDirection", 315], Background -> Green]
...
– Carl Lange
3 hours ago
woah woah woah,IconData
does not support any options, according to docs. You are using it on your own risk :)
– Kuba♦
2 hours ago
@Kuba So why then isOptions
giving me a different answer? Also: I am a WolframLanguage Risk-taking Individual - short: WRI! ;-)
– gwr
2 hours ago
@Kuba The conscientious risk-taker would at least expectSetOptions[ IconData, Background -> Green]
to work. But heck, it does not!
– gwr
2 hours ago
2
The standard rule of thumb is that if it's not documented, it's not supported (even if it works - or in this case, doesn't 😅).
– Carl Lange
2 hours ago
|
show 1 more comment
2
If you look atInputForm@IconData["WindDirection", 315]
, you'll see that it returns aGraphics
. Thus a workaround isShow[IconData["WindDirection", 315], Background -> Green]
...
– Carl Lange
3 hours ago
woah woah woah,IconData
does not support any options, according to docs. You are using it on your own risk :)
– Kuba♦
2 hours ago
@Kuba So why then isOptions
giving me a different answer? Also: I am a WolframLanguage Risk-taking Individual - short: WRI! ;-)
– gwr
2 hours ago
@Kuba The conscientious risk-taker would at least expectSetOptions[ IconData, Background -> Green]
to work. But heck, it does not!
– gwr
2 hours ago
2
The standard rule of thumb is that if it's not documented, it's not supported (even if it works - or in this case, doesn't 😅).
– Carl Lange
2 hours ago
2
2
If you look at
InputForm@IconData["WindDirection", 315]
, you'll see that it returns a Graphics
. Thus a workaround is Show[IconData["WindDirection", 315], Background -> Green]
...– Carl Lange
3 hours ago
If you look at
InputForm@IconData["WindDirection", 315]
, you'll see that it returns a Graphics
. Thus a workaround is Show[IconData["WindDirection", 315], Background -> Green]
...– Carl Lange
3 hours ago
woah woah woah,
IconData
does not support any options, according to docs. You are using it on your own risk :)– Kuba♦
2 hours ago
woah woah woah,
IconData
does not support any options, according to docs. You are using it on your own risk :)– Kuba♦
2 hours ago
@Kuba So why then is
Options
giving me a different answer? Also: I am a WolframLanguage Risk-taking Individual - short: WRI! ;-)– gwr
2 hours ago
@Kuba So why then is
Options
giving me a different answer? Also: I am a WolframLanguage Risk-taking Individual - short: WRI! ;-)– gwr
2 hours ago
@Kuba The conscientious risk-taker would at least expect
SetOptions[ IconData, Background -> Green]
to work. But heck, it does not!– gwr
2 hours ago
@Kuba The conscientious risk-taker would at least expect
SetOptions[ IconData, Background -> Green]
to work. But heck, it does not!– gwr
2 hours ago
2
2
The standard rule of thumb is that if it's not documented, it's not supported (even if it works - or in this case, doesn't 😅).
– Carl Lange
2 hours ago
The standard rule of thumb is that if it's not documented, it's not supported (even if it works - or in this case, doesn't 😅).
– Carl Lange
2 hours ago
|
show 1 more comment
2 Answers
2
active
oldest
votes
From the above comments and some inspection we find that according to the decisive authority of the documentation using Options
for IconData
is not supported. Using Trace
we see that IconData
uses DataPaclets`IconDataDump`
which will not make use of the options given in a way we want.
One work around is to use ReplaceAll
for the Graphics
object returned by IconData
(a careful inspection using FullForm
will tell you what to replace):
IconData["WindDirection", 315] // ReplaceAll@
{
Rule[Background, None] -> Rule[Background, Green],
Rule[ImageSize, __ ] -> Rule[ImageSize, Large]
}
add a comment |
An alternative work-around is to take the graphics primitives returned by IconData
and use them in Graphics
with desired options added:
Graphics[First @ IconData["WindDirection", 315],
Background -> Green, ImageSize -> Large]
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f189465%2fwhy-are-the-options-given-for-icondata-causing-errors-when-used%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
From the above comments and some inspection we find that according to the decisive authority of the documentation using Options
for IconData
is not supported. Using Trace
we see that IconData
uses DataPaclets`IconDataDump`
which will not make use of the options given in a way we want.
One work around is to use ReplaceAll
for the Graphics
object returned by IconData
(a careful inspection using FullForm
will tell you what to replace):
IconData["WindDirection", 315] // ReplaceAll@
{
Rule[Background, None] -> Rule[Background, Green],
Rule[ImageSize, __ ] -> Rule[ImageSize, Large]
}
add a comment |
From the above comments and some inspection we find that according to the decisive authority of the documentation using Options
for IconData
is not supported. Using Trace
we see that IconData
uses DataPaclets`IconDataDump`
which will not make use of the options given in a way we want.
One work around is to use ReplaceAll
for the Graphics
object returned by IconData
(a careful inspection using FullForm
will tell you what to replace):
IconData["WindDirection", 315] // ReplaceAll@
{
Rule[Background, None] -> Rule[Background, Green],
Rule[ImageSize, __ ] -> Rule[ImageSize, Large]
}
add a comment |
From the above comments and some inspection we find that according to the decisive authority of the documentation using Options
for IconData
is not supported. Using Trace
we see that IconData
uses DataPaclets`IconDataDump`
which will not make use of the options given in a way we want.
One work around is to use ReplaceAll
for the Graphics
object returned by IconData
(a careful inspection using FullForm
will tell you what to replace):
IconData["WindDirection", 315] // ReplaceAll@
{
Rule[Background, None] -> Rule[Background, Green],
Rule[ImageSize, __ ] -> Rule[ImageSize, Large]
}
From the above comments and some inspection we find that according to the decisive authority of the documentation using Options
for IconData
is not supported. Using Trace
we see that IconData
uses DataPaclets`IconDataDump`
which will not make use of the options given in a way we want.
One work around is to use ReplaceAll
for the Graphics
object returned by IconData
(a careful inspection using FullForm
will tell you what to replace):
IconData["WindDirection", 315] // ReplaceAll@
{
Rule[Background, None] -> Rule[Background, Green],
Rule[ImageSize, __ ] -> Rule[ImageSize, Large]
}
edited 1 hour ago
community wiki
2 revs
gwr
add a comment |
add a comment |
An alternative work-around is to take the graphics primitives returned by IconData
and use them in Graphics
with desired options added:
Graphics[First @ IconData["WindDirection", 315],
Background -> Green, ImageSize -> Large]
add a comment |
An alternative work-around is to take the graphics primitives returned by IconData
and use them in Graphics
with desired options added:
Graphics[First @ IconData["WindDirection", 315],
Background -> Green, ImageSize -> Large]
add a comment |
An alternative work-around is to take the graphics primitives returned by IconData
and use them in Graphics
with desired options added:
Graphics[First @ IconData["WindDirection", 315],
Background -> Green, ImageSize -> Large]
An alternative work-around is to take the graphics primitives returned by IconData
and use them in Graphics
with desired options added:
Graphics[First @ IconData["WindDirection", 315],
Background -> Green, ImageSize -> Large]
edited 46 mins ago
answered 58 mins ago
kglrkglr
178k9198409
178k9198409
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f189465%2fwhy-are-the-options-given-for-icondata-causing-errors-when-used%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
If you look at
InputForm@IconData["WindDirection", 315]
, you'll see that it returns aGraphics
. Thus a workaround isShow[IconData["WindDirection", 315], Background -> Green]
...– Carl Lange
3 hours ago
woah woah woah,
IconData
does not support any options, according to docs. You are using it on your own risk :)– Kuba♦
2 hours ago
@Kuba So why then is
Options
giving me a different answer? Also: I am a WolframLanguage Risk-taking Individual - short: WRI! ;-)– gwr
2 hours ago
@Kuba The conscientious risk-taker would at least expect
SetOptions[ IconData, Background -> Green]
to work. But heck, it does not!– gwr
2 hours ago
2
The standard rule of thumb is that if it's not documented, it's not supported (even if it works - or in this case, doesn't 😅).
– Carl Lange
2 hours ago