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;








0















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'









share|improve this question
























  • 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

















0















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'









share|improve this question
























  • 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













0












0








0








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'









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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

















  • 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
















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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해