-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Handle case of nonnegative or tozero rangemodes for inside ticklabels #5331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bc38ade
handle case of nonnegative rangemode for inside ticklabels
archmoj f31d97c
should not depend on the rangemode of counter axis
archmoj be762b6
Revert "should not depend on the rangemode of counter axis"
archmoj 15b002a
set nopad instead of zero pad
archmoj 0b254e7
remove one unnecessary check - improve tests
archmoj 4bb0995
remove second check
archmoj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
{ | ||
"data": [{ | ||
"xaxis": "x", | ||
"yaxis": "y", | ||
"type": "bar", | ||
"orientation": "h", | ||
"x": [ | ||
67.5, | ||
23.3, | ||
5.2, | ||
1.8, | ||
0.8, | ||
0.7, | ||
0.23, | ||
0.1, | ||
0.1 | ||
], | ||
"y": [ | ||
"Hydro", | ||
"Solid biomass", | ||
"Wind", | ||
"Ethanol", | ||
"Renewable municipal waste", | ||
"Solar thermal", | ||
"Biodiesel", | ||
"Solar photovoltaic", | ||
"Tidal" | ||
] | ||
}, { | ||
"xaxis": "x2", | ||
"yaxis": "y2", | ||
"type": "bar", | ||
"orientation": "h", | ||
"x": [ | ||
67.5, | ||
23.3, | ||
5.2, | ||
1.8, | ||
0.8, | ||
0.7, | ||
0.23, | ||
0.1, | ||
0.1 | ||
], | ||
"y": [ | ||
"Hydro", | ||
"Solid biomass", | ||
"Wind", | ||
"Ethanol", | ||
"Renewable municipal waste", | ||
"Solar thermal", | ||
"Biodiesel", | ||
"Solar photovoltaic", | ||
"Tidal" | ||
] | ||
}, { | ||
"xaxis": "x3", | ||
"yaxis": "y3", | ||
"type": "bar", | ||
"orientation": "v", | ||
"y": [ | ||
67.5, | ||
23.3, | ||
5.2, | ||
1.8, | ||
0.8, | ||
0.7, | ||
0.23, | ||
0.1, | ||
0.1 | ||
], | ||
"x": [ | ||
"Hydro", | ||
"Solid biomass", | ||
"Wind", | ||
"Ethanol", | ||
"Renewable municipal waste", | ||
"Solar thermal", | ||
"Biodiesel", | ||
"Solar photovoltaic", | ||
"Tidal" | ||
] | ||
}, { | ||
"xaxis": "x4", | ||
"yaxis": "y4", | ||
"type": "bar", | ||
"orientation": "v", | ||
"y": [ | ||
67.5, | ||
23.3, | ||
5.2, | ||
1.8, | ||
0.8, | ||
0.7, | ||
0.23, | ||
0.1, | ||
0.1 | ||
], | ||
"x": [ | ||
"Hydro", | ||
"Solid biomass", | ||
"Wind", | ||
"Ethanol", | ||
"Renewable municipal waste", | ||
"Solar thermal", | ||
"Biodiesel", | ||
"Solar photovoltaic", | ||
"Tidal" | ||
] | ||
}], | ||
"layout": { | ||
"xaxis": { | ||
"rangemode": "nonnegative", | ||
"anchor": "y", | ||
"domain": [0, 0.475], | ||
"side": "bottom", | ||
"ticklabelposition": "outside", | ||
"gridcolor": "white" | ||
}, | ||
"yaxis": { | ||
"anchor": "x", | ||
"domain": [0, 0.475], | ||
"side": "left", | ||
"ticklabelposition": "inside", | ||
"gridcolor": "white" | ||
}, | ||
"xaxis2": { | ||
"rangemode": "nonnegative", | ||
"anchor": "y2", | ||
"domain": [0.525, 1], | ||
"side": "bottom", | ||
"ticklabelposition": "inside", | ||
"gridcolor": "white" | ||
}, | ||
"yaxis2": { | ||
"anchor": "x2", | ||
"domain": [0, 0.475], | ||
"side": "right", | ||
"ticklabelposition": "inside", | ||
"gridcolor": "white" | ||
}, | ||
"xaxis3": { | ||
"anchor": "y3", | ||
"domain": [0.525, 1], | ||
"side": "top", | ||
"ticklabelposition": "inside", | ||
"gridcolor": "white" | ||
}, | ||
"yaxis3": { | ||
"rangemode": "nonnegative", | ||
"anchor": "x3", | ||
"domain": [0.525, 1], | ||
"side": "right", | ||
"ticklabelposition": "inside", | ||
"gridcolor": "white" | ||
}, | ||
"xaxis4": { | ||
"anchor": "y4", | ||
"domain": [0, 0.475], | ||
"side": "top", | ||
"ticklabelposition": "inside", | ||
"gridcolor": "white" | ||
}, | ||
"yaxis4": { | ||
"rangemode": "nonnegative", | ||
"anchor": "x4", | ||
"domain": [0.525, 1], | ||
"side": "left", | ||
"ticklabelposition": "outside", | ||
"gridcolor": "white" | ||
}, | ||
"font": { | ||
"size": 24 | ||
}, | ||
"plot_bgcolor": "lightblue", | ||
"showlegend": false, | ||
"width": 1000, | ||
"height": 1000, | ||
"margin": { | ||
"t": 40, | ||
"b": 40, | ||
"l": 40, | ||
"r": 40 | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want any of these
rangemode
conditions, now that you havenopad
in the fallback conditions above. Basically in your newticklabelposition-5
mock, only the blue one should have labels overlapping bars. Maybe you want to flip either the red or green labels to the bottom, in which case those would overlap the bars too, but otherwise just the blue should hit this condition.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed one of the checks in 0b254e7 but kept the other one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test images look good now, but I don't understand what the remaining check is doing - can you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I drop the second check as you suggested.
After further investigation, it looks now that we could possibly drop
padInsideLabelsOnThisAxis
function which used to tweaks the range for giving the start/end labels more chance to appear on the graph. But I'd rather trying that in a separate PR.