Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Use white background for text/html result #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

garaemon
Copy link
Contributor

  • Use white background to increase visibility of the GUI icons on dark UI themes.

Before applying this change:
2017-12-22 23 48 43

After applying this change:
2017-12-22 23 52 06

test code from mpld3 example code

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import mpld3
from mpld3 import plugins
mpld3.enable_notebook()
np.random.seed(9615)

# generate df
N = 100
df = pd.DataFrame((.1 * (np.random.random((N, 5)) - .5)).cumsum(0),
                  columns=['a', 'b', 'c', 'd', 'e'],)

# plot line + confidence interval
fig, ax = plt.subplots()
ax.grid(True, alpha=0.3)

for key, val in df.iteritems():
    l, = ax.plot(val.index, val.values, label=key)
    ax.fill_between(val.index,
                    val.values * .5, val.values * 1.5,
                    color=l.get_color(), alpha=.4)

# define interactive legend

handles, labels = ax.get_legend_handles_labels() # return lines and labels
interactive_legend = plugins.InteractiveLegendPlugin(zip(handles,
                                                         ax.collections),
                                                     labels,
                                                     alpha_unsel=0.5,
                                                     alpha_over=1.5,
                                                     start_visible=True)
plugins.connect(fig, interactive_legend)

ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_title('Interactive legend', size=20)
fig.patch.set_facecolor('blue')
fig.patch.set_alpha(1.0)
mpld3.display()

* Use white background to increase visibility of the GUI icons on dark UI themes.
@ghost
Copy link

ghost commented Aug 4, 2018

Would it be possible to limit the white background to the plotting area only? So it does not stretch too much to the right side? Think it will look much better if it is limited.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant