Why are the options given for IconData causing errors when used?












5












$begingroup$



Reported to Wolfram Technical Support [CASE:4212712]






Using Options on IconData reveals:



Options @ IconData

(* {Background → None, ImageSize → Automatic} *)


Great! Let's simply use them:



IconData[ "WindDirection", 315, Background -> None ]


error



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.










share|improve this question











$endgroup$












  • $begingroup$
    Comments are not for extended discussion; this conversation has been moved to chat.
    $endgroup$
    – Kuba
    Jan 15 at 14:10
















5












$begingroup$



Reported to Wolfram Technical Support [CASE:4212712]






Using Options on IconData reveals:



Options @ IconData

(* {Background → None, ImageSize → Automatic} *)


Great! Let's simply use them:



IconData[ "WindDirection", 315, Background -> None ]


error



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.










share|improve this question











$endgroup$












  • $begingroup$
    Comments are not for extended discussion; this conversation has been moved to chat.
    $endgroup$
    – Kuba
    Jan 15 at 14:10














5












5








5





$begingroup$



Reported to Wolfram Technical Support [CASE:4212712]






Using Options on IconData reveals:



Options @ IconData

(* {Background → None, ImageSize → Automatic} *)


Great! Let's simply use them:



IconData[ "WindDirection", 315, Background -> None ]


error



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.










share|improve this question











$endgroup$





Reported to Wolfram Technical Support [CASE:4212712]






Using Options on IconData reveals:



Options @ IconData

(* {Background → None, ImageSize → Automatic} *)


Great! Let's simply use them:



IconData[ "WindDirection", 315, Background -> None ]


error



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 15 at 14:07









Kuba

107k12211536




107k12211536










asked Jan 14 at 13:43









gwrgwr

8,62322861




8,62322861












  • $begingroup$
    Comments are not for extended discussion; this conversation has been moved to chat.
    $endgroup$
    – Kuba
    Jan 15 at 14:10


















  • $begingroup$
    Comments are not for extended discussion; this conversation has been moved to chat.
    $endgroup$
    – Kuba
    Jan 15 at 14:10
















$begingroup$
Comments are not for extended discussion; this conversation has been moved to chat.
$endgroup$
– Kuba
Jan 15 at 14:10




$begingroup$
Comments are not for extended discussion; this conversation has been moved to chat.
$endgroup$
– Kuba
Jan 15 at 14:10










3 Answers
3






active

oldest

votes


















4












$begingroup$

Per my comment, if you look at InputForm@IconData["WindDirection", 315], you'll see that it returns a Graphics object.



Thus a sensible workaround would be:



Show[IconData["WindDirection", 315], Background -> Green]


since it will act like any other Graphics object.



For instance, you would also be able to use DiscretizeGraphics and its ilk:



discretize example



The natural Wolfram order of things is that if a symbol or something about a symbol is not documented, it's not officially supported and is likely to change, stop working, or exhibit weird behaviour (as in your case).






share|improve this answer









$endgroup$









  • 1




    $begingroup$
    And yet, we are not spelunking, but simply checking for options, which are given but do not work as options should...
    $endgroup$
    – gwr
    Jan 14 at 21:35






  • 2




    $begingroup$
    I'm not disagreeing with you that they exist and should work; I'm just stating that it's not terribly surprising that they don't, given that they're undocumented.
    $endgroup$
    – Carl Lange
    Jan 14 at 21:52



















4












$begingroup$

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]
}


LargeIcon






share|improve this answer











