Skip to content

Conversation

@chriddyp
Copy link
Member

  • update response object handling within the static image interface
  • exposed support for svg, pdf, and jpeg

Copy link
Contributor

Choose a reason for hiding this comment

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

should we be more specific than 'json'? 'application/json'?

@theengineear
Copy link
Contributor

Looks good from the Python API side of things!
🐖

@etpinard
Copy link
Contributor

Hmm.

Off the better_svg_support branch, I'm getting:

      6 figure = py.get_figure('al_indigo', '38')
----> 7 py.image.save_as(figure, 'test.png')

/home/etienne/plotly/python-api/plotly/plotly/plotly.pyc in save_as(cls, figure_or_data, filename, format, width, height)
    620 
    621         f = open(filename, 'w')
--> 622         f.write(img)
    623         f.close()
    624 

TypeError: expected a character buffer object

And similarly for

 py.image.save_as(figure, 'test.svg')

with

print img    # --> None

between line 621 and 622

@chriddyp
Copy link
Member Author

Ah yeah, at this point it only works with a development version of plot.ly.
So once the dev branch gets deployed, this will work.

On Mon, Jun 30, 2014 at 11:07 AM, Étienne Tétreault-Pinard <
notifications@github.com> wrote:

Hmm.

Off the better_svg_support branch, I'm getting:

  6 figure = py.get_figure('al_indigo', '38')

----> 7 py.image.save_as(figure, 'test.png')

/home/etienne/plotly/python-api/plotly/plotly/plotly.pyc in save_as(cls, figure_or_data, filename, format, width, height)
620
621 f = open(filename, 'w')
--> 622 f.write(img)
623 f.close()
624

TypeError: expected a character buffer object


Reply to this email directly or view it on GitHub
#43 (comment).

chriddyp added a commit that referenced this pull request Jun 30, 2014
static image support for other formats
@chriddyp chriddyp merged commit 97c1d70 into master Jun 30, 2014
@chriddyp chriddyp deleted the better_svg_support branch June 30, 2014 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants