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

added histogram to facet_grid #776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jul 1, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed tests
  • Loading branch information
Kully committed Jun 27, 2017
commit af965d07c04f664fbaddbefba0b59ff57d4592fe
11 changes: 7 additions & 4 deletions 11 plotly/figure_factory/_facet_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ def _facet_grid(df, x, y, facet_row, facet_col, num_of_rows,
type=trace_type,
marker=dict(
color=marker_color,
line=kwargs_marker['line']
line=kwargs_marker['line'],
#opacity=kwargs_marker['opacity'],
),
**kwargs_trace
)
Expand All @@ -512,7 +513,8 @@ def _facet_grid(df, x, y, facet_row, facet_col, num_of_rows,
type=trace_type,
marker=dict(
color=marker_color,
line=kwargs_marker['line']
line=kwargs_marker['line'],
#opacity=kwargs_marker['opacity'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be commented out?

),
**kwargs_trace
)
Expand Down Expand Up @@ -562,7 +564,8 @@ def _facet_grid(df, x, y, facet_row, facet_col, num_of_rows,
type=trace_type,
marker=dict(
color=marker_color,
line=kwargs_marker['line']
line=kwargs_marker['line'],
#opacity=kwargs_marker['opacity'],
),
**kwargs_trace
)
Expand Down Expand Up @@ -812,7 +815,7 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None,

if 'opacity' not in kwargs_marker:
if not ggplot2:
kwargs_marker['opacity'] = 0.75
kwargs_trace['opacity'] = 0.6

if 'line' not in kwargs_marker:
if not ggplot2:
Expand Down
19 changes: 17 additions & 2 deletions 19 plotly/tests/test_optional/test_figure_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,19 @@ def test_data_must_be_dataframe(self):
ff.create_facet_grid,
data, 'a', 'b')

def test_x_and_y_for_scatter(self):
data = pd.DataFrame([[0, 0], [1, 1]], columns=['a', 'b'])

pattern = (
"You need to input 'x' and 'y' if you are you are using a "
"trace_type of 'scatter' or 'scattergl'."
)

self.assertRaisesRegexp(PlotlyError, pattern,
ff.create_facet_grid,
data, 'a')


def test_valid_col_selection(self):
data = pd.DataFrame([[0, 0], [1, 1]], columns=['a', 'b'])

Expand Down Expand Up @@ -2017,10 +2030,11 @@ def test_valid_facet_grid_fig(self):
)

exp_facet_grid = {
'data': [{'marker': {'color': 'rgba(31, 119, 180, 0.5)',
'data': [{'marker': {'color': 'rgb(31, 119, 180)',
'line': {'color': 'darkgrey', 'width': 1},
'size': 8},
'mode': 'markers',
'opacity': 0.6,
'type': 'scatter',
'x': [1.8,
1.8,
Expand All @@ -2038,10 +2052,11 @@ def test_valid_facet_grid_fig(self):
16,
20],
'yaxis': 'y1'},
{'marker': {'color': 'rgba(31, 119, 180, 0.5)',
{'marker': {'color': 'rgb(31, 119, 180)',
'line': {'color': 'darkgrey', 'width': 1},
'size': 8},
'mode': 'markers',
'opacity': 0.6,
'type': 'scatter',
'x': [2.8,
2.8,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.