$endgroup$





















    4












    $begingroup$

    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]


    enter image description here






    share|improve this answer











    $endgroup$













    • $begingroup$
      (+1) But I have to admit that Carl Lange's solution as given in the comments looks simpler, e.g. Show[ IconData["WindDirection", 315], Background -> Green, ImageSize -> Large ].
      $endgroup$
      – gwr
      Jan 14 at 18:04










    • $begingroup$
      Thank you @gwr. I agree Show is more straightforward; I thought you commented that it produced the same error message in your system.
      $endgroup$
      – kglr
      Jan 14 at 18:23






    • 1




      $begingroup$
      Actually my bad: I missed his bracket making IconData an expression within Show (which is why I deleted my comment ... and probably should have told @CarlLange more explicitly).
      $endgroup$
      – gwr
      Jan 14 at 18:26












    Your Answer








    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
    });


    }
    });














    draft saved

    draft discarded


















    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

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4












    $begingroup$

    Per my comment, if you look at InputForm@IconData["WindDirection", 315], you'll see that it returns a Graphics object.



    Thus a sensible workaround would be:



    Show[IconData["WindDirection", 315], Background -> Green]


    since it will act like any other Graphics object.



    For instance, you would also be able to use DiscretizeGraphics and its ilk:



    discretize example



    The natural Wolfram order of things is that if a symbol or something about a symbol is not documented, it's not officially supported and is likely to change, stop working, or exhibit weird behaviour (as in your case).






    share|improve this answer









    $endgroup$









    • 1




      $begingroup$
      And yet, we are not spelunking, but simply checking for options, which are given but do not work as options should...
      $endgroup$
      – gwr
      Jan 14 at 21:35






    • 2




      $begingroup$
      I'm not disagreeing with you that they exist and should work; I'm just stating that it's not terribly surprising that they don't, given that they're undocumented.
      $endgroup$
      – Carl Lange
      Jan 14 at 21:52
















    4












    $begingroup$

    Per my comment, if you look at InputForm@IconData["WindDirection", 315], you'll see that it returns a Graphics object.



    Thus a sensible workaround would be:



    Show[IconData["WindDirection", 315], Background -> Green]


    since it will act like any other Graphics object.



    For instance, you would also be able to use DiscretizeGraphics and its ilk:



    discretize example



    The natural Wolfram order of things is that if a symbol or something about a symbol is not documented, it's not officially supported and is likely to change, stop working, or exhibit weird behaviour (as in your case).






    share|improve this answer









    $endgroup$









    • 1




      $begingroup$
      And yet, we are not spelunking, but simply checking for options, which are given but do not work as options should...
      $endgroup$
      – gwr
      Jan 14 at 21:35






    • 2




      $begingroup$
      I'm not disagreeing with you that they exist and should work; I'm just stating that it's not terribly surprising that they don't, given that they're undocumented.
      $endgroup$
      – Carl Lange
      Jan 14 at 21:52














    4












    4








    4





    $begingroup$

    Per my comment, if you look at InputForm@IconData["WindDirection", 315], you'll see that it returns a Graphics object.



    Thus a sensible workaround would be:



    Show[IconData["WindDirection", 315], Background -> Green]


    since it will act like any other Graphics object.



    For instance, you would also be able to use DiscretizeGraphics and its ilk:



    discretize example



    The natural Wolfram order of things is that if a symbol or something about a symbol is not documented, it's not officially supported and is likely to change, stop working, or exhibit weird behaviour (as in your case).






    share|improve this answer









    $endgroup$



    Per my comment, if you look at InputForm@IconData["WindDirection", 315], you'll see that it returns a Graphics object.



    Thus a sensible workaround would be:



    Show[IconData["WindDirection", 315], Background -> Green]


    since it will act like any other Graphics object.



    For instance, you would also be able to use DiscretizeGraphics and its ilk:



    discretize example



    The natural Wolfram order of things is that if a symbol or something about a symbol is not documented, it's not officially supported and is likely to change, stop working, or exhibit weird behaviour (as in your case).







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 14 at 19:49









    Carl LangeCarl Lange

    5,65411344




    5,65411344








    • 1




      $begingroup$
      And yet, we are not spelunking, but simply checking for options, which are given but do not work as options should...
      $endgroup$
      – gwr
      Jan 14 at 21:35






    • 2




      $begingroup$
      I'm not disagreeing with you that they exist and should work; I'm just stating that it's not terribly surprising that they don't, given that they're undocumented.
      $endgroup$
      – Carl Lange
      Jan 14 at 21:52














    • 1




      $begingroup$
      And yet, we are not spelunking, but simply checking for options, which are given but do not work as options should...
      $endgroup$
      – gwr
      Jan 14 at 21:35






    • 2




      $begingroup$
      I'm not disagreeing with you that they exist and should work; I'm just stating that it's not terribly surprising that they don't, given that they're undocumented.
      $endgroup$
      – Carl Lange
      Jan 14 at 21:52








    1




    1




    $begingroup$
    And yet, we are not spelunking, but simply checking for options, which are given but do not work as options should...
    $endgroup$
    – gwr
    Jan 14 at 21:35




    $begingroup$
    And yet, we are not spelunking, but simply checking for options, which are given but do not work as options should...
    $endgroup$
    – gwr
    Jan 14 at 21:35




    2




    2




    $begingroup$
    I'm not disagreeing with you that they exist and should work; I'm just stating that it's not terribly surprising that they don't, given that they're undocumented.
    $endgroup$
    – Carl Lange
    Jan 14 at 21:52




    $begingroup$
    I'm not disagreeing with you that they exist and should work; I'm just stating that it's not terribly surprising that they don't, given that they're undocumented.
    $endgroup$
    – Carl Lange
    Jan 14 at 21:52











    4












    $begingroup$

    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]
    }


    LargeIcon






    share|improve this answer











    $endgroup$


















      4












      $begingroup$

      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]
      }


      LargeIcon






      share|improve this answer











      $endgroup$
















        4












        4








        4





        $begingroup$

        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]
        }


        LargeIcon






        share|improve this answer











        $endgroup$



        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]
        }


        LargeIcon







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 14 at 15:07


























        community wiki





        2 revs
        gwr
























            4












            $begingroup$

            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]


            enter image description here






            share|improve this answer











            $endgroup$













            • $begingroup$
              (+1) But I have to admit that Carl Lange's solution as given in the comments looks simpler, e.g. Show[ IconData["WindDirection", 315], Background -> Green, ImageSize -> Large ].
              $endgroup$
              – gwr
              Jan 14 at 18:04










            • $begingroup$
              Thank you @gwr. I agree Show is more straightforward; I thought you commented that it produced the same error message in your system.
              $endgroup$
              – kglr
              Jan 14 at 18:23






            • 1




              $begingroup$
              Actually my bad: I missed his bracket making IconData an expression within Show (which is why I deleted my comment ... and probably should have told @CarlLange more explicitly).
              $endgroup$
              – gwr
              Jan 14 at 18:26
















            4












            $begingroup$

            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]


            enter image description here






            share|improve this answer











            $endgroup$













            • $begingroup$
              (+1) But I have to admit that Carl Lange's solution as given in the comments looks simpler, e.g. Show[ IconData["WindDirection", 315], Background -> Green, ImageSize -> Large ].
              $endgroup$
              – gwr
              Jan 14 at 18:04










            • $begingroup$
              Thank you @gwr. I agree Show is more straightforward; I thought you commented that it produced the same error message in your system.
              $endgroup$
              – kglr
              Jan 14 at 18:23






            • 1




              $begingroup$
              Actually my bad: I missed his bracket making IconData an expression within Show (which is why I deleted my comment ... and probably should have told @CarlLange more explicitly).
              $endgroup$
              – gwr
              Jan 14 at 18:26














            4












            4








            4





            $begingroup$

            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]


            enter image description here






            share|improve this answer











            $endgroup$



            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]


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 14 at 16:14

























            answered Jan 14 at 16:03









            kglrkglr

            190k10208425




            190k10208425












            • $begingroup$
              (+1) But I have to admit that Carl Lange's solution as given in the comments looks simpler, e.g. Show[ IconData["WindDirection", 315], Background -> Green, ImageSize -> Large ].
              $endgroup$
              – gwr
              Jan 14 at 18:04










            • $begingroup$
              Thank you @gwr. I agree Show is more straightforward; I thought you commented that it produced the same error message in your system.
              $endgroup$
              – kglr
              Jan 14 at 18:23






            • 1




              $begingroup$
              Actually my bad: I missed his bracket making IconData an expression within Show (which is why I deleted my comment ... and probably should have told @CarlLange more explicitly).
              $endgroup$
              – gwr
              Jan 14 at 18:26


















            • $begingroup$
              (+1) But I have to admit that Carl Lange's solution as given in the comments looks simpler, e.g. Show[ IconData["WindDirection", 315], Background -> Green, ImageSize -> Large ].
              $endgroup$
              – gwr
              Jan 14 at 18:04










            • $begingroup$
              Thank you @gwr. I agree Show is more straightforward; I thought you commented that it produced the same error message in your system.
              $endgroup$
              – kglr
              Jan 14 at 18:23






            • 1




              $begingroup$
              Actually my bad: I missed his bracket making IconData an expression within Show (which is why I deleted my comment ... and probably should have told @CarlLange more explicitly).
              $endgroup$
              – gwr
              Jan 14 at 18:26
















            $begingroup$
            (+1) But I have to admit that Carl Lange's solution as given in the comments looks simpler, e.g. Show[ IconData["WindDirection", 315], Background -> Green, ImageSize -> Large ].
            $endgroup$
            – gwr
            Jan 14 at 18:04




            $begingroup$
            (+1) But I have to admit that Carl Lange's solution as given in the comments looks simpler, e.g. Show[ IconData["WindDirection", 315], Background -> Green, ImageSize -> Large ].
            $endgroup$
            – gwr
            Jan 14 at 18:04












            $begingroup$
            Thank you @gwr. I agree Show is more straightforward; I thought you commented that it produced the same error message in your system.
            $endgroup$
            – kglr
            Jan 14 at 18:23




            $begingroup$
            Thank you @gwr. I agree Show is more straightforward; I thought you commented that it produced the same error message in your system.
            $endgroup$
            – kglr
            Jan 14 at 18:23




            1




            1




            $begingroup$
            Actually my bad: I missed his bracket making IconData an expression within Show (which is why I deleted my comment ... and probably should have told @CarlLange more explicitly).
            $endgroup$
            – gwr
            Jan 14 at 18:26




            $begingroup$
            Actually my bad: I missed his bracket making IconData an expression within Show (which is why I deleted my comment ... and probably should have told @CarlLange more explicitly).
            $endgroup$
            – gwr
            Jan 14 at 18:26


















            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Bressuire

            Cabo Verde

            Gyllenstierna