Skip to content

Do not move PlotCurveItem to origin#2950

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
j9ac9k:fix-svg-exporter
Mar 7, 2024
Merged

Do not move PlotCurveItem to origin#2950
j9ac9k merged 1 commit intopyqtgraph:masterfrom
j9ac9k:fix-svg-exporter

Conversation

@j9ac9k
Copy link
Copy Markdown
Member

@j9ac9k j9ac9k commented Mar 7, 2024

Fixes #2941
Un-fixes #2661

The way I previously decided to fix #2661 was to shift PlotCurveItems to be between (-1, 1). There are other complications with shifting the curve about the origin using PlotCurveItem.setData(). Furthermore, that fix only addressed the case of PlotCurveItem, and not other GraphicsItems.

An issue did come up with after doing an SVG export, where the PlotCurveItem was moved out of the view with log-mode was enabled.

The correct fix is likely to apply a transform to the GraphicsItems so they are positioned about the origin, and then have the QPainter instance look there, instead of where the view is. More experimentation would be needed to make that work.

The way I previously decided to fix pyqtgraph#2661 was to shift PlotCurveItems
to be between (-1, 1).  There are other complications with shifting the
curve about the origin using PlotCurveItem.setData().  Furthermore, that
fix only addressed the case of PlotCurveItem, and not other
GraphicsItems.

An issue did come up with after doing an SVG export, where the
PlotCurveItem was moved out of the view with log-mode was enabled.

The correct fix is likely to apply a transform to the GraphicsItems so
they are positioned about the origin, and then have the QPainter
instance look there, instead of where the view is.  More experimentation
would be needed to make that work.
@j9ac9k j9ac9k force-pushed the fix-svg-exporter branch from d565ba9 to 14d4b52 Compare March 7, 2024 16:03
@j9ac9k j9ac9k merged commit abfa6c9 into pyqtgraph:master Mar 7, 2024
@j9ac9k j9ac9k deleted the fix-svg-exporter branch March 8, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SVG exporter output has errors when data values are very large SVG Exporter Moves PlotObjects

1 participant