Comments (19)
It would also be nice if you could only set the labels without plotting anything extra, for example
p = plot(rand(10))
plot!(;xlabel="label")
from plots.jl.
Yeah this should be possible with most backends. I see you're using pyplot, so I'll handle that first.
I'll also add shorthands 'xlabel!()', etc. I should be able to do this today.
On Sep 22, 2015, at 5:01 AM, Kristoffer Carlsson [email protected] wrote:
It would also be nice if you could only set the labels without plotting anything extra, for example
p = plot(rand(10))
plot!(;xlabel="label")
—
Reply to this email directly or view it on GitHub.
from plots.jl.
I'm using PyPlot because I'm having some troubles with the other backends in IJulia.
For example:
Same with Immerse and Gadfly.
from plots.jl.
I'm a little confused what you're trying to do. x_mod
and y_mod
are not valid arguments in Plots, so I wouldn't expect this to flow through to the backends at all. Also what is matstats
? Let me know how you'd like to call this, and I can either tell you the right way, or add support for it.
from plots.jl.
Sorry, I understand your confusion, I should have explained better. I am writing a package where the resulting data is a bit messy to extract from the type. To facilitate plotting of the results I therefore extend the plot
function in Plots.jl
with another function that take the types in my package (matstat
is one of those types). This function then extracts the needed data from the type and then finally calls the Plots.jl
plot
-function and return that plot object
However, the problem has nothing to do with this, it is just that with certain backends like Immerse, Gadfly, Winston I get no output in IJulia.
An example which does not contain any of my own code:
from plots.jl.
Using for example Gadfly directly works.
from plots.jl.
Ah I see, so it's just not displaying in IJulia. Ok I need to look into that... I don't actually use IJulia at all, but I know others do, so I want that to work as expected.
from plots.jl.
Just installed IJulia, so I'll investigate further. However, does it work if you do:
using Plots
gadfly!()
plot(rand(10))
display(currentPlot())
from plots.jl.
Cool! That works beautifully for Gadfly and Immerse (Immerse opens a new window but I guess this is to expect since it has the GUI functionality).
For Winston (works with using Winston
):
LoadError: MethodError: `display` has no method matching display(::Gtk.GtkCanvas, ::Winston.FramedPlot)
Closest candidates are:
display(!Matched::AbstractString, ::Any)
display(!Matched::TextDisplay, ::Any)
display(!Matched::MIME{mime}, ::Any)
...
from plots.jl.
Ok thanks. I'll look into Winston, but I suspect that IJulia calls a
specific "writemime" method to show its results, and my display method is
only getting called from the REPL. It should be a relatively easy fix, as
soon as I figure out the specific problem.
On Tue, Sep 22, 2015 at 11:08 AM, Kristoffer Carlsson <
[email protected]> wrote:
Cool! That works beautifully for Gadfly
For Winston (works with using Winston):
LoadError: MethodError:
display
has no method matching display(::Gtk.GtkCanvas, ::Winston.FramedPlot)
Closest candidates are:
display(!Matched::AbstractString, ::Any)
display(!Matched::TextDisplay, ::Any)
display(!Matched::MIME{mime}, ::Any)
...—
Reply to this email directly or view it on GitHub
#27 (comment).
from plots.jl.
By the way, this works on the development branch, and I'll push it to master once I finish with a display/writemime re-write.
using Plots
plot(rand(10))
plot!(title="title", ylabel="ylabel")
xlabel!("xlabel") # shorthand for plot!(xlabel="xlabel")
from plots.jl.
Both the original labels/title request, and the IJulia display issues should all be fixed now on latest master. Please try it out.
from plots.jl.
Works great! Thanks!
from plots.jl.
Cool! If there's anything that's not easy or intuitive, please let me
know. I want this to be the kind of package that "just works" no matter
what you throw at it.
On Wed, Sep 23, 2015 at 10:00 AM, Kristoffer Carlsson <
[email protected]> wrote:
Works great! Thanks!
—
Reply to this email directly or view it on GitHub
#27 (comment).
from plots.jl.
One thing, for Gadfly this works great:
For Pyplot I get two outputs, one that is above the Out
:
Winston works.
Unicodeplots workish (maybe this is a limitation with the backend):
from plots.jl.
Thanks... I'll look into PyPlot's double-display. As for UnicodePlots, that's more of a REPL plotting tool... I'm actually surprised it does anything even remotely good in IJulia!
from plots.jl.
Also one additional comment... unless you need the plot reference p
somewhere later in your code, it's unnecessary. Instead of
pyplot!()
p = plot(rand(10))
plot!(p, rand(10))
you can do:
pyplot!()
plot(rand(10))
plot!(rand(10))
Plots keeps track of the "current plot" for you, and when you leave it out it will automatically update the current plot.
from plots.jl.
I pushed to master. The pyplot double-show issue is still there, and is not an immediately easy solution. The pyplot code is a little hacky to get it to work in IJulia, and the figure seems to be displayed at various stages of the building process, and not after the plot method returns. It works fine at the REPL, so I need to pour through Steven's code a little more to understand what he's doing for IJulia.
from plots.jl.
closing for more specific issue #29
from plots.jl.
Related Issues (20)
- [FR] Retrieve Plot Attributes HOT 1
- [BUG] Plots fails to install on MacOS (arm64) with Julia 1.10 HOT 4
- [BUG] `ylims` does not respect `yflip=true`
- [BUG] pythonplot backend not working: UndefVarError: `pyisnone` not defined HOT 2
- PythonCall.pyisnone() does not exist, please remove it from source code HOT 1
- [BUG] heatmap output shifts relative to axis when using logarithmic xscale and setting xlims on GR HOT 1
- [BUG] Arrow does not work with pgfplotsx
- Warning when loading Plotly backend
- [BUG] Huge vertical margin of `plot_title` HOT 8
- [FR] Improve the `xticks!` dosctring
- [FR] savefig("foo.svgz") (gzip-compressed SVG) HOT 1
- [BUG] grouping Measurement data leads to wrong errorbars in plot
- [BUG] PGFPlotsX doesn't colour certain markers in a scatter plot.
- Support for PlotlyKaleido@2
- Feature request: add keyword to make Julia wait until plot window closes
- [BUG] Julia 1.10.2 fails when trying to add or use Plots issuing Pkg.add("Plots") or using Plots HOT 11
- [FR] Flip yaxis of heatmap
- [FR] Better legends for :vline and :hline HOT 1
- [BUG] Plots.jl dependencies are broken, cannot install the package HOT 3
- [FR] Reproducible output with PGFPlotsX backend
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plots.jl.