Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d76b27e

Browse filesBrowse files
committed
fixed 2d_density test again and updated the _convert_to_RGB_255 doc string -- rgb tuple coordinates are rounded down to floor int
1 parent d7d5db7 commit d76b27e
Copy full SHA for d76b27e

File tree

2 files changed

+9
-9
lines changed
Filter options

2 files changed

+9
-9
lines changed

‎plotly/tests/test_core/test_tools/test_figure_factory.py

Copy file name to clipboardExpand all lines: plotly/tests/test_core/test_tools/test_figure_factory.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,32 +1402,32 @@ def test_2D_density_all_args(self):
14021402
point_size=3, height=800, width=800)
14031403

14041404
exp_2D_density_chart = {
1405-
'data': [{'marker': {'color': 'rgb(0.0, 0.0, 127)',
1405+
'data': [{'marker': {'color': 'rgb(0, 0, 127)',
14061406
'opacity': 0.4,
14071407
'size': 3},
14081408
'mode': 'markers',
14091409
'name': 'points',
14101410
'type': 'scatter',
14111411
'x': [1, 2],
14121412
'y': [2, 4]},
1413-
{'colorscale': [[0.0, 'rgb(122.0, 69.0, 121.0)'],
1414-
[0.25, 'rgb(213.0, 96.0, 115.0)'],
1415-
[0.5, 'rgb(236.0, 158.0, 105.0)'],
1416-
[0.75, 'rgb(255.0, 255.0, 51.0)'],
1417-
[1.0, 'rgb(249.9, 249.9, 249.9)']],
1413+
{'colorscale': [[0.0, 'rgb(122, 69, 121)'],
1414+
[0.25, 'rgb(213, 96, 115)'],
1415+
[0.5, 'rgb(236, 158, 105)'],
1416+
[0.75, 'rgb(255, 255, 51)'],
1417+
[1.0, 'rgb(249, 249, 249)']],
14181418
'name': 'density',
14191419
'ncontours': 20,
14201420
'reversescale': True,
14211421
'showscale': False,
14221422
'type': 'histogram2dcontour',
14231423
'x': [1, 2],
14241424
'y': [2, 4]},
1425-
{'marker': {'color': 'rgb(255.0, 237.0, 222.0)'},
1425+
{'marker': {'color': 'rgb(255, 237, 222)'},
14261426
'name': 'x density',
14271427
'type': 'histogram',
14281428
'x': [1, 2],
14291429
'yaxis': 'y2'},
1430-
{'marker': {'color': 'rgb(255.0, 237.0, 222.0)'},
1430+
{'marker': {'color': 'rgb(255, 237, 222)'},
14311431
'name': 'y density',
14321432
'type': 'histogram',
14331433
'xaxis': 'x2',

‎plotly/tools.py

Copy file name to clipboardExpand all lines: plotly/tools.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4562,7 +4562,7 @@ def _endpts_to_intervals(endpts):
45624562
@staticmethod
45634563
def _convert_to_RGB_255(colors):
45644564
"""
4565-
Multiplies each element of a triplet by 255 and rounds to nearest int
4565+
Multiplies each element of a triplet by 255 and rounds to floor int
45664566
"""
45674567

45684568
return (int(colors[0]*255.0),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.