{"action":"created","comment":{"url":"https://api.github.com/repos/bokeh/bokeh/pulls/comments/91166719","pull_request_review_id":11676600,"id":91166719,"diff_hunk":"@@ -125,9 +136,17 @@ export class DataRange1d extends DataRange\n     [start, end] = @_compute_range(min, max)\n \n     if @_initial_start?\n-      start = @_initial_start\n+      if @_mapper_type == \"log\"\n+        if @_initial_start > 0\n+          start = @_initial_start\n+      else\n+        start = @_initial_start\n     if @_initial_end?\n-      end = @_initial_end\n+      if @_mapper_type == \"log\"\n+        if @_initial_end > 0\n+          end = @_initial_end\n+      else\n+        end = @_initial_end","path":"bokehjs/src/coffee/models/ranges/data_range1d.coffee","position":54,"original_position":54,"commit_id":"b710c8b92663dbe67373fbd28eab54ff7e614934","original_commit_id":"b710c8b92663dbe67373fbd28eab54ff7e614934","user":{"login":"StevenCHowell","id":9484229,"avatar_url":"https://avatars.githubusercontent.com/u/9484229?v=3","gravatar_id":"","url":"https://api.github.com/users/StevenCHowell","html_url":"https://github.com/StevenCHowell","followers_url":"https://api.github.com/users/StevenCHowell/followers","following_url":"https://api.github.com/users/StevenCHowell/following{/other_user}","gists_url":"https://api.github.com/users/StevenCHowell/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenCHowell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenCHowell/subscriptions","organizations_url":"https://api.github.com/users/StevenCHowell/orgs","repos_url":"https://api.github.com/users/StevenCHowell/repos","events_url":"https://api.github.com/users/StevenCHowell/events{/privacy}","received_events_url":"https://api.github.com/users/StevenCHowell/received_events","type":"User","site_admin":false},"body":"In my experience using matplotlib and matlab, plotting data on a log scale does silently ignore values less than zero.  This should be understood as part of the logarithm function.\r\n","created_at":"2016-12-06T20:43:55Z","updated_at":"2016-12-06T20:43:55Z","html_url":"https://github.com/bokeh/bokeh/pull/5477#discussion_r91166719","pull_request_url":"https://api.github.com/repos/bokeh/bokeh/pulls/5477","_links":{"self":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/comments/91166719"},"html":{"href":"https://github.com/bokeh/bokeh/pull/5477#discussion_r91166719"},"pull_request":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/5477"}}},"pull_request":{"url":"https://api.github.com/repos/bokeh/bokeh/pulls/5477","id":94506667,"html_url":"https://github.com/bokeh/bokeh/pull/5477","diff_url":"https://github.com/bokeh/bokeh/pull/5477.diff","patch_url":"https://github.com/bokeh/bokeh/pull/5477.patch","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/5477","number":5477,"state":"open","locked":false,"title":"Fix for log scale plotting bug","user":{"login":"clairetang6","id":4241244,"avatar_url":"https://avatars.githubusercontent.com/u/4241244?v=3","gravatar_id":"","url":"https://api.github.com/users/clairetang6","html_url":"https://github.com/clairetang6","followers_url":"https://api.github.com/users/clairetang6/followers","following_url":"https://api.github.com/users/clairetang6/following{/other_user}","gists_url":"https://api.github.com/users/clairetang6/gists{/gist_id}","starred_url":"https://api.github.com/users/clairetang6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clairetang6/subscriptions","organizations_url":"https://api.github.com/users/clairetang6/orgs","repos_url":"https://api.github.com/users/clairetang6/repos","events_url":"https://api.github.com/users/clairetang6/events{/privacy}","received_events_url":"https://api.github.com/users/clairetang6/received_events","type":"User","site_admin":false},"body":"This PR is for fixing a bug in log plotting, where plots are empty or where axes use incorrect initial ranges under some circumstances (related to the minimum and maximum value of the data and the `range_padding`). This bug is caused when a DataRange1d determines that its `start` should be a negative value. This can happen even when all the data are positive values (necessary to be shown on a log plot since log(x) is only defined for x>0) because the `range_padding` calculation is done linearly. \r\n\r\nThere are three main ways of approaching a fix. \r\n1. Have the DataRange1d (or something above it) check whether it's being used linearly or log-ly. \r\n2. Have the DataRange1d know whether it's linear or log. \r\n3. Delegate the range bounds calculation to the tickers. \r\n\r\nThis PR implements approach 2. by adding a new property `mapper_type` to the DataRange1d. Then the range calculation can be done correctly whether linear or log by the DataRange1d. \r\n\r\nCons for approach 1.\r\n-It would be a little convoluted to figure out whether the DataRange1d is linear or log. The  DataRange1d doesn't know whether it is an x_range or y_range. The plot_canvas that updates the  DataRange1d knows which dimension the DataRange1d is, but then would need to find the matching Axis from its Plot's `renderers` to inspect that Axis's ticker. \r\n\r\nCons for approach 3. \r\n-Ranges are currently in charge of figuring out data-derived bounds which are compared to user-supplied bounds to determine the bounds. If the ranges no longer take into account the padding into their data-derived bounds, then the comparison between data and user bounds will need to use logic moved into the ticker. \r\n-Range `start` and `end` values are set by pan/zoom tools. If the ticker defaults to adding padding, the ticker will need to know not to add padding when panning/zooming. \r\n\r\n\r\nSome other things to consider:\r\n-When a user creates a DataRange1d to use in a log plot instead of using the default, they will need (not absolutely, but they will probably want) to supply `mapper_type=\"log\"` if they don't supply a `start` and `end` and want the correct range padding. If they do supply a `start` and `end` (and they are both positive values), but don't supply a `mapper_type=\"log\"`, then the plot will still be correct. This is because the ticker and mapper are still log and will produce the correct ticks and screen-mapped values. \r\n\r\n- [x] issues: fixes #3834 #5389 #2789\r\n- [ ] support different exponential bases\r\n- [ ] tests added / passed\r\n- [ ] release document entry (if new feature or API change)\r\n","created_at":"2016-11-20T04:20:09Z","updated_at":"2016-12-06T20:43:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21ead447d8b14c87f4106c2f7778fd9f78dda0c3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bokeh/bokeh/pulls/5477/commits","review_comments_url":"https://api.github.com/repos/bokeh/bokeh/pulls/5477/comments","review_comment_url":"https://api.github.com/repos/bokeh/bokeh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/5477/comments","statuses_url":"https://api.github.com/repos/bokeh/bokeh/statuses/b710c8b92663dbe67373fbd28eab54ff7e614934","head":{"label":"bokeh:clairetang6/3834_fix_log_plot_bug","ref":"clairetang6/3834_fix_log_plot_bug","sha":"b710c8b92663dbe67373fbd28eab54ff7e614934","user":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"repo":{"id":3834332,"name":"bokeh","full_name":"bokeh/bokeh","owner":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bokeh/bokeh","description":"Interactive Web Plotting for Python","fork":false,"url":"https://api.github.com/repos/bokeh/bokeh","forks_url":"https://api.github.com/repos/bokeh/bokeh/forks","keys_url":"https://api.github.com/repos/bokeh/bokeh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bokeh/bokeh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bokeh/bokeh/teams","hooks_url":"https://api.github.com/repos/bokeh/bokeh/hooks","issue_events_url":"https://api.github.com/repos/bokeh/bokeh/issues/events{/number}","events_url":"https://api.github.com/repos/bokeh/bokeh/events","assignees_url":"https://api.github.com/repos/bokeh/bokeh/assignees{/user}","branches_url":"https://api.github.com/repos/bokeh/bokeh/branches{/branch}","tags_url":"https://api.github.com/repos/bokeh/bokeh/tags","blobs_url":"https://api.github.com/repos/bokeh/bokeh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bokeh/bokeh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bokeh/bokeh/git/refs{/sha}","trees_url":"https://api.github.com/repos/bokeh/bokeh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bokeh/bokeh/statuses/{sha}","languages_url":"https://api.github.com/repos/bokeh/bokeh/languages","stargazers_url":"https://api.github.com/repos/bokeh/bokeh/stargazers","contributors_url":"https://api.github.com/repos/bokeh/bokeh/contributors","subscribers_url":"https://api.github.com/repos/bokeh/bokeh/subscribers","subscription_url":"https://api.github.com/repos/bokeh/bokeh/subscription","commits_url":"https://api.github.com/repos/bokeh/bokeh/commits{/sha}","git_commits_url":"https://api.github.com/repos/bokeh/bokeh/git/commits{/sha}","comments_url":"https://api.github.com/repos/bokeh/bokeh/comments{/number}","issue_comment_url":"https://api.github.com/repos/bokeh/bokeh/issues/comments{/number}","contents_url":"https://api.github.com/repos/bokeh/bokeh/contents/{+path}","compare_url":"https://api.github.com/repos/bokeh/bokeh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bokeh/bokeh/merges","archive_url":"https://api.github.com/repos/bokeh/bokeh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bokeh/bokeh/downloads","issues_url":"https://api.github.com/repos/bokeh/bokeh/issues{/number}","pulls_url":"https://api.github.com/repos/bokeh/bokeh/pulls{/number}","milestones_url":"https://api.github.com/repos/bokeh/bokeh/milestones{/number}","notifications_url":"https://api.github.com/repos/bokeh/bokeh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bokeh/bokeh/labels{/name}","releases_url":"https://api.github.com/repos/bokeh/bokeh/releases{/id}","deployments_url":"https://api.github.com/repos/bokeh/bokeh/deployments","created_at":"2012-03-26T15:40:01Z","updated_at":"2016-12-06T19:17:52Z","pushed_at":"2016-12-06T19:20:56Z","git_url":"git://github.com/bokeh/bokeh.git","ssh_url":"git@github.com:bokeh/bokeh.git","clone_url":"https://github.com/bokeh/bokeh.git","svn_url":"https://github.com/bokeh/bokeh","homepage":"http://bokeh.pydata.org/en/latest/","size":187255,"stargazers_count":4897,"watchers_count":4897,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1166,"mirror_url":null,"open_issues_count":772,"forks":1166,"open_issues":772,"watchers":4897,"default_branch":"master"}},"base":{"label":"bokeh:master","ref":"master","sha":"417a7fa0ccaff46529b023a269ad4461ac921db8","user":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"repo":{"id":3834332,"name":"bokeh","full_name":"bokeh/bokeh","owner":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bokeh/bokeh","description":"Interactive Web Plotting for Python","fork":false,"url":"https://api.github.com/repos/bokeh/bokeh","forks_url":"https://api.github.com/repos/bokeh/bokeh/forks","keys_url":"https://api.github.com/repos/bokeh/bokeh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bokeh/bokeh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bokeh/bokeh/teams","hooks_url":"https://api.github.com/repos/bokeh/bokeh/hooks","issue_events_url":"https://api.github.com/repos/bokeh/bokeh/issues/events{/number}","events_url":"https://api.github.com/repos/bokeh/bokeh/events","assignees_url":"https://api.github.com/repos/bokeh/bokeh/assignees{/user}","branches_url":"https://api.github.com/repos/bokeh/bokeh/branches{/branch}","tags_url":"https://api.github.com/repos/bokeh/bokeh/tags","blobs_url":"https://api.github.com/repos/bokeh/bokeh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bokeh/bokeh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bokeh/bokeh/git/refs{/sha}","trees_url":"https://api.github.com/repos/bokeh/bokeh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bokeh/bokeh/statuses/{sha}","languages_url":"https://api.github.com/repos/bokeh/bokeh/languages","stargazers_url":"https://api.github.com/repos/bokeh/bokeh/stargazers","contributors_url":"https://api.github.com/repos/bokeh/bokeh/contributors","subscribers_url":"https://api.github.com/repos/bokeh/bokeh/subscribers","subscription_url":"https://api.github.com/repos/bokeh/bokeh/subscription","commits_url":"https://api.github.com/repos/bokeh/bokeh/commits{/sha}","git_commits_url":"https://api.github.com/repos/bokeh/bokeh/git/commits{/sha}","comments_url":"https://api.github.com/repos/bokeh/bokeh/comments{/number}","issue_comment_url":"https://api.github.com/repos/bokeh/bokeh/issues/comments{/number}","contents_url":"https://api.github.com/repos/bokeh/bokeh/contents/{+path}","compare_url":"https://api.github.com/repos/bokeh/bokeh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bokeh/bokeh/merges","archive_url":"https://api.github.com/repos/bokeh/bokeh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bokeh/bokeh/downloads","issues_url":"https://api.github.com/repos/bokeh/bokeh/issues{/number}","pulls_url":"https://api.github.com/repos/bokeh/bokeh/pulls{/number}","milestones_url":"https://api.github.com/repos/bokeh/bokeh/milestones{/number}","notifications_url":"https://api.github.com/repos/bokeh/bokeh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bokeh/bokeh/labels{/name}","releases_url":"https://api.github.com/repos/bokeh/bokeh/releases{/id}","deployments_url":"https://api.github.com/repos/bokeh/bokeh/deployments","created_at":"2012-03-26T15:40:01Z","updated_at":"2016-12-06T19:17:52Z","pushed_at":"2016-12-06T19:20:56Z","git_url":"git://github.com/bokeh/bokeh.git","ssh_url":"git@github.com:bokeh/bokeh.git","clone_url":"https://github.com/bokeh/bokeh.git","svn_url":"https://github.com/bokeh/bokeh","homepage":"http://bokeh.pydata.org/en/latest/","size":187255,"stargazers_count":4897,"watchers_count":4897,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1166,"mirror_url":null,"open_issues_count":772,"forks":1166,"open_issues":772,"watchers":4897,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/5477"},"html":{"href":"https://github.com/bokeh/bokeh/pull/5477"},"issue":{"href":"https://api.github.com/repos/bokeh/bokeh/issues/5477"},"comments":{"href":"https://api.github.com/repos/bokeh/bokeh/issues/5477/comments"},"review_comments":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/5477/comments"},"review_comment":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/5477/commits"},"statuses":{"href":"https://api.github.com/repos/bokeh/bokeh/statuses/b710c8b92663dbe67373fbd28eab54ff7e614934"}}}}
{"actor":{"display_login":"StevenCHowell"}}