{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6589","repository_url":"https://api.github.com/repos/matplotlib/matplotlib","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6589/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6589/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6589/events","html_url":"https://github.com/matplotlib/matplotlib/pull/6589","id":160461567,"number":6589,"title":"Using to_rgba rather than to_rgb in figure_edit","user":{"login":"dwgoon","id":9444960,"avatar_url":"https://avatars.githubusercontent.com/u/9444960?v=3","gravatar_id":"","url":"https://api.github.com/users/dwgoon","html_url":"https://github.com/dwgoon","followers_url":"https://api.github.com/users/dwgoon/followers","following_url":"https://api.github.com/users/dwgoon/following{/other_user}","gists_url":"https://api.github.com/users/dwgoon/gists{/gist_id}","starred_url":"https://api.github.com/users/dwgoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwgoon/subscriptions","organizations_url":"https://api.github.com/users/dwgoon/orgs","repos_url":"https://api.github.com/users/dwgoon/repos","events_url":"https://api.github.com/users/dwgoon/events{/privacy}","received_events_url":"https://api.github.com/users/dwgoon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/needs_review","name":"needs_review","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/14","html_url":"https://github.com/matplotlib/matplotlib/milestones/2.0%20(style%20change%20major%20release)","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/14/labels","id":662004,"number":14,"title":"2.0 (style change major release)","description":"Style changes only","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":39,"closed_issues":356,"state":"open","created_at":"2014-05-17T14:28:22Z","updated_at":"2016-06-15T17:18:59Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-06-15T16:07:58Z","updated_at":"2016-06-15T17:44:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6589","html_url":"https://github.com/matplotlib/matplotlib/pull/6589","diff_url":"https://github.com/matplotlib/matplotlib/pull/6589.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/6589.patch"},"body":"\r\nOS: Windows 7 (64bit)\r\nPython: Anaconda, Python 3.4.4 (64bit)\r\nmatplotlib: 1.5.1  (version used for this test)\r\nmatplotlib backend: Qt4Agg or Qt5Agg\r\n\r\nIf I set \"markerfacecolor\" as \"none\" (**not None**) for plotting, I get the following exception **when I push the editing button of toolbar**.\r\n\r\n> Traceback (most recent call last):\r\n>   File \"C:\\Users\\dwlee\\Anaconda\\envs\\py34\\lib\\site-packages\\matplotlib\\colors.py\", line 309, in to_rgb\r\n>     fl = float(argl)\r\n> ValueError: could not convert string to float: 'none'\r\n> \r\n> During handling of the above exception, another exception occurred:\r\n> \r\n> Traceback (most recent call last):\r\n>   File \"C:\\Users\\dwlee\\Anaconda\\envs\\py34\\lib\\site-packages\\matplotlib\\backends\\backend_qt5.py\", line 645, in edit_parameters\r\n>     figureoptions.figure_edit(axes, self)\r\n>   File \"C:\\Users\\dwlee\\Anaconda\\envs\\py34\\lib\\site-packages\\matplotlib\\backends\\qt_editor\\figureoptions.py\", line 89, in\r\n>  figure_edit\r\n>     fc = rgb2hex(colorConverter.to_rgb(line.get_markerfacecolor()))\r\n>   File \"C:\\Users\\dwlee\\Anaconda\\envs\\py34\\lib\\site-packages\\matplotlib\\colors.py\", line 331, in to_rgb\r\n>     'to_rgb: Invalid rgb arg \"%s\"\\n%s' % (str(arg), exc))\r\n> ValueError: to_rgb: Invalid rgb arg \"none\" could not convert string to float: 'none'\r\n\r\nHere is the example code for testing.\r\n\r\n```\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nX = np.random.rand(100, 1000)\r\nxs = np.mean(X, axis=1)\r\nys = np.std(X, axis=1)\r\n\r\nfig = plt.figure()\r\nax = fig.add_subplot(111)\r\nline, = ax.plot(xs, ys, 'o', markerfacecolor=\"none\")\r\n\r\nplt.show()\r\n```\r\n\r\nOne solution is to use \"to_rgba\" of colorConverter in \"matplotlib\\backends\\qt_editor\\figureoptions.py\" rather than \"to_rgb\". It is because \"to_rgb\" does not handle the \"none\" option as a transparent color, whereas \"to_rgba\" does.\r\n\r\n```\r\n# Before\r\ncolor = rgb2hex(colorConverter.to_rgb(line.get_color()))\r\nec = rgb2hex(colorConverter.to_rgb(line.get_markeredgecolor()))\r\nfc = rgb2hex(colorConverter.to_rgb(line.get_markerfacecolor()))\r\n\r\n# Fixed\r\ncolor = rgb2hex(colorConverter.to_rgba(line.get_color()))\r\nec = rgb2hex(colorConverter.to_rgba(line.get_markeredgecolor()))\r\nfc = rgb2hex(colorConverter.to_rgba(line.get_markerfacecolor()))\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/226264231","html_url":"https://github.com/matplotlib/matplotlib/pull/6589#issuecomment-226264231","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6589","id":226264231,"user":{"login":"dwgoon","id":9444960,"avatar_url":"https://avatars.githubusercontent.com/u/9444960?v=3","gravatar_id":"","url":"https://api.github.com/users/dwgoon","html_url":"https://github.com/dwgoon","followers_url":"https://api.github.com/users/dwgoon/followers","following_url":"https://api.github.com/users/dwgoon/following{/other_user}","gists_url":"https://api.github.com/users/dwgoon/gists{/gist_id}","starred_url":"https://api.github.com/users/dwgoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwgoon/subscriptions","organizations_url":"https://api.github.com/users/dwgoon/orgs","repos_url":"https://api.github.com/users/dwgoon/repos","events_url":"https://api.github.com/users/dwgoon/events{/privacy}","received_events_url":"https://api.github.com/users/dwgoon/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T17:44:30Z","updated_at":"2016-06-15T17:44:30Z","body":"Thanks for the reviews :)"}}
{"actor":{"display_login":"dwgoon"}}