CSVexporter fails when a legend is added to the plotWidgetHow to put the legend out of the plotpip install mysql-python fails with EnvironmentError: mysql_config not foundAutoranging PlotWidget without padding (pyqtgraph)Updating n PlotWidgets in PyQt4 for Live PlottingQThreading PyQtGraph PlotWidgets in PyQt4How to make a label inside a PlotWidget?How to I adjust the height of a PlotWidget?Catch PlotWidget coordinates with mouse clickMousePressEvent inside my Pyqt PlotWidget- Simulate eventCreating legend in Qt widget, and adding a label
What is the most expensive material in the world that could be used to create Pun-Pun's lute?
How to write a column outside the braces in a matrix?
How to stop co-workers from teasing me because I know Russian?
Was there a shared-world project before "Thieves World"?
Is the 5 MB static resource size limit 5,242,880 bytes or 5,000,000 bytes?
Do I have to worry about players making “bad” choices on level up?
What happened to Captain America in Endgame?
Question about かな and だろう
A Note on N!
What does the "ep" capability mean?
Will tsunami waves travel forever if there was no land?
Is there really no use for MD5 anymore?
Binary Numbers Magic Trick
Critique of timeline aesthetic
What's the polite way to say "I need to urinate"?
Realistic Necromancy?
Why is it that the natural deduction method can't test for invalidity?
Exchange,swap or switch
How to pronounce 'C++' in Spanish
Does a semiconductor follow Ohm's law?
Interpret a multiple linear regression when Y is log transformed
Fizzy, soft, pop and still drinks
Don’t seats that recline flat defeat the purpose of having seatbelts?
How to creep the reader out with what seems like a normal person?
CSVexporter fails when a legend is added to the plotWidget
How to put the legend out of the plotpip install mysql-python fails with EnvironmentError: mysql_config not foundAutoranging PlotWidget without padding (pyqtgraph)Updating n PlotWidgets in PyQt4 for Live PlottingQThreading PyQtGraph PlotWidgets in PyQt4How to make a label inside a PlotWidget?How to I adjust the height of a PlotWidget?Catch PlotWidget coordinates with mouse clickMousePressEvent inside my Pyqt PlotWidget- Simulate eventCreating legend in Qt widget, and adding a label
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm creating a charter using pyqtgraph. To export the data, I'm using pyqtgraph's built-in CSVExporter() to export csv files. However, I also tried to add a legend, it fails.
Interestingly enough, the legend can exist on its own, and everything works fine. From my understanding, the legend actually starts being filled in with the names of the curves when you add the name parameter when instantiating each PlotItem. This is when the exporter fails.
I have a running list of PlotItem objects and instantiate them as so:
plot = self.plotWidget.plot(self.data[i], pen=(i, self.data.size), name=i)
self.traces.append(plot)
I get the following error only when the legend has data filled in. That is, only when it displays something like
"curve 1"
"curve 2"
File "app.py", line 335, in saveData
exporter.export(fileName='data.csv')
File "/Users/sammyalhashemi/Documents/Charter/python-gui/venv/lib/python3.6/site-packages/pyqtgraph/exporters/CSVExporter.py", line 44, in export
name = c.name().replace('"', '""') + '_'
AttributeError: 'int' object has no attribute 'replace'
python pyqt pyqt5 pyqtgraph
add a comment |
I'm creating a charter using pyqtgraph. To export the data, I'm using pyqtgraph's built-in CSVExporter() to export csv files. However, I also tried to add a legend, it fails.
Interestingly enough, the legend can exist on its own, and everything works fine. From my understanding, the legend actually starts being filled in with the names of the curves when you add the name parameter when instantiating each PlotItem. This is when the exporter fails.
I have a running list of PlotItem objects and instantiate them as so:
plot = self.plotWidget.plot(self.data[i], pen=(i, self.data.size), name=i)
self.traces.append(plot)
I get the following error only when the legend has data filled in. That is, only when it displays something like
"curve 1"
"curve 2"
File "app.py", line 335, in saveData
exporter.export(fileName='data.csv')
File "/Users/sammyalhashemi/Documents/Charter/python-gui/venv/lib/python3.6/site-packages/pyqtgraph/exporters/CSVExporter.py", line 44, in export
name = c.name().replace('"', '""') + '_'
AttributeError: 'int' object has no attribute 'replace'
python pyqt pyqt5 pyqtgraph
provider a Minimal, Complete, and Verifiable example
– eyllanesc
Mar 22 at 18:31
Okay, I actually figured it out. It occurs because when instantiating a PlotItem, for example when you callplotWidget.plot(data, pen, name), there is no check that thenameparameter must be a string. As a test, I was plugging inints, and thus the exporter was looking at integer names, and hence the above error. I think this an extra check should be added to pyqtgraph, or at least make it more clear in the docs.
– StarLlama
Mar 23 at 0:00
add a comment |
I'm creating a charter using pyqtgraph. To export the data, I'm using pyqtgraph's built-in CSVExporter() to export csv files. However, I also tried to add a legend, it fails.
Interestingly enough, the legend can exist on its own, and everything works fine. From my understanding, the legend actually starts being filled in with the names of the curves when you add the name parameter when instantiating each PlotItem. This is when the exporter fails.
I have a running list of PlotItem objects and instantiate them as so:
plot = self.plotWidget.plot(self.data[i], pen=(i, self.data.size), name=i)
self.traces.append(plot)
I get the following error only when the legend has data filled in. That is, only when it displays something like
"curve 1"
"curve 2"
File "app.py", line 335, in saveData
exporter.export(fileName='data.csv')
File "/Users/sammyalhashemi/Documents/Charter/python-gui/venv/lib/python3.6/site-packages/pyqtgraph/exporters/CSVExporter.py", line 44, in export
name = c.name().replace('"', '""') + '_'
AttributeError: 'int' object has no attribute 'replace'
python pyqt pyqt5 pyqtgraph
I'm creating a charter using pyqtgraph. To export the data, I'm using pyqtgraph's built-in CSVExporter() to export csv files. However, I also tried to add a legend, it fails.
Interestingly enough, the legend can exist on its own, and everything works fine. From my understanding, the legend actually starts being filled in with the names of the curves when you add the name parameter when instantiating each PlotItem. This is when the exporter fails.
I have a running list of PlotItem objects and instantiate them as so:
plot = self.plotWidget.plot(self.data[i], pen=(i, self.data.size), name=i)
self.traces.append(plot)
I get the following error only when the legend has data filled in. That is, only when it displays something like
"curve 1"
"curve 2"
File "app.py", line 335, in saveData
exporter.export(fileName='data.csv')
File "/Users/sammyalhashemi/Documents/Charter/python-gui/venv/lib/python3.6/site-packages/pyqtgraph/exporters/CSVExporter.py", line 44, in export
name = c.name().replace('"', '""') + '_'
AttributeError: 'int' object has no attribute 'replace'
python pyqt pyqt5 pyqtgraph
python pyqt pyqt5 pyqtgraph
edited Mar 22 at 18:30
eyllanesc
90.2k123565
90.2k123565
asked Mar 22 at 18:09
StarLlamaStarLlama
206
206
provider a Minimal, Complete, and Verifiable example
– eyllanesc
Mar 22 at 18:31
Okay, I actually figured it out. It occurs because when instantiating a PlotItem, for example when you callplotWidget.plot(data, pen, name), there is no check that thenameparameter must be a string. As a test, I was plugging inints, and thus the exporter was looking at integer names, and hence the above error. I think this an extra check should be added to pyqtgraph, or at least make it more clear in the docs.
– StarLlama
Mar 23 at 0:00
add a comment |
provider a Minimal, Complete, and Verifiable example
– eyllanesc
Mar 22 at 18:31
Okay, I actually figured it out. It occurs because when instantiating a PlotItem, for example when you callplotWidget.plot(data, pen, name), there is no check that thenameparameter must be a string. As a test, I was plugging inints, and thus the exporter was looking at integer names, and hence the above error. I think this an extra check should be added to pyqtgraph, or at least make it more clear in the docs.
– StarLlama
Mar 23 at 0:00
provider a Minimal, Complete, and Verifiable example
– eyllanesc
Mar 22 at 18:31
provider a Minimal, Complete, and Verifiable example
– eyllanesc
Mar 22 at 18:31
Okay, I actually figured it out. It occurs because when instantiating a PlotItem, for example when you call
plotWidget.plot(data, pen, name), there is no check that the name parameter must be a string. As a test, I was plugging in ints, and thus the exporter was looking at integer names, and hence the above error. I think this an extra check should be added to pyqtgraph, or at least make it more clear in the docs.– StarLlama
Mar 23 at 0:00
Okay, I actually figured it out. It occurs because when instantiating a PlotItem, for example when you call
plotWidget.plot(data, pen, name), there is no check that the name parameter must be a string. As a test, I was plugging in ints, and thus the exporter was looking at integer names, and hence the above error. I think this an extra check should be added to pyqtgraph, or at least make it more clear in the docs.– StarLlama
Mar 23 at 0:00
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55305530%2fcsvexporter-fails-when-a-legend-is-added-to-the-plotwidget%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55305530%2fcsvexporter-fails-when-a-legend-is-added-to-the-plotwidget%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
provider a Minimal, Complete, and Verifiable example
– eyllanesc
Mar 22 at 18:31
Okay, I actually figured it out. It occurs because when instantiating a PlotItem, for example when you call
plotWidget.plot(data, pen, name), there is no check that thenameparameter must be a string. As a test, I was plugging inints, and thus the exporter was looking at integer names, and hence the above error. I think this an extra check should be added to pyqtgraph, or at least make it more clear in the docs.– StarLlama
Mar 23 at 0:00