plotly / plotly.py Goto Github PK
View Code? Open in Web Editor NEWThe interactive graphing library for Python :sparkles: This project now includes Plotly Express!
Home Page: https://plotly.com/python/
License: MIT License
The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
Home Page: https://plotly.com/python/
License: MIT License
I just noticed while making a few modifications to section 0 of the Python API User Guide that
fig['data'].update(some_dict)
does not work as it once did e.g. In [31]
in this old NB.
I made a more specific NB explaining this issue here.
In brief, the content of section 0 of the User Guide is inconsistent with the latest version of our Python API Library.
The iplot
function produces an HTML representation of a plotly plot for usage in the IPython notebook. IPython also supports converting notebooks to LaTeX/PDF documents through IPython.nbconvert
. To get this to work, iplot would have to also display a static image format of the plot. It would be as simply as a call to display(Image(raw_image_data))
to include that in the notebook.
We (IPython dev team) is super excited about plotly and are more than willing to answer questions, etc. about the IPython integration.
from #46
It seems to be impossible to have both Latex-formatted text and regular text appear in a title.
See the first plot in this notebook for an example of the problem:
I'm trying to make executable / standalone programs using Python. I've used Qt designer to design the GUI, and then used PyQT (pyuic4) to convert the .UI files into .PY files which I can edit and build my Python scripts / program within.
Finally, once the program is built, I use PyInstaller to compile them into standalone executable files on Windows. Unfortunately, any graphs plotted using the Plot.ly module fail to work, but matplotlib graphs still do work. Any ideas?
Here's an example which you can see works as .PY file, but if you compile using PyInstaller will not:
http://pastebin.com/yTF1zbwn
Over here you can see the exact program I'm developing in Python where my problem is occurring:
https://github.com/RUGRLN/bioinformatics/tree/master/Hydropathy%20Plot
Any ideas?
Hi,
I'm integrating plotly into a personal package we have called pyuvvis. Plotly is great by the way. I noticed that if I import plotly, then import the plotly portion of my package, everything works fine. EG:
import plotly
from pyuvvis.plotting.plotlywrapper import figure
However, if instead I had not imported plotly directly, I get an error (full traceback below):
from pyuvvis.plotting.plotlywrapper import figure
I am using enthought canopy as my primary python environment. We are using the most up-to-date version of plotly, requests and ipython. Any ideas of what's going on?
TypeError Traceback (most recent call last)
in ()
----> 1 from pyuvvis.plotting.plotlywrapper import figure
/home/adam/Desktop/pyuvvis/pyuvvis/plotting/plotlywrapper.py in ()
4 #import requests #bug if not imported
5 import logging
----> 6 import plotly.graph_objs as grobs
7 import numpy as np
8
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/plotly/init.py in ()
1 from . version import version
2 import graph_objs
----> 3 import plotly
4 import tools
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/plotly/plotly/init.py in ()
23
24 """
---> 25 from plotly import *
26
27 all = ["sign_in", "update_plot_options", "get_plot_options",
/home/adam/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.py in ()
15
16 """
---> 17 import requests
18 import chunked_requests
19 import json
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/site-packages/requests/init.py in ()
51 # Attempt to enable urllib3's SNI support, if possible
52 try:
---> 53 from requests.packages.urllib3.contrib import pyopenssl
54 pyopenssl.inject_into_urllib3()
55 except ImportError:
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/site-packages/requests/packages/init.py in ()
1 from future import absolute_import
2
----> 3 from . import urllib3
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/site-packages/requests/packages/urllib3/init.py in ()
36 pass
37
---> 38 logging.getLogger(name).addHandler(NullHandler())
39
40 def add_stderr_logger(level=logging.DEBUG):
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/logging/init.pyc in getLogger(name)
1555 """
1556 if name:
-> 1557 return Logger.manager.getLogger(name)
1558 else:
1559 return root
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/logging/init.pyc in getLogger(self, name)
1031 rv.manager = self
1032 self.loggerDict[name] = rv
-> 1033 self._fixupChildren(ph, rv)
1034 self._fixupParents(rv)
1035 else:
/home/adam/Canopy/appdata/canopy-1.3.0.1715.rh5-x86/lib/python2.7/logging/init.pyc in _fixupChildren(self, ph, alogger)
1085 for c in ph.loggerMap.keys():
1086 #The if means ... if not c.parent.name.startswith(nm)
-> 1087 if c.parent.name[:namelen] != name:
1088 alogger.parent = c.parent
1089 c.parent = alogger
TypeError: 'NoneType' object has no attribute 'getitem'
Hi,
I'm using this code to create a double axis plot:
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
x = arange(0,10)
y1 = rand(10)
y2 = rand(10)
fig = figure(figsize=(6,5))
ax1 = host_subplot(111, axes_class=AA.Axes)
ax2 = ax1.twinx()
plt.subplots_adjust(right=1)
ax1.plot(x, y1,'.-')
ax2.plot(x, y2,'r.-')
xlabel('x')
ax1.set_ylabel('y1', color='b')
ax2.set_ylabel('y2', color='r')
title('Double axis plot')
fig.tight_layout()
Is there a neat way to convert this to plotly? When I pass the fig to iplot_mpl it returns a gnarly error:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-475-abb745724116> in <module>()
19 title('Double axis plot')
20 fig.tight_layout()
---> 21 py.iplot_mpl(fig,filename='test')
//anaconda/lib/python2.7/site-packages/plotly/plotly/plotly.pyc in iplot_mpl(fig, resize, strip_style, update, **plot_options)
222
223 """
--> 224 fig = tools.mpl_to_plotly(fig, resize=resize, strip_style=strip_style)
225 if update and isinstance(update, dict):
226 try:
//anaconda/lib/python2.7/site-packages/plotly/tools.pyc in mpl_to_plotly(fig, resize, strip_style, verbose)
343 if _matplotlylib_imported:
344 renderer = matplotlylib.PlotlyRenderer()
--> 345 matplotlylib.Exporter(renderer).run(fig)
346 if resize:
347 renderer.resize()
//anaconda/lib/python2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.pyc in run(self, fig)
47 import matplotlib.pyplot as plt
48 plt.close(fig)
---> 49 self.crawl_fig(fig)
50
51 @staticmethod
//anaconda/lib/python2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.pyc in crawl_fig(self, fig)
114 props=utils.get_figure_properties(fig)):
115 for ax in fig.axes:
--> 116 self.crawl_ax(ax)
117
118 def crawl_ax(self, ax):
//anaconda/lib/python2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.pyc in crawl_ax(self, ax)
128 if(hasattr(text, 'get_text') and text.get_text()):
129 self.draw_text(ax, text, force_trans=ax.transAxes,
--> 130 text_type=ttp)
131 for artist in ax.artists:
132 # TODO: process other artists
//anaconda/lib/python2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.pyc in draw_text(self, ax, text, force_trans, text_type)
209 coordinates=coords,
210 text_type=text_type,
--> 211 style=style, mplobj=text)
212
213 def draw_patch(self, ax, patch, force_trans=None):
//anaconda/lib/python2.7/site-packages/plotly/matplotlylib/renderer.pyc in draw_text(self, **props)
491 """
492 self.msg += " Attempting to draw an mpl text object\n"
--> 493 if not mpltools.check_corners(props['mplobj'], self.mpl_fig):
494 warnings.warn("Looks like the annotation(s) you are trying \n"
495 "to draw lies/lay outside the given figure size.\n\n"
//anaconda/lib/python2.7/site-packages/plotly/matplotlylib/mpltools.pyc in check_corners(inner_obj, outer_obj)
37
38 def check_corners(inner_obj, outer_obj):
---> 39 inner_corners = inner_obj.get_window_extent().corners()
40 outer_corners = outer_obj.get_window_extent().corners()
41 if inner_corners[0][0] < outer_corners[0][0]:
//anaconda/lib/python2.7/site-packages/matplotlib/text.pyc in get_window_extent(self, renderer, dpi)
750 self._renderer = renderer
751 if self._renderer is None:
--> 752 raise RuntimeError('Cannot get window extent w/o renderer')
753
754 bbox, info, descent = self._get_layout(self._renderer)
RuntimeError: Cannot get window extent w/o renderer
I experience the following issue when importing plotly on Python 3 (3.3.0
on Windows, 3.4.0
on Linux). I haven't checked whether the error occurs on Python 2
plotly/graph_objs/graph_objs.py
(in 4ed359e and maybe before) at lines 42ff cause a type error in the json module's loads
function:
INFO = json.loads(resource_string('plotly',
'graph_reference/graph_objs_meta.json')
object_pairs_hook=collections.OrderedDict)
TypeError: the JSON object must be str, not 'bytes'
Manually decoding the byte string with an added .decode('utf-8')
solved my problems, but I'm not sure whether this will cause problems on Python 2 โ I.e. I'm not aware of whether the return type of resource_string
is different then.
i just discovered plotly and my first thought was to have a matplotlib->plotly converter. this would allow people which have infrastructure in matplotlib use plotly with minimal effort.
for example, a project i work on (www.scikit-rf.org) has some canned plotting methods. it would be nice to re-use all of the existing functionality, but create a plotly plot instead of a matplotlib plot.
the simplest thing i could think of is to start with a line-plot and pull all the data (xy-data, labels, formating, etc) using matplotlib api, and then create the plotly plot.
i am thinking about this in respect to ipython notebooks.
any thoughts on this?
Return stream status codes and API status codes.
Hello,
I'd like to ask if there are plans to integrate plotly with pandas, similiar to ggplot style. Or is it impossible without changing "philisophy" of input?
Thank you
... instead of mere dictionaries?
Currently, in plotly.py
py.Stream.write(data)
assumes that data is of the 'scatter'
type:
https://github.com/plotly/python-api/blob/master/plotly/plotly/plotly.py#L435
So, to stream a heatmap trace object for example, we must add 'type':'heatmap'
in the data
dictionary argument. Example (the last cell of):
http://nbviewer.ipython.org/github/etpinard/plotly-misc-nbs/blob/etienne/mtl_do/stream-test.ipynb
Why not have py.Stream.write(obj)
where obj
is a trace object (e.g. Scatter, Bar, Heatmap) and infer which 'type'
value is associated with each of them?
from #46
from #46
Sorry, the examples I was going to show were giving errors, but I think it's because of calls to ax.imshow() and contourf() in matplotlib rather than just the colorbars per-se.
would be sweet to have a function like this
http://mpld3.github.io/modules/API.html#mpld3.enable_notebook
which implicitly converts all mpl-plots to plotly.
perhaps the plotly-plots could be named based on the plot's title, if one exists, and other options (like private/public-ness) where arguments to enable_notebook()
As I am using this API to create my plots, I am posting the issue in this repository.
Until quite recently my plot did fit to whatever size the iframe was, but now the plot stands out. Here an example http://theansweris27.com/lap-times-for-the-2014-f1-monaco-grand-prix/
Regards.
is there a way to delete a plotly plot using the python api?
Hi,
when I try to run this classic api example:
import plotly.plotly as py
from plotly.graph_objs import *
py.sign_in("myusername", "mykey")
data = Data([
Bar(
x=['giraffes', 'orangutans', 'monkeys'],
y=[20, 14, 23]
)
])
plot_url = py.plot(data, filename='basic-bar')
I get this error:
Traceback (most recent call last):
File "test.py", line 1, in <module>
import plotly.plotly as py
File "/usr/local/lib/python2.7/dist-packages/plotly/__init__.py", line 31, in <module>
from plotly import plotly, graph_objs, tools, utils
File "/usr/local/lib/python2.7/dist-packages/plotly/plotly/__init__.py", line 12, in <module>
from plotly.plotly.plotly import *
File "/usr/local/lib/python2.7/dist-packages/plotly/plotly/plotly.py", line 29, in <module>
from plotly import tools
File "/usr/local/lib/python2.7/dist-packages/plotly/tools.py", line 20, in <module>
from . graph_objs import graph_objs
File "/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/__init__.py", line 12, in <module>
from plotly.graph_objs.graph_objs import *
File "/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/graph_objs.py", line 281, in <module>
@six.add_metaclass(ListMeta)
AttributeError: 'module' object has no attribute 'add_metaclass'
i'm on linux mint 16 - Python 2.7.5+
Any clues ?
I'm trying to use plotly, based on the tutorial here: http://nbviewer.ipython.org/github/plotly/python-user-guide/blob/master/s00_homepage/s00_homepage.ipynb
Seem to have the correct library and Python versions, although I get AttributeError while importing plotly. Wonder if anyone had the same problem, see versions and stacktrace below:
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
Type "copyright", "credits" or "license" for more information.
IPython 2.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import numpy
In [2]: numpy.__version__
Out[2]: '1.8.1'
In [3]: import pandas
In [4]: pandas.__version__
Out[4]: '0.13.1'
In [5]: import plotly
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-5-c27a4132ad2e> in <module>()
----> 1 import plotly
/usr/local/lib/python2.7/dist-packages/plotly/__init__.py in <module>()
29 from __future__ import absolute_import
30
---> 31 from plotly import plotly, graph_objs, tools, utils
32 from plotly.version import __version__
/usr/local/lib/python2.7/dist-packages/plotly/plotly/__init__.py in <module>()
10 from __future__ import absolute_import
11
---> 12 from plotly.plotly.plotly import *
13
14 __all__ = ["sign_in", "update_plot_options", "get_plot_options",
/usr/local/lib/python2.7/dist-packages/plotly/plotly/plotly.py in <module>()
27 from plotly.plotly import chunked_requests
28 from plotly import utils
---> 29 from plotly import tools
30 from plotly import exceptions
31 from plotly import version
/usr/local/lib/python2.7/dist-packages/plotly/tools.py in <module>()
18 from plotly import exceptions
19
---> 20 from . graph_objs import graph_objs
21
22 # Warning format
/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/__init__.py in <module>()
10 from __future__ import absolute_import
11
---> 12 from plotly.graph_objs.graph_objs import *
13
14 __all__ = ["Data",
/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/graph_objs.py in <module>()
279 return super(DictMeta, mcs).__new__(mcs, name, bases, attrs)
280
--> 281 @six.add_metaclass(ListMeta)
282 class PlotlyList(list):
283 """A container for PlotlyDicts, inherits from standard list.
AttributeError: 'module' object has no attribute 'add_metaclass'
would be nice to have something equivalent to mpl's axis('equal')
command to force a square aspect ratio.
Here is a list of matplotlylib imperfections I noticed while helping Randal Olson convert one of his matplotlib figure to plotly.
For more, refer to this notebook.
So, running
import plotly.plotly as py
py.plot_mpl(mpl_fig)
erroneously generates
'showline':True
), even if the original does notticks: 'inside'
), even if the original does not'xanchor': 'left'
to each annotation object.\n
escape sequences in strings are not converted to <br>
HTML tags'xref: 'paper'
and/or 'yref: 'paper'
to make them visible'ticksuffix'
a valid for x and y axes, like for radial axes?)Hello,
when i tried to install plotly using pip install plotly
, I got:
Downloading/unpacking plotly
Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): 1 Downloading plotly-1.0.10.tar.gz (60kB): Downloading plotly-1.0.10.tar.gz (60kB): 60kB downloaded
Running setup.py (path:/home/dan/prac/.virtualenvs/work/build/plotly/setup.py) egg_info for package plotly
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/dan/prac/.virtualenvs/work/build/plotly/setup.py", line 3, in <module>
exec (open('plotly/version.py').read())
File "<string>", line 3, in <module>
ImportError: No module named 'requests'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/dan/prac/.virtualenvs/work/build/plotly/setup.py", line 3, in <module>
exec (open('plotly/version.py').read())
File "<string>", line 3, in <module>
ImportError: No module named 'requests'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/dan/prac/.virtualenvs/work/build/plotly
Storing debug log for failure in /home/dan/.pip/pip.log
after installing "requests" using pip install requests
, everything works fine.
@theengineear any thoughts on this?
Not sure how this happened.
If it helps, here's my code:
fig = figure(figsize=(6,6))
for m in arange(0,len(data_IV_vs_T_vs_backgate)):
data = data_IV_vs_T_vs_backgate[m]
[Rmatup, Vmatup, Imatup, Rmatdown, Vmatdown, Imatdown, T, B] = data
ax = subplot(1,len(data_IV_vs_T_vs_backgate)+1,m+1)
colormap = cm.jet
colormap.set_gamma(1)
color_cycle = [colormap(i) for i in np.linspace(0, 0.9, len(Rmatup))]
ax.set_color_cycle(color_cycle)
for (t,I,R) in zip(T, Imatup, Rmatup):
label = 'T = ' + str(round(t*1e3)) + ' mK'
plot(I,R,label=label)
xlabel('$I_{dc} (A)$')
ylabel('$R_{xx,ac} (\Omega)$')
title(measnames[m])
width = 1000 # plot width in px
height = 500 # plot height in px
py.iplot_mpl(fig,filename='/superconductivity_XVII_LSM4_triton2/Rxxac_vs_Idc_vs_T_vs_Vbg', width=width, height=height)
Strip style is misbehaving in Python3 because this now equates to True:
hasattr('this', '__iter__')
Hi,
Nice library!
I am going to 'like' you on facebook, however the facebook link is wrong and I can't access the plot.ly page on facebook neither.
ylabel('R$_{xx,ac}$')
worked in matplotlib, didn't work in plotly
See
mpl modifies the figure's margins when one long annotation is placed on a figure, plotly does not.
How should we handle this?
In my case I want that axis, axis lines, ticks and tick texts are disabled also after conversion from matplotlib to plotly i.e in graphs visible in plotly web pages.
Although it is very easy way to modify graphs from plotly GUI it unfortunately requires manual work that I try to avoid. I was just wandering is there any way to make it already when creating graphs in python&matplotlib. I tried to use e.g.
ax13.set_axis_off() -> this did not make any change in plotly. It worked well in matplotlib where it disabled axis, spines and tick texts.
ax13.spines["bottom"].set_color('none')
ax13.spines["top"].set_color('none')
ax13.spines["left"].set_color('none')
ax13.spines["right"].set_color('none')
-> with there I disabled spines (but not ticks nor tick texts) in plotly
ax13.tick_params.set_visible(False)
ax13.tick_params(colors='none')
-> these did not make any changes in plotly
So, is it possible to make
ax13.set_axis_off()
work also after conversion from matplotlib to plotly?
Hello.
When I try this code I get an error in rendering Cell number 11:
TypeError: 'str' does not support the buffer interface
I guess it's because I'm running Python 3.4
. Since Python 3 there is necessary to treat bytes and unicodes differently.
On Python 3.2.3
In [1]: import plotly
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-c27a4132ad2e> in <module>()
----> 1 import plotly
/home/david/.virtualenv/glsl3/lib/python3.2/site-packages/plotly-1.1.4-py3.2.egg/plotly/__init__.py in <module>()
29 from . version import __version__
30 from . import graph_objs
---> 31 from . import plotly
32 from . import tools
33 from . import utils
/home/david/.virtualenv/glsl3/lib/python3.2/site-packages/plotly-1.1.4-py3.2.egg/plotly/plotly/__init__.py in <module>()
8
9 """
---> 10 from .plotly import *
11
12 __all__ = ["sign_in", "update_plot_options", "get_plot_options",
/home/david/.virtualenv/glsl3/lib/python3.2/site-packages/plotly-1.1.4-py3.2.egg/plotly/plotly/plotly.py in <module>()
351
352
--> 353 @utils.template_doc(**tools.get_config_file())
354 class Stream:
355 """ Interface to Plotly's real-time graphing API.
/home/david/.virtualenv/glsl3/lib/python3.2/site-packages/plotly-1.1.4-py3.2.egg/plotly/utils.py in _decorator(func)
138 def _decorator(func):
139 if func.__doc__ is not None:
--> 140 func.__doc__ = func.__doc__.format(**names)
141 return func
142 return _decorator
AttributeError: attribute '__doc__' of 'type' objects is not writable
Hi - there are some broken links in the following files
It looks like the repositories have moved - not sure what the correct ones should be.
README.md
Get started with our guide book!: http://nbviewer.ipython.org/github/etpinard/plotly-python-doc/blob/1.0/s0_getting-started/s0_getting-started.ipynb
README.rst
Plotly and mpld3: http://nbviewer.ipython.org/github/plotly/python-api/blob/1.0/notebooks/Plotly%20and%20mpld3.ipynb
Plotly and Python: http://nbviewer.ipython.org/github/plotly/python-api/blob/1.0/notebooks/Plotly%20and%20Python.ipynb
from #46
from matplotlib version 1.1.1
Traceback (most recent call last):
File "/Users/wdickerson/Desktop/plotly_test.py", line 14, in <module>
plot_url = py.plot_mpl(fig, filename='mpl-line-style')
File "/Library/Python/2.7/site-packages/plotly/plotly/plotly.py", line 262, in plot_mpl
fig = tools.mpl_to_plotly(fig, resize=resize, strip_style=strip_style)
File "/Library/Python/2.7/site-packages/plotly/tools.py", line 345, in mpl_to_plotly
matplotlylib.Exporter(renderer).run(fig)
File "/Library/Python/2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.py", line 49, in run
self.crawl_fig(fig)
File "/Library/Python/2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.py", line 116, in crawl_fig
self.crawl_ax(ax)
File "/Library/Python/2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.py", line 123, in crawl_ax
self.draw_line(ax, line)
File "/Library/Python/2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.py", line 182, in draw_line
force_trans=force_trans)
File "/Library/Python/2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.py", line 96, in process_transform
if transform.contains_branch(trans):
AttributeError: 'CompositeGenericTransform' object has no attribute 'contains_branch'
'type': 'scatter'
for Data instantiation.I'm running a Python script on an Amazon EC2 Linux Instance which uses the Python 2.6.9 interpreter. I installed plotly on the server, but when I try to import it I get the following error:
import plotly
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.6/site-packages/plotly/init.py", line 2, in
import graph_objs
File "/usr/lib/python2.6/site-packages/plotly/graph_objs/init.py", line 46, in
from graph_objs import *
File "/usr/lib/python2.6/site-packages/plotly/graph_objs/graph_objs.py", line 29, in
from .. import exceptions
ImportError: cannot import name exceptions
See the first plot in this notebook for an example of the problem:
When using matplotlib, error bars come in as bizarre looking scatter plots right now. This should be fixed in future releases.
http://nbviewer.ipython.org/gist/arsenovic/c2e82c7fc2554529580d
i noticed that if i embed a slightly different URL then it makes for very convenient in-notebook plot editing. this is a really sweet and seamless way to combine plotly's ease of use GUI editing with the notebook.
thoughts?
I'm running an ipython notebook that sets the default matplotlib background plot color as gray. The look fine; however, when I do:
py.iplot_mpl(fig)
The background color returns to white. Furthermore, if I explicitly pass a background color:
py.iplot_mpl(fig, plot_bgcolor='rgb(128,0,0)')
It is still white. Is py.iplot_mpl not passing the background color attribute through?
The is_bar() function in mpltools appears to be checking whether a patch is a bar by checking the minimum y value to see if it's zero. I typically create stacked bars in matplotlib by changing the named parameter, "bottom" to be non-zero. However, the is_bar() check wipes out all patches for which the minimum y value is not zero. I'd be happy to submit some sample code that breaks when rendering using the iplot_mpl() function from plotly if necessary.
trying to run plotly on a barebones, pip-less python distribution (the Arduino Yun) and ran into an ImportError
for pkg_resources
in graph_objs
. Should it be an official setup.py dependency?
is there any infrastructure to save and re-use layouts? couple things that would be nice
change my default layout
pass layout as argument to mpl_to_plotly
, iplot_mpl
, plot_mpl
have style files (like matplotlib.style)
from plotly import style
with style.context('ieeetrans'):
py.iplot(....)
I found a recent bug which was hard for me to trace. When I use the world_readable=False keyword in iplot_mpl(), I get a timeout. Not going to post the plot call because it uses custom libraries. Do you guys also get this timeout in general when doing
iplot_mpl(fig, world_readable=False)
HTTPError Traceback (most recent call last)
in ()
2
3 range_timeplot(ts.wavelength_slices(8), ax=ax)
----> 4 py.iplot_mpl(fig, update=_pyupdate, resize=False, world_readable=False)
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.pyc in iplot_mpl(fig, resize, strip_style, update, *_plot_options)
231 return iplot(fig, *_plot_options)
232
--> 233
234 def plot_mpl(fig, resize=True, strip_style=False, update=None, **plot_options):
235 """Replot a matplotlib figure with plotly.
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.pyc in iplot(figure_or_data, *_plot_options)
100 res = plot(figure_or_data, *_plot_options)
101 urlsplit = res.split('/')
--> 102 username, plot_id = urlsplit[-2][1:], urlsplit[-1] # TODO: HACKY!
103
104 embed_options = dict()
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.pyc in plot(figure_or_data, validate, *_plot_options)
183 res = _send_to_plotly(figure, *_plot_options)
184 if res['error'] == '':
--> 185 if plot_options['auto_open']:
186 try:
187 from webbrowser import open as wbopen
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/plotly/plotly/plotly.pyc in _send_to_plotly(figure, **plot_options)
568 return return_data['image']
569 else:
--> 570 try:
571 if ('content-type' in headers and
572 'json' in headers['content-type']):
/home/glue/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/requests/models.pyc in raise_for_status(self)
793
794 if http_error_msg:
--> 795 raise HTTPError(http_error_msg, response=self)
796
797 def close(self):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.