Skip to content
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

how to save as PNG? #19

Closed
tbreloff opened this issue Sep 12, 2015 · 12 comments
Closed

how to save as PNG? #19

tbreloff opened this issue Sep 12, 2015 · 12 comments

Comments

@tbreloff
Copy link
Member

I'm starting to look through this package for implementation in Plots.jl, but I can't figure out how you created the PNG files. Did you do that by hand? Any ideas of how to automate?

@tbreloff
Copy link
Member Author

I'm basically done implementing this in Plots.jl, just need the savepng method and I can produce the examples markdown similar to https://github.com/tbreloff/Plots.jl/blob/master/docs/qwt_examples.md.

If you're curious about any of the implementation, check out: https://github.com/tbreloff/Plots.jl/blob/dev/src/backends/unicodeplots.jl

@Evizero
Copy link
Member

Evizero commented Sep 12, 2015

There is no way currently to produce images from Unicode Plots. Frankly, I don't plan on coming up with one as I don't see the use case (except to produce documentation, which I admit would be nice).

@tbreloff
Copy link
Member Author

Check out the examples!

If you want to see what I did, check out savepng here.

@Evizero
Copy link
Member

Evizero commented Sep 13, 2015

Cool!

.. I'll fix that limit rounding issue

@waldyrious
Copy link
Contributor

I think the natural export format for UnicodePlots.jl should be *.txt. Maybe implement a convenience save() function that does this to spare the select/copy/paste/save workflow that would otherwise be needed? Not that the exported graphs would be very useful anyway, but it seems too much of a natural fit not to do :)

@Evizero
Copy link
Member

Evizero commented Sep 24, 2015

I have been think about that before. I didn't do it in the end, because even with gedit I found myself unable to force a monospace rendering of the text. it just never looks the way it does in the terminal, no matter what font I use. This annoys the heck out of me

@Evizero
Copy link
Member

Evizero commented Sep 24, 2015

Also, if I do want to store the output, I actually only use it the same way I use println in the sense that I just redirect STDOUT.

After all, my motivation for implementing UnicodePlots in the first place, was to have more useful terminal output.

That being said, if you would actually like to have a save function to store the text-output, then I will implement one

@waldyrious
Copy link
Contributor

I don't think it's necessary, just kinda makes sense (and if Plots.jl ends up implementing a generic save() funcion, this would be a more appropriate solution for UnicodePlots.jl rather than doing nothing or applying an OSX-only hack)

@Evizero
Copy link
Member

Evizero commented Sep 24, 2015

sure, makes sense

@tbreloff
Copy link
Member Author

and if Plots.jl ends up implementing a generic save() funcion

What did you have in mind? Want to start an issue?

@waldyrious
Copy link
Contributor

and if Plots.jl ends up implementing a generic save() funcion

What did you have in mind? Want to start an issue?

Oh, nothing in particular, it just seems to me to be much in line with the philosophy of Plots.jl, i.e. generic methods that adapt to the backend, or in this case, the output format -- so that you might have something like save(plot, format="png") rather than savepng(), savetxt(), savesvg(), and so on. If you like the idea, I can open an issue in Plots.jl :)

@tbreloff
Copy link
Member Author

Sure open an issue... of course it would probably be easiest to have a save
method which looks at the file extension and figures it out.

On Thu, Sep 24, 2015 at 4:00 PM, Waldir Pimenta notifications@github.com
wrote:

and if Plots.jl ends up implementing a generic save() funcion

What did you have in mind? Want to start an issue?

Oh, nothing in particular, it just seems to me to be much in line with the
philosophy of Plots.jl, i.e. generic methods that adapt to the backend, or
in this case, the output format -- so that you might have something like save(plot,
format="png") rather than savepng(), savetxt(), savesvg(), and so on. If
you like the idea, I can open an issue in Plots.jl :)


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

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

No branches or pull requests

3 participants