I've been trying to build some financial charts for the past few days, and
while I managed to get the data plotted properly, I'm really struggling
with customization. The runnable examples are more focused on the various
ways to plot different data than changing the default look and feel, and
the documentation is very comprehensive but it's easy for someone new to
get lost in all the layers of depth. I'm hoping someone can at least point
me in the right direction with some of these.
1. By default, plots only have a border on the left and bottom. I'd like to
have a border on all 4 sides. I'd also like to move the Y axis labels from
the left to the right. What I tried:
plotItem.getAxis("left").setStyle(showValues=False)
plotItem.getAxis("right").setStyle(showValues=True)
which did remove them from the left side, but didn't move them to the
right, presumably because the right axis has no data associated with it. To
draw the lines on the top and right, I tried:
plotItem.getAxis("top").setPen(pg.mkPen("#000"))
plotItem.getAxis("right").setPen(pg.mkPen("#000"))
which did absolutely nothing, at this point leading me to believe that
those axes simply don't exist by default.
2. The grid has two types of lines with differing thickness. How can I make
it display only one thickness?
3. How do I completely disable the auto-scale button that shows up in the
bottom left when hovering over a plot? I never use it and it's pretty
distracting when it keeps popping up.
4. When zooming out past a certain point, the plot will auto-scale the data
to fit. How can I make the zoom only zoom, and only allow scaling
explicitly via right-click dragging?
5. I have one main plot, and 2 smaller plots below it which are linked to
it via the X axis. I want scale changes made on the main plot to apply to
the smaller plots, but not the other way around. Actually, the only mouse
interaction I want to allow with the smaller plots is panning, zoom should
be fixed, and scaling should only work on the X axis based on the scaling
of the main plot. For starters, I tried passing setMouseEnabled=(False,
False) and setMouseEnabled=False when constructing the smaller plots, but
they still accept all mouse input.
6. I'd like to have dashed lines on the X and Y axis following my cursor. I
found InfiniteLine which seems suitable for the task, but I didn't notice
and way to link it to mouse movement. Also, assuming that's doable, it
would be nice to share the X line with the smaller plots mentioned above
(in this case, allowing cursor position changes on the smaller plots to
propagate to the main one).
7. On the smaller plots, I have a curve as my data, and some lines at fixed
points on the Y axis added via plot.addLine(). Is it possible to fill the
area between the Y line and certain values on the curve? Specifically, I'm
plotting RSI and would like to fill the area between the curve and Y 70
point when the curve is > 70, and between the curve and Y 30 line when the
curve is < 30. I found FillBetweenItem, but that doesn't seem to work with
the Y lines, and I'm not sure it would be the desired behavior anyway.
Finally, not really a question but more of a bug report. Unless there are
ticks present in the location, lines on the Y axis will actually overlap
the axis itself. This applies to both fixed and dynamic lines. Upscaled
image for reference: http://imgur.com/xbZZwhV Any workarounds?
Sorry for the ton of questions, I struggled with it for a good while until
I broke down and decided to ask for help, as I'm making no further progress
at this point.
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/bd1796b0-9cf6-4d3f-b9ee-326714e7af63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.