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
I created a R markdown file which creats pie charts by using ggplot2 and svglite, specifying the width and heights by fig.width and fig.height option and their magnifying rate by out.width and out.height option as follows.
Then, I expected all graphs generated to have exactly the same graph size, but the result was different: some were at half size as specified but the others were not. I used the latest versions of R and all packages as of 18th June 2024. The generated html file is attatched by changing its extension from html to txt.
In fact, in the example above, some graphs are identical: q1 = q8, q2 = q7, and q3 = q6 = q9. This is a structure actually I faced with in my real data analysis. Probably, the generated html keeps only the last of the exacly same graphs embedded (q8, q7, and q9 as well as non-duplicated graphs, q4, q5 and q10) and displays the others (q1, q2, q3, and q6) by referencing the embedded one through <use href=...> as above. For example, q3, q6 and q9 were identical; the last one (q9) was embedded in the html and the others (q3 and q6) were displayed by referencing the embedded svg of q9 through <use href=...>. The problem seemed that out.width and out.height options did not work for 'referencing graphs' such as q1, q2, q3 and q6 which were diplayed at 100% size through html code like above, while they did for the non-duplicated ones (q4, q5 and q10) and the last ones (q7, q8 and q9) which were at half size as specified through html code like below:
I created a R markdown file which creats pie charts by using
ggplot2
andsvglite
, specifying the width and heights byfig.width
andfig.height
option and their magnifying rate byout.width
andout.height
option as follows.Then, I expected all graphs generated to have exactly the same graph size, but the result was different: some were at half size as specified but the others were not. I used the latest versions of R and all packages as of 18th June 2024. The generated html file is attatched by changing its extension from html to txt.
PieChart.txt
I scrutinized the generated html file in which svg files were embedded, Then, I thought the problem is the html code like below.
In fact, in the example above, some graphs are identical:
q1
=q8
,q2
=q7
, andq3
=q6
=q9
. This is a structure actually I faced with in my real data analysis. Probably, the generated html keeps only the last of the exacly same graphs embedded (q8
,q7
, andq9
as well as non-duplicated graphs,q4
,q5
andq10
) and displays the others (q1
,q2
,q3
, andq6
) by referencing the embedded one through<use href=...>
as above. For example,q3
,q6
andq9
were identical; the last one (q9
) was embedded in the html and the others (q3
andq6
) were displayed by referencing the embedded svg ofq9
through<use href=...>
. The problem seemed thatout.width
andout.height
options did not work for 'referencing graphs' such asq1
,q2
,q3
andq6
which were diplayed at 100% size through html code like above, while they did for the non-duplicated ones (q4
,q5
andq10
) and the last ones (q7
,q8
andq9
) which were at half size as specified through html code like below:Thanks.
The text was updated successfully, but these errors were encountered: