You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Combobox improvements in qt figure options editor #5341
I need some help to generate QImages with representations of the marker/line styles in order to address my 3rd point. It'll probably also involve fiddling more with fomrlayout...
The little keys in the legend are produced by the "legend handlers" in legend_handler.py. There is a mapping from each Artist class to a handler class (the mapping itself can be obtained from a Legend object) and the handler class takes care of creating the right artist to draw in the legend.
from matplotlib import pyplot as plt
from matplotlib.backends.backend_agg import RendererAgg
from matplotlib.legend import Legend
from matplotlib.lines import Line2D
from PyQt4.QtGui import QImage
p = Legend(plt.gca(), [Line2D([], [], marker="*")], [""]).get_frame()
n = 50; dpi = 72
r = RendererAgg(n, n, dpi)
p.draw(r)
s = r._renderer.tostring_bgra() # endianness, same as backend_qt5agg.py
q = QImage(s, r.width, r.height, QImage.Format_ARGB32)
q.save("/tmp/test.png")
This seems to save an empty image, even though s seems to contain a nontrivial pattern (not just a bunch of \x00\xff\xff\xff but also some other pixels). Any hint of what I'm doing wrong?
Activity
mdboom commentedon Oct 28, 2015
Cc: @jrevans, @mfitzp as recent contributors to the Qt editor.
I think these are all good ideas. Are you offering to develop pull requests, or just making suggestions?
Sort and uniquify style entries in figure options.
anntzer commentedon Oct 28, 2015
I need some help to generate QImages with representations of the marker/line styles in order to address my 3rd point. It'll probably also involve fiddling more with fomrlayout...
tacaswell commentedon Oct 29, 2015
You can use svg/png for that purpose.
anntzer commentedon Oct 29, 2015
Sure, but I also need to figure out where to put the plot, what size to use and so on. How are the representations in legends created, for example?
mdboom commentedon Oct 29, 2015
The little keys in the legend are produced by the "legend handlers" in
legend_handler.py. There is a mapping from each Artist class to a handler class (the mapping itself can be obtained from aLegendobject) and the handler class takes care of creating the right artist to draw in the legend.anntzer commentedon Oct 29, 2015
I'm going to need some more help:
This seems to save an empty image, even though
sseems to contain a nontrivial pattern (not just a bunch of\x00\xff\xff\xffbut also some other pixels). Any hint of what I'm doing wrong?Sort and uniquify style entries in figure options.
Sort and uniquify style entries in figure options.
Sort and uniquify style entries in figure options.
anntzer commentedon Feb 28, 2021
Icons is probably too complex to implement to be worth it; the other parts have been implemented already.