-
Notifications
You must be signed in to change notification settings - Fork 35
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
wrong image size on Ubuntu with Julia Display #53
Comments
Update: it is actually not strictly a QML issue. The display size issue only happen with the GR backend. Gtk is also affected, for example: using Plots, Gtk
gr()
plot(rand(100))
tmp = tempname() * ".png"
savefig(tmp)
img = GtkImage(tmp)
win = GtkWindow("test")
push!(win, img)
showall(win) would show an image much bigger than the original png. It wouldn't happen with a different backend (have tried plotlyjs to confirm). I suspect it started with #1318, I'm pinging @jheinen as he probably knows what's going on. |
Hi, Sorry for my late reply, but this is probably the device pixel ratio. The |
Hi, thanks for looking into this. I actually do not believe this has to do with |
There s no need to use PNGs in QML/GR environments. You can directly draw into the widget provided by Qt, which is much faster. GR example: https://github.com/jheinen/GR.jl/blob/master/examples/qml_ex.jl QML file: https://github.com/jheinen/GR.jl/blob/master/examples/qml_ex.qml |
Thanks, I'll try that in my use case. |
Probably not the right place to report this, but I'm having issues running your example on Ubuntu: julia> Pkg.status("GR")
- GR 0.25.0
julia> ENV["GRDIR"]=""
""
julia> Pkg.build("GR")
julia> GR.version()
"0.28.0"
julia> include(joinpath(Pkg.dir("GR", "examples"), "qml_plots_ex.jl"))
GKS: Qt5 support not compiled in I imagine is a similar issue to this comment but for the Ubuntu precompiled binaries. I get the QML window, with the slider, which detects my mouse position but no plot appears: |
We have to fix this in our CI environment or provide a method which would allow the user to build such extensions, e.g. the Qt5 plugin. You are using Ubuntu, right? |
Yes, I have an ubuntu machine (which has this issue) and a mac (on which I can run your QML+GR example). Thanks for looking into this! |
Are you using Ubuntu, Hombrew or the official qt.io Qt5 ? |
I installed QML libraries on my ubuntu machine using this command:
|
Update: I've noticed that, at least on Gtk, the GR plot saved as svg displays correctly as a GtkImage. I was wondering whether it's possible to change the |
Well, this was easier than I thought, so now it uses SVG if available and falls back to PNG otherwise. Probably some config options would be good to have, as well as a translation of the Julia MIME type to Qt so all Qt image formats would be supported automatically. The plots example in master automatically picks this up. |
In the meantime, you can use native GR/Qt graphics with QML, as shown in this GR example. So, there is no need for PNGs or SVGs to display graphics in QML. The above method is much faster! |
Possibly related to JuliaGraphics/QML.jl#53
Running "example/plot.jl" gives me this:
I think it may be a linux specific problem (I installed QML using the libraries in #52).
The text was updated successfully, but these errors were encountered: